--- gcc/configure | 85 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 79 insertions(+), 6 deletions(-)
diff --git a/gcc/configure b/gcc/configure index 992a9d70092..999557a3b51 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5352,7 +5352,26 @@ else GDC="$ac_cv_prog_GDC" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5 +$as_echo_n "checking whether the D compiler works... " >&6; } +if ${acx_cv_d_compiler_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.d <<EOF +module conftest; int main() { return 0; } +EOF +acx_cv_d_compiler_works=no if test "x$GDC" != xno; then + errors=`(${GDC} -I"$srcdir"/d -c conftest.d) 2>&1 || echo failure` + if test x"$errors" = x && test -f conftest.$ac_objext; then + acx_cv_d_compiler_works=yes + fi + rm -f conftest.* +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5 +$as_echo "$acx_cv_d_compiler_works" >&6; } +if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then have_gdc=yes else have_gdc=no @@ -5423,6 +5442,9 @@ case "${target}" in # sets the default TLS model and affects inlining. PICFLAG_FOR_TARGET=-fPIC ;; + loongarch*-*-*) + PICFLAG_FOR_TARGET=-fpic + ;; mips-sgi-irix6*) # PIC is the default. ;; @@ -7865,6 +7887,9 @@ else mips*-*-*) enable_fixed_point=yes ;; + loongarch*-*-*) + enable_fixed_point=yes + ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported for this target, ignored" >&5 $as_echo "$as_me: WARNING: fixed-point is not supported for this target, ignored" >&2;} @@ -19561,7 +19586,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19564 "configure" +#line 19589 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19667,7 +19692,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19670 "configure" +#line 19695 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -25432,6 +25457,17 @@ foo: data8 25 movl r24 = @tprel(foo#)' tls_as_opt=--fatal-warnings ;; + loongarch*-*-*) + conftest_s=' + .section .tdata,"awT",@progbits +x: .word 2 + .text + la.tls.gd $a0,x + bl __tls_get_addr' + tls_first_major=0 + tls_first_minor=0 + tls_as_opt='--fatal-warnings' + ;; microblaze*-*-*) conftest_s=' .section .tdata,"awT",@progbits @@ -28654,6 +28690,43 @@ $as_echo "#define HAVE_AS_MARCH_ZIFENCEI 1" >>confdefs.h fi ;; + loongarch*-*-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .dtprelword support" >&5 +$as_echo_n "checking assembler for .dtprelword support... " >&6; } +if ${gcc_cv_as_loongarch_dtprelword+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_loongarch_dtprelword=no + if test x$gcc_cv_as != x; then + $as_echo '' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags 2,18,0 -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + .section .tdata,"awT",@progbits +x: + .word 2 + .text + .dtprelword x+0x8000 + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_loongarch_dtprelword" >&5 +$as_echo "$gcc_cv_as_loongarch_dtprelword" >&6; } + +if test $gcc_cv_as_loongarch_dtprelword != yes; then + +$as_echo "#define HAVE_AS_DTPRELWORD 1" >>confdefs.h + +fi + ;; s390*-*-*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5 $as_echo_n "checking assembler for .gnu_attribute support... " >&6; } @@ -28817,11 +28890,11 @@ fi ;; esac -# Mips and HP-UX need the GNU assembler. +# Mips, LoongArch and HP-UX need the GNU assembler. # Linux on IA64 might be able to use the Intel assembler. case "$target" in - mips*-*-* | *-*-hpux* ) + mips*-*-* | loongarch*-*-* | *-*-hpux* ) if test x$gas_flag = xyes \ || test x"$host" != x"$build" \ || test ! -x "$gcc_cv_as" \ @@ -29258,8 +29331,8 @@ esac # ??? Once 2.11 is released, probably need to add first known working # version to the per-target configury. case "$cpu_type" in - aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | m32c | m68k \ - | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \ + aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \ + | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \ | tilegx | tilepro | visium | xstormy16 | xtensa) insn="nop" ;; -- 2.27.0