libgo: add AIX FAT libraries support

AIX-style libraries contains both 32 and 64 bit shared objects.
This patch follows the adding of FAT libraries support in other gcc
libraries (libgcc, listdc++, etc).

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/242957
This commit is contained in:
Clément Chigot 2020-07-16 11:29:49 +02:00 committed by Ian Lance Taylor
parent 8598657c60
commit 83cc5e2b2f
6 changed files with 45 additions and 3 deletions

View File

@ -1,4 +1,4 @@
2d105e65cca6b536320284273353b7c640b12c5f
587d4595e446c597efe97ccdc81b2f05cbc04a21
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.

View File

@ -1228,3 +1228,17 @@ distclean-local:
find . -name '*.lo.dep' -print | xargs rm -f
include $(top_srcdir)/../multilib.am
if LIBGO_IS_AIX
ALL_LOCAL_DEPS = add-aix-fat-library
else
ALL_LOCAL_DEPS =
endif
all-local: $(ALL_LOCAL_DEPS)
MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
add-aix-fat-library: all-multi
@if test "$(MULTIBUILDTOP)" = ""; then \
${AR} -X$(AIX_DEFAULT_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_DEFAULT_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
${AR} -X$(AIX_DEFAULT_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_DEFAULT_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
fi

View File

@ -377,6 +377,7 @@ CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = testsuite
ACLOCAL = @ACLOCAL@
AIX_DEFAULT_ARCH = @AIX_DEFAULT_ARCH@
ALLGOARCH = @ALLGOARCH@
ALLGOARCHFAMILY = @ALLGOARCHFAMILY@
ALLGOOS = @ALLGOOS@
@ -1160,6 +1161,9 @@ MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
@LIBGO_IS_AIX_FALSE@ALL_LOCAL_DEPS =
@LIBGO_IS_AIX_TRUE@ALL_LOCAL_DEPS = add-aix-fat-library
MAJOR = $(firstword $(subst :, ,$(libtool_VERSION)))
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -3080,6 +3084,12 @@ mostlyclean-local: mostlyclean-multi
clean-local: clean-multi
distclean-local: distclean-multi
maintainer-clean-local: maintainer-clean-multi
all-local: $(ALL_LOCAL_DEPS)
add-aix-fat-library: all-multi
@if test "$(MULTIBUILDTOP)" = ""; then \
${AR} -X$(AIX_DEFAULT_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_DEFAULT_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
${AR} -X$(AIX_DEFAULT_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_DEFAULT_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
fi
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

13
libgo/configure vendored
View File

@ -733,6 +733,7 @@ SED
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
AIX_DEFAULT_ARCH
am__fastdepCCAS_FALSE
am__fastdepCCAS_TRUE
CCASDEPMODE
@ -4713,6 +4714,14 @@ case ${host} in
# static hash tables crashes on AIX when libgo is built with O2
CFLAGS="$CFLAGS -fno-section-anchors"
GOCFLAGS="$GOCFLAGS -fno-section-anchors"
# Check default architecture for FAT library creation
if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
AIX_DEFAULT_ARCH='64'
else
AIX_DEFAULT_ARCH='32'
fi
;;
esac
@ -11492,7 +11501,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11495 "configure"
#line 11602 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11598,7 +11607,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11601 "configure"
#line 11708 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H

View File

@ -36,6 +36,14 @@ case ${host} in
# static hash tables crashes on AIX when libgo is built with O2
CFLAGS="$CFLAGS -fno-section-anchors"
GOCFLAGS="$GOCFLAGS -fno-section-anchors"
# Check default architecture for FAT library creation
if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
AIX_DEFAULT_ARCH='64'
else
AIX_DEFAULT_ARCH='32'
fi
AC_SUBST(AIX_DEFAULT_ARCH)
;;
esac

View File

@ -131,6 +131,7 @@ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
ACLOCAL = @ACLOCAL@
AIX_DEFAULT_ARCH = @AIX_DEFAULT_ARCH@
ALLGOARCH = @ALLGOARCH@
ALLGOARCHFAMILY = @ALLGOARCHFAMILY@
ALLGOOS = @ALLGOOS@