| 1 |
# This is the target specific configuration file. This is invoked by the |
| 2 |
# autoconf generated configure script. Putting it in a separate shell file |
| 3 |
# lets us skip running autoconf when modifying target specific information. |
| 4 |
|
| 5 |
# This file switches on the shell variable ${target}, and sets the |
| 6 |
# following shell variables: |
| 7 |
# config_path An ordered list of directories to search for |
| 8 |
# sources and headers. This is relative to the |
| 9 |
# config subdirectory of the source tree. |
| 10 |
# XCFLAGS Add extra compile flags to use. |
| 11 |
# XLDFLAGS Add extra link flags to use. |
| 12 |
# tmake_file A list of machine-description-specific |
| 13 |
# makefile fragments. |
| 14 |
|
| 15 |
# Optimize TLS usage by avoiding the overhead of dynamic allocation. |
| 16 |
if test $gcc_cv_have_tls = yes ; then |
| 17 |
case "${target}" in |
| 18 |
|
| 19 |
*-*-k*bsd*-gnu*) |
| 20 |
;; |
| 21 |
|
| 22 |
*-*-musl*) |
| 23 |
;; |
| 24 |
|
| 25 |
*-*-linux* | *-*-gnu*) |
| 26 |
XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS" |
| 27 |
;; |
| 28 |
|
| 29 |
*-*-rtems*) |
| 30 |
XCFLAGS="${XCFLAGS} -ftls-model=local-exec" |
| 31 |
;; |
| 32 |
esac |
| 33 |
fi |
| 34 |
|
| 35 |
tmake_file= |
| 36 |
# Since we require POSIX threads, assume a POSIX system by default. |
| 37 |
config_path="posix" |
| 38 |
|
| 39 |
# Check for futex enabled all at once. |
| 40 |
if test x$enable_linux_futex = xyes; then |
| 41 |
case "${target}" in |
| 42 |
|
| 43 |
aarch64*-*-linux*) |
| 44 |
config_path="linux posix" |
| 45 |
;; |
| 46 |
|
| 47 |
alpha*-*-linux*) |
| 48 |
config_path="linux/alpha linux posix" |
| 49 |
;; |
| 50 |
|
| 51 |
arm*-*-linux*) |
| 52 |
config_path="linux posix" |
| 53 |
;; |
| 54 |
|
| 55 |
hppa*-*-linux*) |
| 56 |
config_path="linux posix" |
| 57 |
;; |
| 58 |
|
| 59 |
ia64*-*-linux*) |
| 60 |
config_path="linux/ia64 linux posix" |
| 61 |
;; |
| 62 |
|
| 63 |
loongarch*-*-linux*) |
| 64 |
config_path="linux posix" |
| 65 |
;; |
| 66 |
|
| 67 |
mips*-*-linux*) |
| 68 |
config_path="linux/mips linux posix" |
| 69 |
;; |
| 70 |
|
| 71 |
powerpc*-*-linux*) |
| 72 |
config_path="linux/powerpc linux posix" |
| 73 |
;; |
| 74 |
|
| 75 |
riscv64*-*-linux*) |
| 76 |
config_path="linux posix" |
| 77 |
;; |
| 78 |
|
| 79 |
s390*-*-linux*) |
| 80 |
config_path="linux/s390 linux posix" |
| 81 |
;; |
| 82 |
|
| 83 |
tile*-*-linux*) |
| 84 |
config_path="linux/tile linux posix" |
| 85 |
;; |
| 86 |
|
| 87 |
# Note that bare i386 is not included here. We need cmpxchg. |
| 88 |
i[456]86-*-linux* | x86_64-*-linux*) |
| 89 |
config_path="linux/x86 linux posix" |
| 90 |
cat > conftestx.c <<EOF |
| 91 |
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 |
| 92 |
#error need -march=i486 |
| 93 |
#endif |
| 94 |
EOF |
| 95 |
if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then |
| 96 |
: |
| 97 |
else |
| 98 |
if test "${target_cpu}" = x86_64; then |
| 99 |
XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" |
| 100 |
else |
| 101 |
XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" |
| 102 |
fi |
| 103 |
fi |
| 104 |
rm -f conftestx.c |
| 105 |
;; |
| 106 |
|
| 107 |
# Note that sparcv7 and sparcv8 is not included here. We need cas. |
| 108 |
sparcv9-*-linux* | sparc64-*-linux*) |
| 109 |
echo "int i;" > conftestx.c |
| 110 |
if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then |
| 111 |
config_path="linux/sparc linux posix" |
| 112 |
case "`/usr/bin/file conftestx.o`" in |
| 113 |
*32-bit*) |
| 114 |
case " ${CC} ${CFLAGS}" in |
| 115 |
*" -mcpu=ultrasparc"*) |
| 116 |
;; |
| 117 |
*) |
| 118 |
XCFLAGS="${XCFLAGS} -mcpu=v9" |
| 119 |
;; |
| 120 |
esac |
| 121 |
;; |
| 122 |
esac |
| 123 |
fi |
| 124 |
rm -f conftestx.c conftestx.o |
| 125 |
;; |
| 126 |
esac |
| 127 |
fi |
| 128 |
|
| 129 |
# Other system configury |
| 130 |
case "${target}" in |
| 131 |
|
| 132 |
*-*-hpux*) |
| 133 |
config_path="hpux posix" |
| 134 |
case "${target}" in |
| 135 |
*-*-hpux11*) |
| 136 |
# HPUX v11.x requires -lrt to resolve sem_init in libgomp.la |
| 137 |
XLDFLAGS="${XLDFLAGS} -lrt" |
| 138 |
;; |
| 139 |
esac |
| 140 |
case "${target}" in |
| 141 |
hppa[12]*-*-hpux*) |
| 142 |
# PA 32 HP-UX needs -frandom-seed for bootstrap compare. |
| 143 |
XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed" |
| 144 |
;; |
| 145 |
esac |
| 146 |
;; |
| 147 |
|
| 148 |
*-*-mingw32*) |
| 149 |
config_path="mingw32 posix" |
| 150 |
;; |
| 151 |
|
| 152 |
*-*-darwin*) |
| 153 |
config_path="bsd darwin posix" |
| 154 |
;; |
| 155 |
|
| 156 |
*-*-freebsd*) |
| 157 |
# Need to link with -lpthread so libgomp.so is self-contained. |
| 158 |
XLDFLAGS="${XLDFLAGS} -lpthread" |
| 159 |
;; |
| 160 |
|
| 161 |
*-*-aix*) |
| 162 |
config_path="posix" |
| 163 |
# Need to link with -lpthread so libgomp.so is self-contained. |
| 164 |
XLDFLAGS="${XLDFLAGS} -lpthread" |
| 165 |
# AIX needs -frandom-seed for bootstrap compare. |
| 166 |
XCFLAGS="${XCFLAGS} -frandom-seed=\$@" |
| 167 |
# Create AIX-style "FAT" libraries. |
| 168 |
tmake_file="t-aix" |
| 169 |
;; |
| 170 |
|
| 171 |
nvptx*-*-*) |
| 172 |
config_path="nvptx accel" |
| 173 |
;; |
| 174 |
|
| 175 |
*-*-rtems*) |
| 176 |
# Use self-contained synchronization objects if provided by Newlib |
| 177 |
if test "x$ac_cv_type_struct__Mutex_Control" = xyes ; then |
| 178 |
config_path="rtems posix" |
| 179 |
fi |
| 180 |
;; |
| 181 |
|
| 182 |
amdgcn*-*-*) |
| 183 |
config_path="gcn accel" |
| 184 |
|
| 185 |
#TODO PR101484 |
| 186 |
XCFLAGS="$XCFLAGS -Wno-error=array-bounds" |
| 187 |
;; |
| 188 |
|
| 189 |
*) |
| 190 |
;; |
| 191 |
|
| 192 |
esac |