From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1059) id 03F2538708B7; Thu, 27 Aug 2020 18:08:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03F2538708B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598551711; bh=5Jy5HXFGi2jKYy1XrNW51WSi1bFsII18+lIR/SERyrA=; h=From:To:Subject:Date:From; b=P4G0saEw8pCe0WgKq/yi6SDj64bbR95KXwxYSXEz7aHbNc2Fs1aCkgx3D+Slws/4c C6L05jEjQRwEe1IbrLXEs/96PPhhyjzFVutBDPZFFzWkZj4/E9bfynz/iDhLHE2r8d kQxOgN5W6mcX45RJMlLv6Y+Et9qWeC2jDbOw9VBU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Nathan Sidwell To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-modules] libgo: correctly handle AIX FAT library creation X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Cl=C3=A9ment_Chigot?= X-Git-Refname: refs/heads/devel/c++-modules X-Git-Oldrev: d58f078ce2d53e5dab6b3d0d5f960504268e1894 X-Git-Newrev: d040555a0611bd47cb5878443bbb5097e4259d82 Message-Id: <20200827180831.03F2538708B7@sourceware.org> Date: Thu, 27 Aug 2020 18:08:31 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 18:08:31 -0000 https://gcc.gnu.org/g:d040555a0611bd47cb5878443bbb5097e4259d82 commit d040555a0611bd47cb5878443bbb5097e4259d82 Author: Clément Chigot Date: Fri Aug 7 14:45:34 2020 +0200 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 Diff: --- gcc/go/gofrontend/MERGE | 2 +- libgo/Makefile.am | 11 +++++++++-- libgo/Makefile.in | 13 ++++++++++--- libgo/configure | 8 ++++---- libgo/configure.ac | 8 ++++---- libgo/testsuite/Makefile.in | 2 +- 6 files changed, 29 insertions(+), 15 deletions(-) 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/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. diff --git a/libgo/configure b/libgo/configure index 74bf072aa85..7be95718962 100755 --- a/libgo/configure +++ b/libgo/configure @@ -733,7 +733,7 @@ SED MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE -AIX_DEFAULT_ARCH +AIX_EXTRA_ARCH am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE @@ -4716,10 +4716,10 @@ 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 ;; 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 diff --git a/libgo/testsuite/Makefile.in b/libgo/testsuite/Makefile.in index ae42fad38e5..7869265851c 100644 --- a/libgo/testsuite/Makefile.in +++ b/libgo/testsuite/Makefile.in @@ -131,7 +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@ +AIX_EXTRA_ARCH = @AIX_EXTRA_ARCH@ ALLGOARCH = @ALLGOARCH@ ALLGOARCHFAMILY = @ALLGOARCHFAMILY@ ALLGOOS = @ALLGOOS@