[OE-core] [PATCH] gcc-7.inc: add new warning "Wnot-cross-compiler"
Andre McCurdy
armccurdy at gmail.com
Wed Jul 19 23:26:26 UTC 2017
On Wed, Jul 19, 2017 at 2:57 PM, Bystricky, Juro
<juro.bystricky at intel.com> wrote:
>> precisely, the problem is that some host compiler may silently ignore
>> unknown warnings and some host may not be using gcc as default system
>> compiler at all e.g. mageia distro and may be more in future.
>
> Yes, it does not nor it attempts to solve all toolchain issues.
> The expectation is that a compiler will choke on an unrecognized option.
> For example, gcc will do the following:
>
> $ gcc -Wnot-cross-compiler hello_world.c
> gcc: error: unrecognized command line option ‘-Wnot-cross-compiler’
>
> As for non-gcc compilers: yes, they may silently ignore unrecognized options
> (which IMHO is just wrong). In that case the new options does not work as intended,
> but it does no harm either.
> Anyway, the intended use was to add something like this a .conf file:
>
> TARGET_CC_ARCH_append_class-target = " -Wnot-cross-compiler -Werror=not-cross-compiler"
Personally, I think we already try to pass too much via CC or the
compiler command line (e.g. -fdebug-prefix-map=XXX). Has there ever
been any thought of OE providing a toolchain wrapper, which could pass
these kinds of housekeeping options to the underlying toolchain while
keeping build logs clean and without the worry that CC, CFLAGS, etc
get ignored or clobbered by a custom Makefile somewhere?
More information about the Openembedded-core
mailing list