[PATCH] D40229: [cmake] Remove redundant call to cmake when building host tools.

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 03:34:57 PST 2017


labath added a comment.

I think this breaks any non-trivial cross-compilation scenario.

When compiling for android, we compile the android binaries with the compiler in the android ndk (so `CMAKE_C**_COMPILER` points to the android ndk). However, this compiler is not capable of compiling any host binaries. So the way we make this work is by setting the host compilers via `-DCROSS_TOOLCHAIN_FLAGS_NATIVE`. This worked because command line has precedence over the compiler specified by the environment variables. However, this now appends `-DCMAKE_C**_COMPILER`, which will override whatever compiler we have specified via cross toolchain flags.

I am not sure we ever want to be specifying the native compiler, as this is likely to be different in any non-trivial cross-compilation scenario, but if we're going to do that, could we at least put `CROSS_TOOLCHAIN_FLAGS` last so that this can be overridden by the user who needs it?


Repository:
  rL LLVM

https://reviews.llvm.org/D40229





More information about the llvm-commits mailing list