diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-01-15 13:12:59 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-01-15 13:16:42 +0100 |
commit | 0411ae7f08e0f5a8b02ff313d26d27a0f6d1bb34 (patch) | |
tree | b31b94f7c925f2c9c84e6a6c23017c59ebeaa574 /libitm | |
parent | bfab355012ca0f5219da8beb04f2fdaf757d34b7 (diff) | |
download | gcc-0411ae7f08e0f5a8b02ff313d26d27a0f6d1bb34.zip gcc-0411ae7f08e0f5a8b02ff313d26d27a0f6d1bb34.tar.gz gcc-0411ae7f08e0f5a8b02ff313d26d27a0f6d1bb34.tar.bz2 |
libatomic, libgomp, libitc: Fix bootstrap [PR70454]
The recent changes to error on mixing -march=i386 and -fcf-protection broke
bootstrap. This patch changes lib{atomic,gomp,itm} configury, so that it
only adds -march=i486 to flags if really needed (i.e. when 486 or later isn't
on by default already). Similarly, it will not use ifuncs if -mcx16
(or -march=i686 for 32-bit) is on by default.
2021-01-15 Jakub Jelinek <jakub@redhat.com>
PR target/70454
libatomic/
* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
be added through preprocessor check on
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. Determine if try_ifunc is needed
based on preprocessor check on __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
or __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8.
libgomp/
* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
be added through preprocessor check on
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.
libitm/
* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
be added through preprocessor check on
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.
Diffstat (limited to 'libitm')
-rw-r--r-- | libitm/configure.tgt | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 6ac206f..a3d8489 100644 --- a/libitm/configure.tgt +++ b/libitm/configure.tgt @@ -59,16 +59,23 @@ case "${target_cpu}" in arm*) ARCH=arm ;; - i[3456]86) - case " ${CC} ${CFLAGS} " in - *" -m64 "*|*" -mx32 "*) - ;; - *) - if test -z "$with_arch"; then - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" - fi - esac + 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 + rm -f conftestx.c XCFLAGS="${XCFLAGS} -mrtm" ARCH=x86 ;; @@ -103,16 +110,6 @@ case "${target_cpu}" in ARCH=sparc ;; - x86_64) - case " ${CC} ${CFLAGS} " in - *" -m32 "*) - XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" - ;; - esac - XCFLAGS="${XCFLAGS} -mrtm" - ARCH=x86 - ;; s390|s390x) XCFLAGS="${XCFLAGS} -mzarch -mhtm" ARCH=s390 |