[OE-core] [PATCH 1/4] compiler-options.bbclass: provide and validate options

Bystricky, Juro juro.bystricky at intel.com
Fri Jan 26 16:59:03 UTC 2018



> On 12/13/17 3:31 PM, Juro Bystricky wrote:
> > As we may be using external toolchains, we cannot assume
> > various compiler options to be valid.
> >
> 
> While looking through my backlog :),  I think the idea is fine but
> implementation can be a bit more generic. e.g. a common function to
> probe the compiler for a given option then adding/removing it from
> compiler commandline.
> 

Yes, the code currently hardcodes test for --file-prefix-map and if it is supported, it uses/initializes it.
Not sure a generic API to query gcc command line options can be done easily though. Command line options are queried via various methods, i.e.:
${CC} -Q --help=target
${CC} -Q --help=optimizers
${CC} -Q --help=common
${CC} -Q --help=joined
...
Generally:

help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]

We could enumerate all help options, something like
${CC} -Q --help=target,common,optimizers,...

But that seems rather costly to do for each command line argument.
Of course, we could also pass the --help argument as an additional argument to the compiler options API to keep it a bit more efficient, but this could become ugly real quick.



More information about the Openembedded-core mailing list