aix: FAT libraries: test native compiler mode directly
authorDavid Edelsohn <dje.gcc@gmail.com>
Mon, 13 Jul 2020 18:43:39 +0000 (14:43 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Tue, 14 Jul 2020 14:41:40 +0000 (10:41 -0400)
The FAT libraries config fragments need to know which library is native
and which is a multilib to choose the correct multilib from which to
append the additional object file or shared object file.  Testing the
top-level archive is fragile because it will fail if rebuilding.  This
patch tests the compiler preprocessing macros for the 64 bit AIX specific
__64BIT__ to determine the native mode of the compiler in MULTILIBTOP.

2020-07-14  David Edelsohn  <dje.gcc@gmail.com>

libatomic/ChangeLog

* config/t-aix: Set BITS from compiler cpp macro.

libgcc/ChangeLog

* config/rs6000/t-slibgcc-aix: Set BITS from compiler cpp macro.

libgfortran/ChangeLog

* config/t-aix: Set BITS from compiler cpp macro.

libgomp/ChangeLog

* config/t-aix: Set BITS from compiler cpp macro.

libstdc++-v3/ChangeLog

* config/os/aix/t-aix: Set BITS from compiler cpp macro.

libatomic/config/t-aix
libgcc/config/rs6000/t-slibgcc-aix
libgfortran/config/t-aix
libgomp/config/t-aix
libstdc++-v3/config/os/aix/t-aix

index 53c2d83..0f37aaa 100644 (file)
@@ -1,5 +1,5 @@
 ifeq ($(MULTIBUILDTOP),)
-BITS=$(shell if test -z "`ar -X64 t .libs/$(PACKAGE).a`" ; then \
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 #MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 MAJOR=1
index e5f8a02..b3bdda6 100644 (file)
@@ -90,7 +90,7 @@ AR_FLAGS_FOR_TARGET = -X32_64
 
 # Build and install AIX-style FAT libraries
 ifeq ($(MULTIBUILDTOP),)
-BITS=$(shell if test -z "`ar -X64 t libgcc_s.a`" ; then \
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 all: all-multi
 ifeq ($(enable_shared),yes)
index 7046aee..e661286 100644 (file)
@@ -1,5 +1,5 @@
 ifeq ($(MULTIBUILDTOP),)
-BITS=$(shell if test -z "`ar -X64 t .libs/$(PACKAGE).a`" ; then \
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 #MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 MAJOR=5
index 5d0b7e0..c3bb6c0 100644 (file)
@@ -1,5 +1,5 @@
 ifeq ($(MULTIBUILDTOP),)
-BITS=$(shell if test -z "`ar -X64 t .libs/$(PACKAGE).a`" ; then \
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 all-local:
index a588746..a5d58fa 100644 (file)
@@ -1,5 +1,5 @@
 ifeq ($(MULTIBUILDTOP),)
-BITS=$(shell if test -z "`ar -X64 t src/.libs/$(PACKAGE).a`" ; then \
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 all-local: