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
54 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_loongarch" >&5
55 printf "%s\n" "$libc_cv_static_pie_on_loongarch" >&6; }
57 if test "$libc_cv_static_pie_on_loongarch" = yes; then
58 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
62 # Check if gcc supports option -mcmodel=medium.
63 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports option -mcmodel=medium" >&5
64 printf %s "checking whether $CC supports option -mcmodel=medium... " >&6; }
65 if test ${libc_cv_loongarch_cmodel_medium+y}
67 printf %s "(cached) " >&6
70 if { ac_try='${CC-cc} -c $CFLAGS -mcmodel=medium /dev/null 1>&5'
71 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
74 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
75 test $ac_status = 0; }; }; then
76 libc_cv_loongarch_cmodel_medium=yes
78 libc_cv_loongarch_cmodel_medium=no
82 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_cmodel_medium" >&5
83 printf "%s\n" "$libc_cv_loongarch_cmodel_medium" >&6; }
84 config_vars="$config_vars
85 have-cmodel-medium = $libc_cv_loongarch_cmodel_medium"
87 # Check if asm support vector instructions.
88 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vector support in assembler" >&5
89 printf %s "checking for vector support in assembler... " >&6; }
90 if test ${libc_cv_loongarch_vec_asm+y}
92 printf %s "(cached) " >&6
94 e) cat > conftest.s <<\EOF
97 if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest 1>&5'
98 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
101 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
102 test $ac_status = 0; }; }; then
103 libc_cv_loongarch_vec_asm=yes
105 libc_cv_loongarch_vec_asm=no
110 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5
111 printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; }
112 if test $libc_cv_loongarch_vec_asm = no; then
113 as_fn_error $? "binutils version is too old, use 2.41 or newer version" "$LINENO" 5
117 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vector support in compiler" >&5
118 printf %s "checking for vector support in compiler... " >&6; }
119 if test ${libc_cv_loongarch_vec_com+y}
121 printf %s "(cached) " >&6
124 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
125 /* end confdefs.h. */
129 asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
130 asm volatile ("xvldi \$xr0, 1" ::: "\$xr0");
134 if ac_fn_c_try_compile "$LINENO"
136 libc_cv_loongarch_vec_com=yes
138 e) libc_cv_loongarch_vec_com=no ;;
141 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
144 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_com" >&5
145 printf "%s\n" "$libc_cv_loongarch_vec_com" >&6; }
146 if test "$libc_cv_loongarch_vec_com" = yes ;
148 printf "%s\n" "#define HAVE_LOONGARCH_VEC_COM 1" >>confdefs.h
151 config_vars="$config_vars
152 loongarch-vec-com = $libc_cv_loongarch_vec_com"