[PATCH] More robust target_arch checking for compiler-rt

Adrian Zgorzalek via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 19:31:04 PDT 2015


Hi,

I have a patch for compiler-rt CMake to make it more robust when looking for target_arch - see attachment

Summary:

Existing check for supported architecture uses try_compile which cannot be easily adjusted. E.g. if host compiler has a non-standard location of headers or libraries there is no way to pass it and so test_target_arch fails, because compiler is incorrectly invoked.
Changing it to CHECK_CXX_SOURCE_COMPILES exposes CMAKE_REQUIRED_<VAR> variables which can be used to adjust compiler invocation for this check, similarly to llvm/cmake/modules/CheckAtomic.cmake

Testing:
I tested on OS X that nothing is changing. On Linux, it worked fine + I was able to build compiler-rt in chroot environment, where path for standard includes needs to be passed as a paramater to Clang. I did that by -DCMAKE_REQUIRED_INCLUDES=<path> when invoking CMake.

Best,
Adrian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_compiler_rt_cmake.patch
Type: application/octet-stream
Size: 1789 bytes
Desc: fix_compiler_rt_cmake.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150930/1cc6d0c1/attachment.obj>


More information about the llvm-commits mailing list