configure 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
  2. # Local configure fragment for sysdeps/loongarch/elf.
  3. printf "%s\n" "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
  4. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ${CC-cc} is sufficient to build static PIE on LoongArch" >&5
  5. printf %s "checking if ${CC-cc} is sufficient to build static PIE on LoongArch... " >&6; }
  6. if test ${libc_cv_static_pie_on_loongarch+y}
  7. then :
  8. printf %s "(cached) " >&6
  9. else case e in #(
  10. e)
  11. cat > conftest.S <<\EOF
  12. .global _start
  13. .type _start, @function
  14. _start:
  15. li.w $a7, 93
  16. li.w $a0, 0
  17. syscall 0
  18. .data
  19. x:
  20. .word 0
  21. /* This should produce an R_LARCH_RELATIVE in the static PIE. */
  22. .dword _start
  23. EOF
  24. libc_cv_static_pie_on_loongarch=no
  25. if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest conftest.S'
  26. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  27. (eval $ac_try) 2>&5
  28. ac_status=$?
  29. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  30. test $ac_status = 0; }; } \
  31. && { ac_try='LC_ALL=C $READELF -Wr conftest | grep -q R_LARCH_RELATIVE'
  32. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  33. (eval $ac_try) 2>&5
  34. ac_status=$?
  35. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  36. test $ac_status = 0; }; } \
  37. && ! { ac_try='LC_ALL=C $READELF -Wl conftest | grep -q INTERP'
  38. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  39. (eval $ac_try) 2>&5
  40. ac_status=$?
  41. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  42. test $ac_status = 0; }; }
  43. then
  44. libc_cv_static_pie_on_loongarch=yes
  45. fi
  46. rm -rf conftest* ;;
  47. esac
  48. fi
  49. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_loongarch" >&5
  50. printf "%s\n" "$libc_cv_static_pie_on_loongarch" >&6; }
  51. if test "$libc_cv_static_pie_on_loongarch" = yes; then
  52. printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
  53. fi
  54. # Check if gcc supports option -mcmodel=medium.
  55. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports option -mcmodel=medium" >&5
  56. printf %s "checking whether $CC supports option -mcmodel=medium... " >&6; }
  57. if test ${libc_cv_loongarch_cmodel_medium+y}
  58. then :
  59. printf %s "(cached) " >&6
  60. else case e in #(
  61. e)
  62. if { ac_try='${CC-cc} -c $CFLAGS -mcmodel=medium /dev/null 1>&5'
  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; }; }; then
  68. libc_cv_loongarch_cmodel_medium=yes
  69. else
  70. libc_cv_loongarch_cmodel_medium=no
  71. fi ;;
  72. esac
  73. fi
  74. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_cmodel_medium" >&5
  75. printf "%s\n" "$libc_cv_loongarch_cmodel_medium" >&6; }
  76. config_vars="$config_vars
  77. have-cmodel-medium = $libc_cv_loongarch_cmodel_medium"
  78. # Check if asm support vector instructions.
  79. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vector support in assembler" >&5
  80. printf %s "checking for vector support in assembler... " >&6; }
  81. if test ${libc_cv_loongarch_vec_asm+y}
  82. then :
  83. printf %s "(cached) " >&6
  84. else case e in #(
  85. e) cat > conftest.s <<\EOF
  86. vld $vr0, $sp, 0
  87. EOF
  88. if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest 1>&5'
  89. { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  90. (eval $ac_try) 2>&5
  91. ac_status=$?
  92. printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  93. test $ac_status = 0; }; }; then
  94. libc_cv_loongarch_vec_asm=yes
  95. else
  96. libc_cv_loongarch_vec_asm=no
  97. fi
  98. rm -f conftest* ;;
  99. esac
  100. fi
  101. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5
  102. printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; }
  103. if test $libc_cv_loongarch_vec_asm = no; then
  104. as_fn_error $? "binutils version is too old, use 2.41 or newer version" "$LINENO" 5
  105. fi
  106. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vector support in compiler" >&5
  107. printf %s "checking for vector support in compiler... " >&6; }
  108. if test ${libc_cv_loongarch_vec_com+y}
  109. then :
  110. printf %s "(cached) " >&6
  111. else case e in #(
  112. e)
  113. cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  114. /* end confdefs.h. */
  115. void foo (void)
  116. {
  117. asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
  118. asm volatile ("xvldi \$xr0, 1" ::: "\$xr0");
  119. }
  120. _ACEOF
  121. if ac_fn_c_try_compile "$LINENO"
  122. then :
  123. libc_cv_loongarch_vec_com=yes
  124. else case e in #(
  125. e) libc_cv_loongarch_vec_com=no ;;
  126. esac
  127. fi
  128. rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
  129. esac
  130. fi
  131. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_com" >&5
  132. printf "%s\n" "$libc_cv_loongarch_vec_com" >&6; }
  133. if test "$libc_cv_loongarch_vec_com" = yes ;
  134. then
  135. printf "%s\n" "#define HAVE_LOONGARCH_VEC_COM 1" >>confdefs.h
  136. fi
  137. config_vars="$config_vars
  138. loongarch-vec-com = $libc_cv_loongarch_vec_com"