[PATCH] D42398: [cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 15:01:48 PST 2018
hintonda reopened this revision.
hintonda added a comment.
This revision is now accepted and ready to land.
This patch caused http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/7195 to fail and was reverted.
The problem seems to be that this buildbot invokes cmake with `--target=` and `--sysroot=` added to only `CMAKE_CXX_FLAGS`, and relies on `set_target_flags` to add them to `COMPILE_FLAGS` so it can be used for every compiler, e.g., C, CXX, and ASM. That's why the build broke when `CMAKE_CXX_FLAGS` was no longer added to `COMPILE_FLAGS`, i.e., the `target=` and `--sysroot=` flags weren't passed to ASM.
A better way to do this is to pass `CMAKE_SYSROOT=` and `CMAKE_<lang>_COMPILER_TARGET=`, which is how llvm/runtime/CMakeLists.txt does it.
Also, `darwin_add_builtin_libraries()` and `darwin_add_embedded_builtin_libraries()` currently reset CMAKE_<lang>_FLAGS, which means they must come from `COMPILE_FLAGS`.
Repository:
rL LLVM
https://reviews.llvm.org/D42398
More information about the llvm-commits
mailing list