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

Don Hinton via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 05:40:41 PST 2017


Would handling them like the linker flags and only passing them when not
cross compiling fix this?

On Wed, Dec 6, 2017 at 3:34 AM Pavel Labath via Phabricator <
reviews at reviews.llvm.org> wrote:

> 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/de1c2a18/attachment.html>


More information about the llvm-commits mailing list