[PATCH] D109239: Add support for floating-option `-ffp-eval-method` and for new `pragma clang fp eval-method`

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 18 01:44:44 PST 2022


fhahn added a comment.

It looks like this patch changed the value of `__FLT_EVAL_METHOD__` when building on macOS for some configurations. This is causing build failures when using macOS 10.15's `math.h` and that is breaking most builds on GreenDragon, e.g. : https://green.lab.llvm.org/green/job/clang-stage1-RA/28282/consoleFull#129538464349ba4694-19c4-4d7e-bec5-911270d8a58c

  FAILED: lib/sanitizer_common/tests/CMakeFiles/CompilerRTUnitTestCheckCxx /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/tools/clang/runtime/compiler-rt-bins/lib/sanitizer_common/tests/CMakeFiles/CompilerRTUnitTestCheckCxx 
  cd /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/tools/clang/runtime/compiler-rt-bins/lib/sanitizer_common/tests && bash -c "echo '#include <iostream>' | /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/clang -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -E -x c++ - > /dev/null;if [ \$? != 0 ] ;  then echo;  echo 'Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.';  echo 'You should copy or symlink your system C++ headers into /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/include/c++';  if [ -d \$(dirname \$(dirname \$(xcrun -f clang)))/include/c++ ];    then echo 'e.g. with:';    echo '  cp -r' \$(dirname \$(dirname \$(xcrun -f clang)))/include/c++ '/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/include/';  elif [ -d \$(dirname \$(dirname \$(xcrun -f clang)))/lib/c++ ];    then echo 'e.g. with:';    echo '  cp -r' \$(dirname \$(dirname \$(xcrun -f clang)))/lib/c++ '/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/include/';  fi;  echo 'This can also be fixed by checking out the libcxx project from llvm.org and installing the headers';  echo 'into your build directory:';  echo '  cd /Users/buildslave/jenkins/workspace/clang-stage1-RA/llvm-project/llvm/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx';  echo '  cd /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build && make -C /Users/buildslave/jenkins/workspace/clang-stage1-RA/llvm-project/llvm/projects/libcxx installheaders HEADER_DIR=/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/include';  echo;  false;fi"
  In file included from <stdin>:1:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/iostream:37:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/ios:215:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__locale:18:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/memory:813:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__memory/compressed_pair.h:16:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/tuple:178:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/compare:144:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__compare/compare_partial_order_fallback.h:13:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__compare/partial_order.h:14:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__compare/weak_order.h:14:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/__compare/strong_order.h:18:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/cmath:308:
  In file included from /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/./bin/../include/c++/v1/math.h:300:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/math.h:53:5: error: "Unsupported value of __FLT_EVAL_METHOD__."
  #   error "Unsupported value of __FLT_EVAL_METHOD__."
      ^
  1 error generated.
  
  Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.

>From looking at `math.h`, the supported values for `__FLT_EVAL_METHOD__` are 0, 1, 2 and -1. It seems like there may be a code path that sets it to `FEM_UnsetOnCommandLine = 3`. Unless there's a quick fix, I am planning on reverting the change soon to bring the bots back to green.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109239/new/

https://reviews.llvm.org/D109239



More information about the cfe-commits mailing list