From 47ddb895df311e546a6f54345e18b8749ac50324 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Fri, 15 May 2020 17:46:08 -0400 Subject: 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 * 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 * 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 * 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 * 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 * 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 * 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. --- libatomic/Makefile.am | 5 +++++ libatomic/Makefile.in | 6 ++++++ libatomic/config/t-aix | 10 ++++++++++ libatomic/configure | 18 ++++++++++++++++-- libatomic/configure.ac | 13 +++++++++++++ libatomic/configure.tgt | 6 ++++++ 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 libatomic/config/t-aix (limited to 'libatomic') diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am index 133fbbca77e..f169d505227 100644 --- a/libatomic/Makefile.am +++ b/libatomic/Makefile.am @@ -153,4 +153,9 @@ libatomic_convenience_la_LIBADD = $(libatomic_la_LIBADD) all-multi: $(libatomic_la_LIBADD) $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE) +# target overrides +ifneq ($(tmake_file),) +include $(tmake_file) +endif + include $(top_srcdir)/../multilib.am diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index a51807e95c9..e8d47f28364 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -376,6 +376,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -862,6 +863,11 @@ vpath % $(strip $(search_path)) all-multi: $(libatomic_la_LIBADD) $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE) +# 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/libatomic/config/t-aix b/libatomic/config/t-aix new file mode 100644 index 00000000000..53c2d83242f --- /dev/null +++ b/libatomic/config/t-aix @@ -0,0 +1,10 @@ +ifeq ($(MULTIBUILDTOP),) +BITS=$(shell if test -z "`ar -X64 t .libs/$(PACKAGE).a`" ; then \ + echo '64'; else echo '32'; fi) +#MAJOR=$(firstword $(subst :, ,$(libtool_VERSION))) +MAJOR=1 +all-local: + ar -X$(BITS) rc .libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR) + ar -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR) +endif + diff --git a/libatomic/configure b/libatomic/configure index b441636c85b..2acaffe441a 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -643,6 +643,7 @@ ARCH_AARCH64_LINUX_FALSE ARCH_AARCH64_LINUX_TRUE HAVE_IFUNC_FALSE HAVE_IFUNC_TRUE +tmake_file SIZES XLDFLAGS XCFLAGS @@ -11387,7 +11388,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11390 "configure" +#line 11391 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11493,7 +11494,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11496 "configure" +#line 11497 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15668,6 +15669,19 @@ XCFLAGS="$XCFLAGS $XPCFLAGS" +# 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_}" + + + if test x$libat_cv_have_ifunc = xyes; then HAVE_IFUNC_TRUE= HAVE_IFUNC_FALSE='#' diff --git a/libatomic/configure.ac b/libatomic/configure.ac index 7ac8911c342..d74bd7c4c18 100644 --- a/libatomic/configure.ac +++ b/libatomic/configure.ac @@ -268,6 +268,19 @@ AC_SUBST(XLDFLAGS) AC_SUBST(LIBS) AC_SUBST(SIZES) +# 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) + + AM_CONDITIONAL(HAVE_IFUNC, test x$libat_cv_have_ifunc = xyes) AM_CONDITIONAL(ARCH_AARCH64_LINUX, [expr "$config_path" : ".* linux/aarch64 .*" > /dev/null]) diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index 5dd0926d207..efb3b1efb68 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -117,6 +117,7 @@ if test -d ${srcdir}/config/$ARCH ; then config_path="$ARCH" fi +tmake_file= # Other system configury case "${target}" in aarch64*-*-linux*) @@ -134,6 +135,11 @@ case "${target}" in config_path="${config_path} s390 posix" ;; + powerpc*-*-aix*) + config_path="${config_path} posix" + tmake_file="t-aix" + ;; + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- cgit v1.2.3