aix: remove libgomp and libatomic archives before creating FAT archives
authorClément Chigot <clement.chigot@atos.net>
Tue, 1 Sep 2020 09:32:09 +0000 (11:32 +0200)
committerDavid Edelsohn <dje.gcc@gmail.com>
Sun, 11 Oct 2020 21:30:24 +0000 (17:30 -0400)
AIX caches shared objects in archives with read-other permission.
libgomp and libatomic might be in use during the build or testing, which
may cause archiver operations on them to fail.  This patch adjusts the
Makefile fragments to delete the library archives before creating fresh
archives containing both the 32 bit and 64 bit shared objects.

libatomic/ChangeLog:

2020-10-11  Clement Chigot  <clement.chigot@atos.net>

* config/t-aix: Delete and recreate libatomic before creating
FAT library.

libgomp/ChangeLog:

2020-10-11  Clement Chigot  <clement.chigot@atos.net>

* config/t-aix: Delete and recreate libgomp before creating
FAT library.

libatomic/config/t-aix
libgomp/config/t-aix

index 08607727574f3c376a43e9460c81ae6fbee0fc5f..0e76b9739d78c649ee6406a8f1a9c09c753b2b7c 100644 (file)
@@ -5,6 +5,9 @@ BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
 MAJOR=1
 ARX=$(shell echo $(AR) | sed -e 's/-X[^ ]*//g')
 all-local:
+       -rm -f .libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a
+       $(AR) rc .libs/$(PACKAGE).a .libs/$(PACKAGE).so.$(MAJOR)
+       $(AR) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
        $(ARX) -X$(BITS) rc .libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
        $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
 endif
index 35bff8bb019f6ee6fe157b93189946122c83ddf6..f85382f962d58abb61926e5c0f7a4cbc65c6c840 100644 (file)
@@ -4,6 +4,9 @@ BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
 ARX=$(shell echo $(AR) | sed -e 's/-X[^ ]*//g')
 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 all-local:
+       -rm -f .libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a
+       $(AR) rc .libs/$(PACKAGE).a .libs/$(PACKAGE).so.$(MAJOR)
+       $(AR) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
        $(ARX) -X$(BITS) rc .libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
        $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
 endif