summaryrefslogtreecommitdiff
path: root/libgo/Makefile.in
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2020-08-07 14:45:34 +0200
committerIan Lance Taylor <iant@golang.org>2020-08-12 11:33:54 -0700
commitd040555a0611bd47cb5878443bbb5097e4259d82 (patch)
tree7cbe287c97f3a5240c787d4fa311f0843e93ac56 /libgo/Makefile.in
parentd58f078ce2d53e5dab6b3d0d5f960504268e1894 (diff)
libgo: correctly handle 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. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247377
Diffstat (limited to 'libgo/Makefile.in')
-rw-r--r--libgo/Makefile.in13
1 files changed, 10 insertions, 3 deletions
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 4aa9e98e8d8..1fb8da6f552 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -380,7 +380,7 @@ CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = testsuite
ACLOCAL = @ACLOCAL@
-AIX_DEFAULT_ARCH = @AIX_DEFAULT_ARCH@
+AIX_EXTRA_ARCH = @AIX_EXTRA_ARCH@
ALLGOARCH = @ALLGOARCH@
ALLGOARCHFAMILY = @ALLGOARCHFAMILY@
ALLGOOS = @ALLGOOS@
@@ -3118,10 +3118,17 @@ clean-local: clean-multi
distclean-local: distclean-multi
maintainer-clean-local: maintainer-clean-multi
all-local: $(ALL_LOCAL_DEPS)
+
+# 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
# Tell versions [3.59,3.63) of GNU make to not export all variables.