diff options
author | David Edelsohn <dje.gcc@gmail.com> | 2020-05-15 17:46:08 -0400 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 2020-06-21 14:14:46 -0400 |
commit | 47ddb895df311e546a6f54345e18b8749ac50324 (patch) | |
tree | 0b30e4df51b10fe25ab50b0119daeebd2c99ac6d /libstdc++-v3 | |
parent | 8ee2640bfdc62f835ec9740278f948034bc7d9f1 (diff) | |
download | gcc-47ddb895df311e546a6f54345e18b8749ac50324.zip gcc-47ddb895df311e546a6f54345e18b8749ac50324.tar.gz gcc-47ddb895df311e546a6f54345e18b8749ac50324.tar.bz2 |
aix: Add GCC64 configuration and FAT target libraries.
This patch adds the ability to configure GCC on AIX to build as a
64 bit application and to build target libraries "FAT" libraries in both
32 bit and 64 bit mode.
The patch adds makefile fragment hooks to target libraries that allows
them to include target-specific rules. The target specific rules for
AIX place both 32 bit and 64 bit objects and shared objects
in archives at the top-level, not multilib subdirectories. The
multilibs are built in subdirectories, but must be combined during the
last parts of the target library build process. Because of the way
that GCC bootstrap works, the libraries must be combined during the
multiple stages of GCC bootstrap, not solely when installed in the
final destination, so the libraries are correct at the end of
each target library build stage, not solely an install recipe.
gcc/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* config.gcc: Use t-aix64, biarch64 and default64 for cpu_is_64bit.
* config/rs6000/aix72.h (ASM_SPEC): Remove aix64 option.
(ASM_SPEC32): New.
(ASM_SPEC64): New.
(ASM_CPU_SPEC): Remove vsx and altivec options.
(CPP_SPEC_COMMON): Rename from CPP_SPEC.
(CPP_SPEC32): New.
(CPP_SPEC64): New.
(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
(TARGET_DEFAULT): Only define if not BIARCH.
(LIB_SPEC_COMMON): Rename from LIB_SPEC.
(LIB_SPEC32): New.
(LIB_SPEC64): New.
(LINK_SPEC_COMMON): Rename from LINK_SPEC.
(LINK_SPEC32): New.
(LINK_SPEC64): New.
(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
(CPP_SPEC): Same.
(CPLUSPLUS_CPP_SPEC): Same.
(LIB_SPEC): Same.
(LINK_SPEC): Same.
(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
* config/rs6000/defaultaix64.h: New file.
* config/rs6000/t-aix64: New file.
libgcc/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* config.host (extra_parts): Add crtcxa_64 and crtdbase_64.
* config/rs6000/t-aix-cxa: Explicitly compile 32 bit with -maix32
and 64 bit with -maix64.
* config/rs6000/t-slibgcc-aix: Remove extra @multilib_dir@ level.
Build and install AIX-style FAT libraries.
libgomp/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
* Makefile.in: Regenerate
* configure.ac (tmake_file): Substitute.
* configure: Regenerate.
* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
* config/t-aix: New file.
libstdc++-v3/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
* Makefile.in: Regenerate.
* configure.ac (tmake_file): Substitute.
* configure: Regenerate.
* configure.host (aix*): Define tmake_file.
* config/os/aix/t-aix: New file.
libatomic/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
* Makefile.in: Regenerate.
* configure.ac (tmake_file): Substitute.
* configure: Regenerate.
* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
* config/t-aix: New file.
libgfortran/ChangeLog
2020-06-21 David Edelsohn <dje.gcc@gmail.com>
* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
* Makefile.in: Regenerate.
* configure.ac (tmake_file): Substitute.
* configure: Regenerate.
* configure.host: Add system configury stanza. Define tmake_file.
* config/t-aix: New file.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/Makefile.am | 5 | ||||
-rw-r--r-- | libstdc++-v3/Makefile.in | 6 | ||||
-rw-r--r-- | libstdc++-v3/config/os/aix/t-aix | 9 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 30 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 11 | ||||
-rw-r--r-- | libstdc++-v3/configure.host | 16 |
6 files changed, 57 insertions, 20 deletions
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am index da021ec..62c2c32 100644 --- a/libstdc++-v3/Makefile.am +++ b/libstdc++-v3/Makefile.am @@ -173,4 +173,9 @@ AM_MAKEFLAGS = \ # Subdir rules rely on $(FLAGS_TO_PASS) FLAGS_TO_PASS = $(AM_MAKEFLAGS) +# target overrides +ifneq ($(tmake_file),) +include $(tmake_file) +endif + include $(top_srcdir)/../multilib.am diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 8f11aaf..e8987d4 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -377,6 +377,7 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ thread_header = @thread_header@ +tmake_file = @tmake_file@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -817,6 +818,11 @@ install-dvi: # automake-generated TAGS rule. Make a simple one here. TAGS: tags-recursive $(LISP) +# target overrides +ifneq ($(tmake_file),) +include $(tmake_file) +endif + # GNU Make needs to see an explicit $(MAKE) variable in the command it # runs to enable its job server during parallel builds. Hence the # comments below. diff --git a/libstdc++-v3/config/os/aix/t-aix b/libstdc++-v3/config/os/aix/t-aix new file mode 100644 index 0000000..a588746 --- /dev/null +++ b/libstdc++-v3/config/os/aix/t-aix @@ -0,0 +1,9 @@ +ifeq ($(MULTIBUILDTOP),) +BITS=$(shell if test -z "`ar -X64 t src/.libs/$(PACKAGE).a`" ; then \ + echo '64'; else echo '32'; fi) +MAJOR=$(firstword $(subst :, ,$(libtool_VERSION))) +all-local: + ar -X$(BITS) rc src/.libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)-v3/src/.libs/$(PACKAGE).so.$(MAJOR) + ar -X$(BITS) rc ../pthread/$(PACKAGE)-v3/src/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)-v3/src/.libs/$(PACKAGE).so.$(MAJOR) +endif + diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 4ef678e..dd54bd4 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -643,6 +643,7 @@ glibcxx_toolexecdir gxx_include_dir glibcxx_prefixdir EXTRA_CFLAGS +tmake_file CPU_OPT_BITS_RANDOM CPU_OPT_EXT_RANDOM ERROR_CONSTANTS_SRCDIR @@ -12059,7 +12060,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12062 "configure" +#line 12063 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12165,7 +12166,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12168 "configure" +#line 12169 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15857,7 +15858,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15860 "configure" +#line 15861 "configure" int main() { typedef bool atomic_type; @@ -15892,7 +15893,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15895 "configure" +#line 15896 "configure" int main() { typedef short atomic_type; @@ -15927,7 +15928,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15930 "configure" +#line 15931 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15963,7 +15964,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15966 "configure" +#line 15967 "configure" int main() { typedef long long atomic_type; @@ -16116,7 +16117,7 @@ $as_echo "mutex" >&6; } # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16119 "configure" +#line 16120 "configure" int main() { _Decimal32 d1; @@ -16158,7 +16159,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16161 "configure" +#line 16162 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -16192,7 +16193,7 @@ $as_echo "$enable_int128" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16195 "configure" +#line 16196 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -77719,6 +77720,17 @@ CPU_OPT_BITS_RANDOM=config/${cpu_opt_bits_random} +# Conditionalize the makefile for this target machine. +tmake_file_= +for f in ${tmake_file} +do + if test -f ${srcdir}/config/$f + then + tmake_file_="${tmake_file_} \$(srcdir)/config/$f" + fi +done +tmake_file="${tmake_file_}" + # Add CET specific flags if Intel CET is enabled. # Check whether --enable-cet was given. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 699e55f..ffd0079 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -528,6 +528,17 @@ AC_SUBST(ERROR_CONSTANTS_SRCDIR) AC_SUBST(CPU_OPT_EXT_RANDOM) AC_SUBST(CPU_OPT_BITS_RANDOM) +# Conditionalize the makefile for this target machine. +tmake_file_= +for f in ${tmake_file} +do + if test -f ${srcdir}/config/$f + then + tmake_file_="${tmake_file_} \$(srcdir)/config/$f" + fi +done +tmake_file="${tmake_file_}" +AC_SUBST(tmake_file) # Add CET specific flags if Intel CET is enabled. GCC_CET_FLAGS(CET_FLAGS) diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 898db37..8d1b608 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -70,6 +70,9 @@ # additional symbols to export from the shared # library, when symbol versioning is in use # +# tmake_file A list of machine-description-specific +# makefile fragments. +# # # If the defaults will not work for your platform, you need only change the # variables that won't work, i.e., you do not need to explicitly set a @@ -91,6 +94,7 @@ try_cpu=generic abi_baseline_subdir_switch=--print-multi-directory abi_tweaks_dir="cpu/generic" error_constants_dir="os/generic" +tmake_file= # HOST-SPECIFIC OVERRIDES # Set any CPU-dependent bits. @@ -206,17 +210,7 @@ case "${host_os}" in # Newer versions of AIX only support PowerPC architecture, so use # atomic instructions directly. os_include_dir="os/aix" - ;; - aix4.[3456789]*) - # We set os_include_dir to os/aix only on AIX 4.3 and newer, but - # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we - # explicitly duplicate the directory for 4.[<3]. - os_include_dir="os/aix" - atomicity_dir="os/aix" - ;; - aix4.*) - os_include_dir="os/generic" - atomicity_dir="os/aix" + tmake_file="os/aix/t-aix" ;; aix*) os_include_dir="os/generic" |