gcc/libatomic/configure.tgt

204 lines
5.0 KiB
Plaintext
Raw Normal View History

# -*- shell-script -*-
2022-01-03 10:42:10 +01:00
# Copyright (C) 2012-2022 Free Software Foundation, Inc.
# Contributed by Richard Henderson <rth@redhat.com>.
#
# This file is part of the GNU Atomic Library (libatomic).
#
# Libatomic is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the GCC Runtime Library Exception, version
# 3.1, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License and
# a copy of the GCC Runtime Library Exception along with this program;
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
# Give operating systems the opportunity to discard XCFLAGS modifications based
# on ${target_cpu}. For example to allow proper use of multilibs.
configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}"
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
XCFLAGS="${XCFLAGS} -mfp-trap-mode=sui"
ARCH=alpha
;;
rs6000 | powerpc*) ARCH=powerpc ;;
riscv*) ARCH=riscv ;;
sh*) ARCH=sh ;;
aarch64*)
ARCH=aarch64
case "${target}" in
aarch64*-*-linux*)
if test -n "$enable_aarch64_lse"; then
try_ifunc=yes
fi
;;
esac
;;
arm*)
ARCH=arm
case "${target}" in
arm*-*-freebsd* | arm*-*-netbsd*)
;;
*)
# ??? Detect when -march=armv7 is already enabled.
try_ifunc=yes
;;
esac
;;
sparc)
case " ${CC} ${CFLAGS} " in
*" -m64 "*)
;;
*)
if test -z "$with_cpu"; then
XCFLAGS="${XCFLAGS} -mcpu=v9"
fi
esac
ARCH=sparc
;;
sparc64|sparcv9)
case " ${CC} ${CFLAGS} " in
*" -m32 "*)
XCFLAGS="${XCFLAGS} -mcpu=v9"
;;
esac
ARCH=sparc
;;
i[3456]86 | x86_64)
cat > conftestx.c <<EOF
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
#error need -march=i486
#endif
EOF
if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then
:
else
if test "${target_cpu}" = x86_64; then
XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
else
XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
fi
XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
fi
cat > conftestx.c <<EOF
#ifdef __x86_64__
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
#error need -mcx16
#endif
#else
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
#error need -march=i686
#endif
#endif
EOF
if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then
try_ifunc=no
else
try_ifunc=yes
fi
rm -f conftestx.c
ARCH=x86
;;
*) ARCH="${target_cpu}" ;;
esac
# The cpu configury is always most relevant.
if test -d ${srcdir}/config/$ARCH ; then
config_path="$ARCH"
fi
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-05-15 23:46:08 +02:00
tmake_file=
# Other system configury
case "${target}" in
aarch64*-*-linux*)
# OS support for atomic primitives.
config_path="${config_path} linux/aarch64 posix"
;;
arm*-*-linux* | arm*-*-uclinux*)
# OS support for atomic primitives.
config_path="${config_path} linux/arm posix"
;;
s390*-*-linux*)
# OS support for atomic primitives.
config_path="${config_path} s390 posix"
;;
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-05-15 23:46:08 +02:00
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* \
| *-*-darwin* | *-*-aix* | *-*-cygwin*)
# POSIX system. The OS is supported.
config_path="${config_path} posix"
;;
*-*-mingw*)
# OS support for atomic primitives.
case ${target_thread_file} in
win32)
config_path="${config_path} mingw"
;;
posix)
config_path="${config_path} posix"
;;
esac
;;
*-*-rtems*)
XCFLAGS="${configure_tgt_pre_target_cpu_XCFLAGS}"
config_path="rtems"
;;
*-*-elf*)
# ??? No target OS. We could be targeting bare-metal kernel-mode,
# or user-mode for some custom OS. If the target supports TAS,
# we can build our own spinlocks, given there are no signals.
# If the target supports disabling interrupts, we can work in
# kernel-mode, given the system is not multi-processor.
UNSUPPORTED=1
;;
nvptx*-*-*)
;;
*)
# Who are you?
UNSUPPORTED=1
;;
esac
# glibc will pass hwcap to ifunc resolver functions as an argument.
# The type may be different on different architectures.
case "${target}" in
aarch64*-*-*)
IFUNC_RESOLVER_ARGS="uint64_t hwcap"
;;
*)
IFUNC_RESOLVER_ARGS="void"
;;
esac