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 /libgomp | |
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 'libgomp')
-rw-r--r-- | libgomp/Makefile.am | 5 | ||||
-rw-r--r-- | libgomp/Makefile.in | 12 | ||||
-rw-r--r-- | libgomp/config/t-aix | 9 | ||||
-rwxr-xr-x | libgomp/configure | 18 | ||||
-rw-r--r-- | libgomp/configure.ac | 12 | ||||
-rw-r--r-- | libgomp/configure.tgt | 5 |
6 files changed, 56 insertions, 5 deletions
diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am index b841562..16b6995 100644 --- a/libgomp/Makefile.am +++ b/libgomp/Makefile.am @@ -141,4 +141,9 @@ stamp-build-info: libgomp.texi CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) MAINTAINERCLEANFILES = $(srcdir)/libgomp.info +# target overrides +ifneq ($(tmake_file),) +include $(tmake_file) +endif + include $(top_srcdir)/../multilib.am diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index 5ff2ac1..5455951 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -16,7 +16,7 @@ # Plugins for offload execution, Makefile.am fragment. # -# Copyright (C) 2014-2019 Free Software Foundation, Inc. +# Copyright (C) 2014-2020 Free Software Foundation, Inc. # # Contributed by Mentor Embedded. # @@ -530,6 +530,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@ @@ -573,8 +574,8 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \ affinity.c target.c splay-tree.c libgomp-plugin.c \ oacc-parallel.c oacc-host.c oacc-init.c oacc-mem.c \ oacc-async.c oacc-plugin.c oacc-cuda.c priority_queue.c \ - affinity-fmt.c teams.c allocator.c oacc-profiling.c oacc-target.c \ - $(am__append_4) + affinity-fmt.c teams.c allocator.c oacc-profiling.c \ + oacc-target.c $(am__append_4) # Nvidia PTX OpenACC plugin. @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION) @@ -1438,6 +1439,11 @@ stamp-build-info: libgomp.texi $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libgomp.info $(srcdir)/libgomp.texi @touch $@ +# 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/libgomp/config/t-aix b/libgomp/config/t-aix new file mode 100644 index 0000000..5d0b7e0 --- /dev/null +++ b/libgomp/config/t-aix @@ -0,0 +1,9 @@ +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))) +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/libgomp/configure b/libgomp/configure index 9ffa66c..fd65828 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -650,6 +650,7 @@ OMP_LOCK_SIZE USE_FORTRAN_FALSE USE_FORTRAN_TRUE link_gomp +tmake_file XLDFLAGS XCFLAGS config_path @@ -11432,7 +11433,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11435 "configure" +#line 11436 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11538,7 +11539,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11541 "configure" +#line 11542 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16747,6 +16748,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CET support" >&5 $as_echo_n "checking for CET support... " >&6; } +# NB: Avoid nested save_CFLAGS and save_LDFLAGS. case "$host" in i[34567]86-*-linux* | x86_64-*-linux*) case "$enable_cet" in @@ -16822,6 +16824,18 @@ FCFLAGS="$FCFLAGS $CET_FLAGS" +# 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_}" + + # Cleanup and exit. CFLAGS="$save_CFLAGS" cat >confcache <<\_ACEOF diff --git a/libgomp/configure.ac b/libgomp/configure.ac index ef5d293..201d26f 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -348,6 +348,18 @@ AC_SUBST(config_path) AC_SUBST(XCFLAGS) AC_SUBST(XLDFLAGS) +# 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) + # Cleanup and exit. CFLAGS="$save_CFLAGS" AC_CACHE_SAVE diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index 4790a31..1863287f 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -9,6 +9,8 @@ # config subdirectory of the source tree. # XCFLAGS Add extra compile flags to use. # XLDFLAGS Add extra link flags to use. +# tmake_file A list of machine-description-specific +# makefile fragments. # Optimize TLS usage by avoiding the overhead of dynamic allocation. if test $gcc_cv_have_tls = yes ; then @@ -30,6 +32,7 @@ if test $gcc_cv_have_tls = yes ; then esac fi +tmake_file= # Since we require POSIX threads, assume a POSIX system by default. config_path="posix" @@ -154,6 +157,8 @@ case "${target}" in XLDFLAGS="${XLDFLAGS} -lpthread" # AIX needs -frandom-seed for bootstrap compare. XCFLAGS="${XCFLAGS} -frandom-seed=\$@" + # Create AIX-style "FAT" libraries. + tmake_file="t-aix" ;; nvptx*-*-*) |