[yocto] How should we handle GCC 6 and -isystem /usr/include?

Khem Raj raj.khem at gmail.com
Tue Apr 25 17:44:35 PDT 2017



On 4/20/17 5:04 PM, Martin Kelly wrote:
> Hi,
> 
> After compiling a package with GCC 6, I noticed the following error,
> which is a known issue:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
> 
> The problem is caused by adding -isystem /usr/include, which breaks the
> GCC 6's #include_next. I see that Khem Raj already removed this for the
> nativesdk [1], but it seems we need a similar fix for other packages, as
> we are still adding -isystem in meta/conf/bitbake.conf:
> 
> [snip]
> BUILDSDK_CPPFLAGS = "-isystem${STAGING_INCDIR}"
> [snip]

You must be not using master since it has been fixed by
http://git.openembedded.org/openembedded-core/commit/meta/conf/bitbake.conf?id=88ec93d152762aedeaa231d2732e9d4b9843795a

> 
> I experimented with a few options:
> 
> - Changing this to "-I${STAGING_INCDIR}". Although this works (and the
> poky repo will recompile with it), I believe it will break when a recipe
> does -Wall -Werror and hits an error in the standard include files
> (-isystem specifically ignores warnings for this reason.)
> 
> - Changing this to just "". This breaks at least pbzip2-native, which
> can no longer find bzlib.h, since it uses the system g++ to do so and
> bzlib-dev is not installed.
> 
> I'm guessing the right solution involves passing a --sysroot option to
> the native build instead of -isystem so that the builtin gcc/g++
> /usr/include will find the right files.
> 
> Does this sound right, or do you have other ideas?
> 
> Thanks,
> Martin
> 
> [1] poky 54d06c080393785270313878bc4a15a9915571ba
>     https://patchwork.openembedded.org/patch/122285/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: OpenPGP digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170425/eec778c9/attachment.pgp>


More information about the yocto mailing list