Just a note about this:>I like this. I hope you don't mind if I borrow some of these ideas to >play with. C_COMPILER_WORKS is something I've never heard of.I'm also working on building a clang-based toolchain from scratch. To avoid CMake bailing out when a binary can't be linked, I use: -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY Along with: -DCMAKE_SYSTEM_NAME="Generic" -DCMAKE_SYSTEM_PROCESSOR="powerpc" Best Regards, Vlad
Martin Storsjö via llvm-dev
2020-Nov-10 20:59 UTC
[llvm-dev] Building an LLVM cross-compiler
On Tue, 10 Nov 2020, Vlad Ivanov via llvm-dev wrote:> Just a note about this: > >> I like this. I hope you don't mind if I borrow some of these ideas to >> play with. C_COMPILER_WORKS is something I've never heard of. > > I'm also working on building a clang-based toolchain from scratch. > To avoid CMake bailing out when a binary can't be linked, I use: > > -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARYOh, right, that's the one - I remembered that there was a more proper cmake option to use, but I didn't find it when I sent the previous mail. Yeah, that option probably is more correct than CMAKE_C_COMPILER_WORKS. We set it already in libunwind/CMakeLists.txt, I guess we should set it in a few more places, at least compiler-rt/lib/builtins/CMakeLists.txt. // Martin