1 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
2 # Local configure fragment for sysdeps/loongarch/elf.
4 printf "%s\n" "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
7 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ${CC-cc} is sufficient to build static PIE on LoongArch" >&5
8 printf %s "checking if ${CC-cc} is sufficient to build static PIE on LoongArch... " >&6; }
9 if test ${libc_cv_static_pie_on_loongarch+y}
11 printf %s "(cached) " >&6
14 cat > conftest.S <<\EOF
16 .type _start, @function
25 /* This should produce an R_LARCH_RELATIVE in the static PIE. */
29 libc_cv_static_pie_on_loongarch=no
30 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest conftest.S'
31 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
34 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
35 test $ac_status = 0; }; } \
36 && { ac_try='LC_ALL=C $READELF -Wr conftest | grep -q R_LARCH_RELATIVE'
37 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
40 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
41 test $ac_status = 0; }; } \
42 && ! { ac_try='LC_ALL=C $READELF -Wl conftest | grep -q INTERP'
43 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
46 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
47 test $ac_status = 0; }; }
49 libc_cv_static_pie_on_loongarch=yes
53 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_loongarch" >&5
54 printf "%s\n" "$libc_cv_static_pie_on_loongarch" >&6; }
56 if test "$libc_cv_static_pie_on_loongarch" = yes; then
57 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
61 # Check if gcc supports option -mcmodel=medium.
62 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports option -mcmodel=medium" >&5
63 printf %s "checking whether $CC supports option -mcmodel=medium... " >&6; }
64 if test ${libc_cv_loongarch_cmodel_medium+y}
66 printf %s "(cached) " >&6
69 if { ac_try='${CC-cc} -c $CFLAGS -mcmodel=medium /dev/null 1>&5'
70 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
73 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
74 test $ac_status = 0; }; }; then
75 libc_cv_loongarch_cmodel_medium=yes
77 libc_cv_loongarch_cmodel_medium=no
80 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_cmodel_medium" >&5
81 printf "%s\n" "$libc_cv_loongarch_cmodel_medium" >&6; }
82 config_vars="$config_vars
83 have-cmodel-medium = $libc_cv_loongarch_cmodel_medium"
85 # Check if asm support vector instructions.
86 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vector support in assembler" >&5
87 printf %s "checking for vector support in assembler... " >&6; }
88 if test ${libc_cv_loongarch_vec_asm+y}
90 printf %s "(cached) " >&6
92 cat > conftest.s <<\EOF
95 if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest 1>&5'
96 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
99 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
100 test $ac_status = 0; }; }; then
101 libc_cv_loongarch_vec_asm=yes
103 libc_cv_loongarch_vec_asm=no
107 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5
108 printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; }
109 if test $libc_cv_loongarch_vec_asm = no; then
110 as_fn_error $? "binutils version is too old, use 2.41 or newer version" "$LINENO" 5