On Wed, Mar 25, 2015 at 10:05 AM, Han-Wen Nienhuys <
han...@google.com> wrote:
> On Wed, Mar 25, 2015 at 5:39 PM, Ming Zhao <
ming...@gmail.com> wrote:
>> Thank you Han-Wen. I agree it's simple to just run configure script
>> for the target architecture and save the output.
>>
>> One thing unclear from the document is how to define target
>> architecture and how these information gets propagated.
>> I feel it's quite involved, it might require changes to
>> tools/cpp/{BUILD, CROSSTOOL}. But there is not much document/example
>> about it.
>> It could be nice to have an example about cross compiling for ARM, for example.
>
> The target achitecture for C++ builds is defined in CROSSTOOL, yes.
> You can select one of the entries defined there using the --cpu=flag.
> This will have the effect on C++ rules and on genrules, where $(CC)
> and $(CC_FLAGS) will reflect the target compiler.
>
> The best description of CROSSTOOL is
>
>
https://github.com/google/bazel/blob/master/src/main/protobuf/crosstool_config.proto
>
> but I admit that we ourselves usually ask the compiler team about
> details in this file.
>
> I did some experiments to compile AOSP with Bazel, and as a side
> product I have a toolchain definition that might help, though. Let me
> see if I can publish it somewhere.
Thanks for the pointer. I think it will be very helpful if you can