Regenerate configure.
[glibc.git] / sysdeps / loongarch / configure
blobf6c078c1adf9526058974967095bbc6ddf3db6c1
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/loongarch/elf.
4 $as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
7 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the toolchain is sufficient to build static PIE on LoongArch" >&5
8 $as_echo_n "checking if the toolchain is sufficient to build static PIE on LoongArch... " >&6; }
9 if ${libc_cv_static_pie_on_loongarch+:} false; then :
10   $as_echo_n "(cached) " >&6
11 else
13   cat > conftest1.S << EOF
14 .global _start
15 .type _start, @function
16 _start:
17   li.w \$a7, 93
18   /* This ensures the assembler supports explicit reloc.  */
19   pcalau12i \$a0, %pc_hi20(x)
20   ld.w \$a0, \$a0, %pc_lo12(x)
21   syscall 0
23 .data
25   .word 0
26   /* This should produce an R_LARCH_RELATIVE in the static PIE.  */
27   .dword _start
28 EOF
29   cat > conftest2.S << EOF
30 .global f
31 .type f, @function
33   /* The linker should be able to handle this and produce a PLT entry.  */
34   la.pcrel \$t0, \$t0, external_func
35   jirl \$zero, \$t0, 0
36 EOF
38   libc_cv_static_pie_on_loongarch=no
39   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest1 conftest1.S'
40   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
41   (eval $ac_try) 2>&5
42   ac_status=$?
43   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
44   test $ac_status = 0; }; } \
45      && { ac_try='LC_ALL=C $READELF -Wr conftest1 | grep -q R_LARCH_RELATIVE'
46   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
47   (eval $ac_try) 2>&5
48   ac_status=$?
49   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
50   test $ac_status = 0; }; } \
51      && { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -shared -fPIC -o conftest2.so conftest2.S'
52   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
53   (eval $ac_try) 2>&5
54   ac_status=$?
55   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
56   test $ac_status = 0; }; } \
57      && { ac_try='LC_ALL=C $READELF -Wr conftest2.so | grep -q 'R_LARCH_JUMP_SLOT.*external_func''
58   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
59   (eval $ac_try) 2>&5
60   ac_status=$?
61   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
62   test $ac_status = 0; }; }
63   then
64     libc_cv_static_pie_on_loongarch=yes
65   fi
66   rm -rf conftest*
68 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_loongarch" >&5
69 $as_echo "$libc_cv_static_pie_on_loongarch" >&6; }
71 if test "$libc_cv_static_pie_on_loongarch" = yes; then
72   $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
76   # Check if gcc supports option -mcmodel=medium.
77 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports option -mcmodel=medium" >&5
78 $as_echo_n "checking whether $CC supports option -mcmodel=medium... " >&6; }
79 if ${libc_cv_loongarch_cmodel_medium+:} false; then :
80   $as_echo_n "(cached) " >&6
81 else
83   if { ac_try='${CC-cc} -c $CFLAGS -mcmodel=medium /dev/null 1>&5'
84   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
85   (eval $ac_try) 2>&5
86   ac_status=$?
87   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
88   test $ac_status = 0; }; }; then
89     libc_cv_loongarch_cmodel_medium=yes
90   else
91     libc_cv_loongarch_cmodel_medium=no
92   fi
94 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_cmodel_medium" >&5
95 $as_echo "$libc_cv_loongarch_cmodel_medium" >&6; }
96 config_vars="$config_vars
97 have-cmodel-medium = $libc_cv_loongarch_cmodel_medium"