gcc/libgomp/configure.tgt
David Edelsohn 47ddb895df 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.
2020-06-21 14:14:46 -04:00

183 lines
4.0 KiB
Plaintext

# This is the target specific configuration file. This is invoked by the
# autoconf generated configure script. Putting it in a separate shell file
# lets us skip running autoconf when modifying target specific information.
# This file switches on the shell variable ${target}, and sets the
# following shell variables:
# config_path An ordered list of directories to search for
# sources and headers. This is relative to the
# 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
case "${target}" in
*-*-k*bsd*-gnu*)
;;
*-*-musl*)
;;
*-*-linux* | *-*-gnu*)
XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
;;
*-*-rtems*)
XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
;;
esac
fi
tmake_file=
# Since we require POSIX threads, assume a POSIX system by default.
config_path="posix"
# Check for futex enabled all at once.
if test x$enable_linux_futex = xyes; then
case "${target}" in
aarch64*-*-linux*)
config_path="linux posix"
;;
alpha*-*-linux*)
config_path="linux/alpha linux posix"
;;
arm*-*-linux*)
config_path="linux posix"
;;
ia64*-*-linux*)
config_path="linux/ia64 linux posix"
;;
mips*-*-linux*)
config_path="linux/mips linux posix"
;;
powerpc*-*-linux*)
config_path="linux/powerpc linux posix"
;;
s390*-*-linux*)
config_path="linux/s390 linux posix"
;;
tile*-*-linux*)
config_path="linux/tile linux posix"
;;
# Note that bare i386 is not included here. We need cmpxchg.
i[456]86-*-linux*)
config_path="linux/x86 linux posix"
case " ${CC} ${CFLAGS} " in
*" -m64 "*|*" -mx32 "*)
;;
*)
if test -z "$with_arch"; then
XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
fi
esac
;;
# Similar jiggery-pokery for x86_64 multilibs, except here we
# can't rely on the --with-arch configure option, since that
# applies to the 64-bit side.
x86_64-*-linux*)
config_path="linux/x86 linux posix"
case " ${CC} ${CFLAGS} " in
*" -m32 "*)
XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
;;
esac
;;
# Note that sparcv7 and sparcv8 is not included here. We need cas.
sparcv9-*-linux* | sparc64-*-linux*)
echo "int i;" > conftestx.c
if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
config_path="linux/sparc linux posix"
case "`/usr/bin/file conftestx.o`" in
*32-bit*)
case " ${CC} ${CFLAGS}" in
*" -mcpu=ultrasparc"*)
;;
*)
XCFLAGS="${XCFLAGS} -mcpu=v9"
;;
esac
;;
esac
fi
rm -f conftestx.c conftestx.o
;;
esac
fi
# Other system configury
case "${target}" in
*-*-hpux*)
config_path="hpux posix"
case "${target}" in
*-*-hpux11*)
# HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
XLDFLAGS="${XLDFLAGS} -lrt"
;;
esac
case "${target}" in
hppa[12]*-*-hpux*)
# PA 32 HP-UX needs -frandom-seed for bootstrap compare.
XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
;;
esac
;;
*-*-mingw32*)
config_path="mingw32 posix"
;;
*-*-darwin*)
config_path="bsd darwin posix"
;;
*-*-freebsd*)
# Need to link with -lpthread so libgomp.so is self-contained.
XLDFLAGS="${XLDFLAGS} -lpthread"
;;
*-*-aix*)
config_path="posix"
# Need to link with -lpthread so libgomp.so is self-contained.
XLDFLAGS="${XLDFLAGS} -lpthread"
# AIX needs -frandom-seed for bootstrap compare.
XCFLAGS="${XCFLAGS} -frandom-seed=\$@"
# Create AIX-style "FAT" libraries.
tmake_file="t-aix"
;;
nvptx*-*-*)
config_path="nvptx accel"
;;
*-*-rtems*)
# Use self-contained synchronization objects if provided by Newlib
if test "x$ac_cv_type_struct__Mutex_Control" = xyes ; then
config_path="rtems posix"
fi
;;
amdgcn*-*-*)
config_path="gcn accel"
;;
*)
;;
esac