aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2022-07-26 21:46:20 +0800
committerXi Ruoyao <xry111@xry111.site>2022-07-27 10:19:55 +0800
commit66434729a79dfa2d9790aadeca7082511c387980 (patch)
tree212f0639bda831a62d4e61c4360b0bd60f6b4173 /gcc/configure.ac
parentfd96c4b51a733f72fa567a96c253fb3ddf11bd2a (diff)
downloadgcc-66434729a79dfa2d9790aadeca7082511c387980.zip
gcc-66434729a79dfa2d9790aadeca7082511c387980.tar.gz
gcc-66434729a79dfa2d9790aadeca7082511c387980.tar.bz2
LoongArch: adjust the default of -mexplicit-relocs by checking gas feature
The assembly produced with -mexplicit-relocs is not supported by gas <= 2.39. Check if the assembler supports explicit relocations and set the default accordingly. gcc/ChangeLog: * configure.ac (HAVE_AS_EXPLICIT_RELOCS): Define to 1 if the assembler supports explicit relocation for LoongArch. * configure: Regenerate. * config/loongarch/loongarch-opts.h (HAVE_AS_EXPLICIT_RELOCS): Define to 0 if not defined. * config/loongarch/genopts/loongarch.opt.in (TARGET_EXPLICIT_RELOCS): Default to HAVE_AS_EXPLICIT_RELOCS. * config/loongarch/loongarch.opt: Regenerate.
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 4467473..e5f708c 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5287,7 +5287,7 @@ configured with --enable-newlib-nano-formatted-io.])
[AC_DEFINE(HAVE_AS_MARCH_ZIFENCEI, 1,
[Define if the assembler understands -march=rv*_zifencei.])])
;;
- loongarch*-*-*)
+ loongarch*-*-*)
gcc_GAS_CHECK_FEATURE([.dtprelword support],
gcc_cv_as_loongarch_dtprelword, [2,18,0],,
[.section .tdata,"awT",@progbits
@@ -5297,6 +5297,11 @@ x:
.dtprelword x+0x8000],,
[AC_DEFINE(HAVE_AS_DTPRELWORD, 1,
[Define if your assembler supports .dtprelword.])])
+ gcc_GAS_CHECK_FEATURE([explicit relocation support],
+ gcc_cv_as_loongarch_explicit_relocs,,
+ [a:pcalau12i $t0,%pc_hi20(a)],,
+ [AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
+ [Define if your assembler supports explicit relocation.])])
;;
s390*-*-*)
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],