configure 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
  2. # Local configure fragment for sysdeps/riscv/elf.
  3. # Check if static linker supports R_RISCV_ALIGN
  4. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for R_RISCV_ALIGN linker relaxation support" >&5
  5. printf %s "checking for R_RISCV_ALIGN linker relaxation support... " >&6; }
  6. if test ${libc_cv_riscv_r_align+y}
  7. then :
  8. printf %s "(cached) " >&6
  9. else case e in #(
  10. e) cat > conftest.S <<EOF
  11. .align 3
  12. foo:
  13. li a0,42
  14. ret
  15. EOF
  16. libc_cv_riscv_r_align=no
  17. if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o contests.o conftest.S'
  18. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  19. (eval $ac_try) 2>&5
  20. ac_status=$?
  21. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  22. test $ac_status = 0; }; }
  23. then
  24. libc_cv_riscv_r_align=yes
  25. fi
  26. rm -rf conftest.* ;;
  27. esac
  28. fi
  29. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_riscv_r_align" >&5
  30. printf "%s\n" "$libc_cv_riscv_r_align" >&6; }
  31. config_vars="$config_vars
  32. riscv-r-align = $libc_cv_riscv_r_align"
  33. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the toolchain is sufficient to build static PIE on RISC-V" >&5
  34. printf %s "checking if the toolchain is sufficient to build static PIE on RISC-V... " >&6; }
  35. if test ${libc_cv_static_pie_on_riscv+y}
  36. then :
  37. printf %s "(cached) " >&6
  38. else case e in #(
  39. e)
  40. cat > conftest1.S <<\EOF
  41. .globl _start
  42. .type _start, @function
  43. _start:
  44. nop
  45. .data
  46. /* This should produce an R_RISCV_RELATIVE in the static PIE. */
  47. .dword _start
  48. EOF
  49. libc_cv_static_pie_on_riscv=no
  50. if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest1 conftest1.S'
  51. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  52. (eval $ac_try) 2>&5
  53. ac_status=$?
  54. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  55. test $ac_status = 0; }; } \
  56. && { ac_try='LC_ALL=C $READELF -Wr conftest1 | grep -q R_RISCV_RELATIVE'
  57. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  58. (eval $ac_try) 2>&5
  59. ac_status=$?
  60. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  61. test $ac_status = 0; }; } \
  62. && ! { ac_try='LC_ALL=C $READELF -Wl conftest1 | grep -q INTERP'
  63. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  64. (eval $ac_try) 2>&5
  65. ac_status=$?
  66. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  67. test $ac_status = 0; }; }
  68. then
  69. libc_cv_static_pie_on_riscv=yes
  70. fi
  71. rm -rf conftest* ;;
  72. esac
  73. fi
  74. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_riscv" >&5
  75. printf "%s\n" "$libc_cv_static_pie_on_riscv" >&6; }
  76. if test "$libc_cv_static_pie_on_riscv" = yes; then
  77. printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
  78. fi