[PATCH] D126313: [CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 14:45:25 PDT 2022


mstorsjo added a comment.

Or put another way - normally, when the nested native build is set up, the user probably doesn't have much opinion on exactly how that is built, just build llvm-tblgen (and the other -tblgen executables) with as little extra frills as possible. If the user specifically wants this to happen with some specific compiler, then it's possible to pass `-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_CXX_COMPILER=clang++` and similar. But for the cases where the user doesn't really care, passing the explicitly cross compiler e.g. `<triple>-g++` as tool to use for the native build really never is the right thing to do - and then relying on CMake's implicit default is certainly safer.

(This thing does come up on irc/discord semi-regularly, where currently, users trying to cross compile LLVM will need to pass `-DCROSS_TOOLCHAIN_FLAGS_NATIVE=`, to explicitly set it to an empty string, in order for it _not_ to pass on the cross compiler.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126313



More information about the llvm-commits mailing list