001-fix_autoconf_macro.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- a/libc/aclocal.m4
  2. +++ b/libc/aclocal.m4
  3. @@ -88,6 +88,12 @@
  4. fi
  5. rm -fr contest*])
  6. +dnl Test a compiler option or options with an empty input file.
  7. +dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
  8. +AC_DEFUN([LIBC_TRY_CC_OPTION],
  9. +[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
  10. + [$2], [$3])])
  11. +
  12. AC_DEFUN([LIBC_PROG_BINUTILS],
  13. [# Was a --with-binutils option given?
  14. if test -n "$path_binutils"; then
  15. --- a/libc/configure
  16. +++ b/libc/configure
  17. @@ -7404,7 +7404,14 @@
  18. else
  19. libc_cv_cc_nofma=
  20. for opt in -ffp-contract=off -mno-fused-madd; do
  21. - LIBC_TRY_CC_OPTION($opt, libc_cv_cc_nofma=$opt; break)
  22. + if { ac_try='${CC-cc} $opt -xc /dev/null -S -o /dev/null'
  23. + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  24. + (eval $ac_try) 2>&5
  25. + ac_status=$?
  26. + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  27. + test $ac_status = 0; }; }; then :
  28. + libc_cv_cc_nofma=$opt; break
  29. +fi
  30. done
  31. fi
  32. { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_nofma" >&5
  33. --- a/libc/configure.in
  34. +++ b/libc/configure.in
  35. @@ -2238,10 +2238,9 @@
  36. libc_cv_cc_submachine, [dnl
  37. libc_cv_cc_submachine=no
  38. for opt in "-march=$submachine" "-mcpu=$submachine"; do
  39. - if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
  40. + LIBC_TRY_CC_OPTION([$opt], [
  41. libc_cv_cc_submachine="$opt"
  42. - break
  43. - fi
  44. + break], [])
  45. done])
  46. if test "x$libc_cv_cc_submachine" = xno; then
  47. AC_MSG_ERROR([${CC-cc} does not support $submachine])