aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-05-24 15:18:36 +0300
committerMartin Storsjö <martin@martin.st>2022-06-22 09:33:50 +0300
commit93010544a813dfbfa64dd7cee68785f572f974d1 (patch)
tree198452a04a13b05fd2b7f1b66b3b5e05e67c6c24 /clang/lib/CodeGen/CodeGenFunction.cpp
parentf44bf3805ab29844d7909787a722fff923c7b8b8 (diff)
downloadllvm-93010544a813dfbfa64dd7cee68785f572f974d1.zip
llvm-93010544a813dfbfa64dd7cee68785f572f974d1.tar.gz
llvm-93010544a813dfbfa64dd7cee68785f572f974d1.tar.bz2
[CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build when cross compiling
Originally, the nested build was set up with the CMake command `execute_process` which implicitly passes CC/CXX variables for the configured compiler, which then was picked up by the nested CMake. (This CMake behaviour, to implicitly pass such variables is up for discussion and might change in the future; see https://gitlab.kitware.com/cmake/cmake/-/issues/21378.) How the nested cmake build is set up was changed in aa7d6db5c8fc449b2908c6d629d6d9a067f49896 / D40229 - the old behaviour was brought along by manually passing -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} to the nested cmake configuration. This was then later made optional in f5f0fffea5ace079cc208fafa65150d23935a4d9 / D40947. But still, the default if the user doesn't pass CROSS_TOOLCHAIN_FLAGS_${target_name} (e.g. CROSS_TOOLCHAIN_FLAGS_NATIVE) is to pass in the surrounding build's compiler - which usually doesn't work, and is quite non-obvious to figure out. Just drop the default passing of the outer compiler, when cross compiling. This should avoid surprising cases of using the cross compiler for the native build for essentially all new users trying to cross compile, until they've discovered CROSS_TOOLCHAIN_FLAGS_NATIVE. Keep passing these when not cross compiling, e.g. if building with optimized tablegen. This was already suggested at the end in D40229, but apparently never acted upon. Differential Revision: https://reviews.llvm.org/D126313
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions