Bug 99516 - Problem with libbsd-overlay.pc when cross-compiling in Yocto
Summary: Problem with libbsd-overlay.pc when cross-compiling in Yocto
Status: RESOLVED DUPLICATE of bug 97337
Alias: None
Product: libbsd
Classification: Unclassified
Component: libbsd (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Guillem Jover
QA Contact:
Depends on:
Reported: 2017-01-24 14:22 UTC by Ola Nilsson
Modified: 2017-06-19 02:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Ola Nilsson 2017-01-24 14:22:40 UTC
The libbsd-overlay.pc.in file adds '-isystem /usr/lib/bsd' to CFLAGS.  
gcc 5.3.0 gives this problem when cross-compiling with a --sysroot option.

cc1: warning: include location "/usr/include/bsd" is unsafe for cross-compilation [-Wpoison-system-directories]

This error occurred for us building llpdp 0.9.2 in Yocto release 2.1.2.

We fixed it by adding a preceeding '=' to the path in the pc file.
Comment 1 Peter Kjellerstedt 2017-01-26 13:59:34 UTC
This is really a problem in pkg-config and its handling of sysroot. It currently only handles -I and -L correctly, but misses -isystem (probably because it is so rare to use -isystem in a pc file).
Comment 2 Guillem Jover 2017-06-19 02:59:56 UTC
This got reported in the past, and I reassigned it to pkg-config which they fixed in git. The fix should have been included in pkg-config-0.29.2.

As an alternative option you could also use https://github.com/pkgconf/pkgconf which also does get this right.

I'm thus closing this as a duplicate. Thanks.

*** This bug has been marked as a duplicate of bug 97337 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.