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

Don Hinton via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 05:08:49 PST 2017


On Thu, Dec 7, 2017 at 3:17 AM Pavel Labath via Phabricator <
reviews at reviews.llvm.org> wrote:

> labath added a comment.
>
> In https://reviews.llvm.org/D40229#947420, @bogner wrote:
>
> > In https://reviews.llvm.org/D40229#947389, @bogner wrote:
> >
> > > I'm getting a similar problem where passing in CMAKE_CXX_COMPILER
> breaks my native build, except it's harder to work around because I don't
> specify CROSS_TOOLCHAIN_FLAGS. I'm building for a device, and specify a C++
> compiler for that build, but that compiler isn't the correct one for
> building my native tools. When no compiler was specified on the
> cross-compile-native cmake invocation, this worked, but now this ends up
> using the wrong compiler and failing.
> >
> >
> > Actually, ignore this for now. This isn't exactly what's going wrong and
> I need to look at it a bit more.
>
>
> I'm not sure how you managed to get that to work before this change, as
> what then used to happen is that cmake would put the compilers into CC and
> CXX environment variables, and the sub-cmake would then pick those up (that
> is what this patch is trying to emulate with the `-D` flags). I have
> uploaded a patch (https://reviews.llvm.org/D40947) which makes these
> flags optional. This way, you should be able to get a more-or-less pristine
> setup by forcing the CROSS_TOOLCHAIN_FLAGS_NATIVE variable to an empty
> string.
>
> If we also go through with Don's earlier idea to leave
> CMAKE_C(XX)_COMPILER flags empty by default in cross-compilation scenarios
> (which I'm starting to like now), this should even work for you
> out-of-the-box.


I haven’t tried, but alternatively, we could set CC and CXX in the call.
That should give the original behavior.



>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D40229
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171207/9903543b/attachment.html>


More information about the llvm-commits mailing list