Hi Matt, others,

On 03/31/2015 05:46 PM, Matt Madison wrote:
On Tue, Mar 31, 2015 at 7:26 AM, ad me <[email protected]> wrote:

On Mar 31, 2015 5:19 AM, "Matt Madison" <[email protected]> wrote:
[...]
You probably aren't invoking the compiler with the set of command-line
options you need to get the desired output.  See the definition of the
CC environment variable in the environment-setup script in the SDK, and
make sure you use the same set of flags to invoke gcc.

-Matt

Please see the step by step in the document attached/linked.
The same one you highlighted on.

I source this script just before invoking the compiler. Which means the CC
parameters are passed in as shown.

Unless if you are suggesting that doing a "source" of the environment script
is not enough?

If so, then I would not be able to invoke the correct compiler as the PATH
to it is setup by the same environment script I source.


Sourcing the environment script is not enough; as I said, you have to
run the compiler with the right set of options.

So instead of:

arm-poky-linux-gnueabi-gcc hello_arm_world.c

You could do:

$CC hello_arm_world.c

to use the CC environment variable directly to invoke the compiler
with the options you need.

-Matt

That was a good remark. I just checked a Makefile I've written for a customer project, here's how I use gcc for the cross-compiled recipe:

CC=$(CROSS_COMPILE)gcc

This works for me both in Yocto builds and during stand-alone development with "whatever cross-toolchain is around".

Regards,
Nikolay
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to