[yocto] CFLAGS and configurations

Khem Raj raj.khem at gmail.com
Wed Sep 11 00:31:05 PDT 2013


On Wed, Sep 11, 2013 at 12:10 AM, Trevor Woerner
<trevor.woerner at linaro.org> wrote:
> Hi Khem,
>
> Sorry if this has been asked too many times before, but is there is an
> advantage to specifying a whole bunch of CFLAGS for every invocation
> of the compiler versus specifying them during the ./configure?
>

Keep in mind that all packages we build are not autotooled. There are other
component build systems besides autotools that come into play like scons, cmake
and so on and we have to be consistent across all of them.

> For example, if one ./configures their cross-compiler with things like
> -march, -mtune, --sysroot, etc then those will be the defaults. If
> nothing is otherwise specified, these ./configure options are what
> will be used. But if these things aren't specified at ./configure
> time, then every time the cross-compiler is invoked these options need
> to be specified.
>
> Looking, roughly, through some of the log.do_compile logs when
> cross-compiling applications for the target, and looking at the output
> of invoking the cross-compile with the "-v" flag, it appears most of
> these flags need to be specified for each invocation of the compiler.
> The ./configure specifies the sysroot, for example, but doesn't try to
> specify any of the -mtune or -march (etc) flags.
>
> Wouldn't it be easier the other way? That way we don't have to worry
> that some component's build isn't clobbering our required CFLAGS?

yes for packages using autotools may be but I dont see a big downside
of using CFLAGS
either. It gives you same functionality but is a bit more homogenous
across all kind of components.

>
> Do the SDK cross-compilers work the same way? Are they ./configure'd similarly?

We now have relocatable SDKs and one feature that we use it making
sure the we have
the ability to change sysroot on install. So this will have to be
passed via CFLAGS.

>
> Best regards,
>     Trevor



More information about the yocto mailing list