Boost logo

Boost-Build :

Subject: Re: [Boost-build] Built tools and cross compiling
From: Tom (tabsoftwareconsulting_at_[hidden])
Date: 2015-12-19 08:46:15


Hi Steven,

Steven Watanabe <watanabesj <at> gmail.com> writes:

> On 12/18/2015 10:27 PM, Tom wrote:
> >
> > You are right, though the actual cause of that problem was that I was
> > using the gcc toolset on OS X instead of the darwin toolset.
>
> Right. I forgot about that problem.
>
> > After fixing
> > that, I still don't understand why the cross-final target is placed in the
> > location of the built tool, not the cross target.
> >
>
> Oh. That one's easy. You're using clang as
> the main toolset and only changing it to darwin
> for cross. Thus, cross-final sees clang as its
> toolset. I'm guessing that the behavior that
> you want is to set the cross compiler as the main
> toolset and change it to the host compiler for
> built_tool only.

I have tried it that way and the result is that the built
tool ends up build for the target platform (see cross-final-b
below :)

I've updated the project with three targets: cross-final-a
(the same as the previous cross-final), cross-final-b, and
cross-final-c.

The cross-final-b target has the cross target as a source with the
<toolset>darwin property on it. The cross-final-b target sets a
requirement on <toolset>darwin, which ends up causing the built
tool to be built with darwin. Setting the default toolset on the
command line has a similar effect as cross-final-b.

However, given your response above, I tried a related approach
of setting the requirements on both the cross target and the built
tool target. The cross-final-c target sets the built tool's
toolset to clang explicitly and sets a requirement on darwin for
cross-final-c. I did have to explicitly state the darwin version
to get the cross-built targets into the same directory (one went
into darwin-4.2.1 while the other went into darwin). Do you know
why this would be the case?

This is similar to what what I tried in my more complicated project
and it did not work. The difference was that in my project, I
am using a new feature called platform to drive the requirements
on targets built for the cross-platform. I also do not want to explicitly
state the host platform's requirements since I'd like to build using
several different host platforms. Do you have an idea how this can
be done in this example project? I don't want to modify the built
tool's definition as it is correct (it has no requirements on anything
but that stated). However, an alias for the built tool with an explicit
requirement on the host platform (or in this case, clang) might do
the trick. What do you think?

I'm going to try to add the platform feature to this mini-project to
see if I can get what I want from that as well. I'll respond with
the results.

Thanks for your help!
Tom


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk