libgo patch committed: Add AIX FAT libraries support
Ian Lance Taylor
iant@golang.org
Thu Jul 23 21:27:18 GMT 2020
This patch by Clément Chigot adds AIX FAT library support to libgo.
This follows the same general idea as support in other GCC libraries
like libgcc and libsdc++. Committed to mainline.
Ian
-------------- next part --------------
83cc5e2b2f887d4bb2305658da382a65fdcaab29
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 878df0d233a..d23e7377306 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -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.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 5b1807228ad..52a8330ed2a 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -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
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 235d867ccda..841cba1768e 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -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
More information about the Gcc-patches
mailing list