[OE-core] [PATCH] cmake: add CMAKE_SYSROOT to generated toolchain file

Khem Raj raj.khem at gmail.com
Fri Aug 24 16:44:41 UTC 2018


On Fri, Aug 24, 2018 at 9:41 AM <Mikko.Rapeli at bmw.de> wrote:
>
> On Fri, Aug 24, 2018 at 09:23:45AM -0700, Khem Raj wrote:
> > On Fri, Aug 24, 2018 at 9:17 AM <Mikko.Rapeli at bmw.de> wrote:
> > >
> > > On Fri, Aug 24, 2018 at 08:51:42AM -0700, Khem Raj wrote:
> > > > On Fri, Aug 24, 2018 at 8:48 AM <Mikko.Rapeli at bmw.de> wrote:
> > > > > So to me it looks like using SYSTEM with target_include_directories()
> > > > > is no longer possible with CMake and gcc > 6:
> > > > >
> > > > >
> > > > > https://cmake.org/cmake/help/v3.10/command/target_include_directories.html?highlight=target_include_directories
> > > > >
> > > >
> > > > That’s right there is a patch I did  in WebKitgtk recipe in Oe Core you
> > > > might want to include similar fixes for this package the patch actually it
> > > > a workaround but then I also think using isystem in apps is a bad idea
> > >
> > > Yes, I tend to agree, but developers have used this to silence compiler
> > > warnings from system header files.
> > >
> > > In a few cases I saw that there were no longer any warnings coming from the
> > > headers but in some others there were.
> > >
> >
> > Unlike olden days, cross gcc compiler now a days knows about its
> > system headers and adds them implicitly with right options
> > so doing this include dance manually is not useful. Let compiler
> > decide to do the needed
> > for system headers, one must just specify --sysroot and let it handle
> > everything from sysroot.
> >
> > > Any other ideas how to suppress compiler wanings from system headers?
> > >
> >
> > what kind of warnings do you see ?
>
> After a ton of components have exported their headers to system paths,
> I see all kinds of crap. Some developers have cleaned up their own tree
> and added strict compiler flags, which I now have to relax since
> header file warning suppressions don't work, and new compiler produces
> new bunch of warnings. Here are few sample warnings from an ongoing build
> with counts redacted:
>
> $ egrep -ho "warning: .*" tmp-glibc/work/*/*/*/temp/log.do_compile| sort | uniq -c|sort -rn | head -8
>
> warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
> warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
> warning: conversion to 'int' from 'long unsigned int' may alter its value [-Wconversion]
> warning: missed loop optimization, the loop counter may overflow [-Wunsafe-loop-optimizations]
> warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> warning: ISO C++ forbids zero-size array 'f_handle' [-Wpedantic]
>

Perhaps you can just remove adding these system headers at all and let
compiler include
them for you

> -Mikko



More information about the Openembedded-core mailing list