1 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
2 # Local configure fragment for sysdeps/riscv/elf.
4 # Check if static linker supports R_RISCV_ALIGN
5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for R_RISCV_ALIGN linker relaxation support" >&5
6 printf %s "checking for R_RISCV_ALIGN linker relaxation support... " >&6; }
7 if test ${libc_cv_riscv_r_align+y}
9 printf %s "(cached) " >&6
11 e) cat > conftest.S <<EOF
17 libc_cv_riscv_r_align=no
18 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o contests.o conftest.S'
19 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
22 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
23 test $ac_status = 0; }; }
25 libc_cv_riscv_r_align=yes
30 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_riscv_r_align" >&5
31 printf "%s\n" "$libc_cv_riscv_r_align" >&6; }
32 config_vars="$config_vars
33 riscv-r-align = $libc_cv_riscv_r_align"
35 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the toolchain is sufficient to build static PIE on RISC-V" >&5
36 printf %s "checking if the toolchain is sufficient to build static PIE on RISC-V... " >&6; }
37 if test ${libc_cv_static_pie_on_riscv+y}
39 printf %s "(cached) " >&6
42 cat > conftest1.S <<\EOF
44 .type _start, @function
49 /* This should produce an R_RISCV_RELATIVE in the static PIE. */
53 libc_cv_static_pie_on_riscv=no
54 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest1 conftest1.S'
55 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
58 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59 test $ac_status = 0; }; } \
60 && { ac_try='LC_ALL=C $READELF -Wr conftest1 | grep -q R_RISCV_RELATIVE'
61 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
64 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
65 test $ac_status = 0; }; } \
66 && ! { ac_try='LC_ALL=C $READELF -Wl conftest1 | grep -q INTERP'
67 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
70 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
71 test $ac_status = 0; }; }
73 libc_cv_static_pie_on_riscv=yes
78 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_riscv" >&5
79 printf "%s\n" "$libc_cv_static_pie_on_riscv" >&6; }
81 if test "$libc_cv_static_pie_on_riscv" = yes; then
82 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h