* (no subject)
@ 2020-08-12 18:34 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2020-08-12 18:34 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
This libgo patch by Clément Chigot correctly handles AIX FAT library
creation. The previous patch wasn't working everytime. Especially
when AR had "-X32_64", the new .so would replace the default one and
not just being added. Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2267 bytes --]
de93b8d5bfb3d2652e5e166f3e4db1c25a3a2c57
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 08daa1a5924..e443282d0e8 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-e08f1d7d1bc14c0a29eb9ee17980f14fa2397239
+fe5d94c5792f7f990004c3dee0ea501835512200
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 88ea2728bc3..1112ee27df6 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1244,8 +1244,15 @@ endif
all-local: $(ALL_LOCAL_DEPS)
MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
+
+# If we want to use "AR -r" when creating AIX FAT archives,
+# AR must be stripped of all its -X flags.
+# Otherwize, if AR was defined with -X32_64, the replace option would
+# erase the default .so when adding the extra one. There is no
+# order priority within -X flags.
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); \
+ arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
+ $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
+ $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
fi
diff --git a/libgo/configure.ac b/libgo/configure.ac
index db5848e36ad..abc58b87b53 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -38,12 +38,12 @@ case ${host} in
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'
+ if test -z "`$CC -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
+ AIX_EXTRA_ARCH='64'
else
- AIX_DEFAULT_ARCH='32'
+ AIX_EXTRA_ARCH='32'
fi
- AC_SUBST(AIX_DEFAULT_ARCH)
+ AC_SUBST(AIX_EXTRA_ARCH)
;;
esac
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-12 18:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 18:34 Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).