Skip to contentSkip to conversation

qt5: Disable passing of -isystem flag in CXXFLAGS

PATCH New Alexey Brodkin 3 participants 13 messages Sep 23, 2016 – Oct 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Some Qt5 sub-projects as well as 3rd-party apps written on Qt
are failing to compile with gcc 6.x like that:
---------------------------->8-------------------------
In file included from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/bits/stl_algo.h:59:0,

                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/algorithm:62,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qglobal.h:88,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qpair.h:37,
                 from qmediametadata.h:37,
                 from qmediametadata.cpp:28:
XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^

compilation terminated. ---------------------------->8-------------------------

That happens because qmake trying to play smart passes some include paths in Makefile with "-isystem" prefix. Which in some cases lead to build failure well described in [1].

A little bit more details below on what really happens:

1. In "configure" script Qt determines default include paths of the toolchain and stores them in DEFAULT_INCDIRS variable, see [2].

2. On qmake execution when it creates Makefile out of .pro-file it parses headers in INCLUDEPATH variable and if a path matches one in DEFAULT_INCDIRS then in CXXFLAGS that path is written with $QMAKE_CFLAGS_ISYSTEM prefix, otherwise non-matching include path ends up in CXXFLAGS with normal "-I" prefix.

3. By default for gcc "QMAKE_CFLAGS_ISYSTEM = -isystem", see [3].

4. gcc fails to find stdlib.h, again refer to J?rg's explanation in [1].

What we do here we force set QMAKE_CFLAGS_ISYSTEM to "" and so qmake won't use "-isystem" any longer instead expected "-I" will be used for all headers, see [4].

That fixes building of Qt5Webkit on ARM with gcc 6.x and a number of autobuilder failures for ARC (the an arch that uses gcc 6 by default) like:
http://autobuild.buildroot.net/results/56a/56a6700774af692e7f5a99b452b15e4e8592310f
http://autobuild.buildroot.net/results/697/697412b29bf031bf8f246cc3af97ebcbf6bf6d1b

[1] https://git.buildroot.net/buildroot/commit/?id=e79272fa7ff3d66c18de3514b912cd9d68d121a4
[2] http://code.qt.io/cgit/qt/qtbase.git/tree/configure?h=5.6.1#n3660
[3] http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/common/gcc-base.conf?h=5.6.1#n47
[4] http://code.qt.io/cgit/qt/qtbase.git/tree/qmake/generators/unix/unixmake2.cpp?&h=5.6.1#n193

Cc Thomas Petazzoni <[email protected]>
Cc Peter Seiderer <[email protected]>
Cc Julien Corjon <[email protected]>
Cc "Yann E. MORIN" <[email protected]>
---
 package/qt5/qt5base/qmake.conf | 1 +
 1 file changed, 1 insertion(+)
package/qt5/qt5base/qmake.conf +1 -0
index 2152d3c..49cf898 100644
@@ -19,6 +19,7 @@ QMAKE_CXXFLAGS_RELEASE += -O3
 CONFIG                 += nostrip
 
 QMAKE_LIBS             += -lrt -lpthread -ldl
+QMAKE_CFLAGS_ISYSTEM   =
 
 include(../common/linux_device_post.conf)
 load(qt_config)
Signature · 1 line
2.6.3
#1 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Hi Alexey,

Excellent commit log!

Quoted 30 lines · Alexey Brodkin

Some Qt5 sub-projects as well as 3rd-party apps written on Qt
are failing to compile with gcc 6.x like that:
---------------------------->8-------------------------
In file included from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/bits/stl_algo.h:59:0,

                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/algorithm:62,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qglobal.h:88,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qpair.h:37,
                 from qmediametadata.h:37,
                 from qmediametadata.cpp:28:
XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^

compilation terminated. ---------------------------->8-------------------------

That happens because qmake trying to play smart passes some include paths in Makefile with "-isystem" prefix. Which in some cases lead to build failure well described in [1].

A little bit more details below on what really happens:

1. In "configure" script Qt determines default include paths of the toolchain and stores them in DEFAULT_INCDIRS variable, see [2].

2. On qmake execution when it creates Makefile out of .pro-file it parses headers in INCLUDEPATH variable and if a path matches one in DEFAULT_INCDIRS then in CXXFLAGS that path is written with $QMAKE_CFLAGS_ISYSTEM prefix, otherwise non-matching include path ends up in CXXFLAGS with normal "-I" prefix.

Quoted 3 lines

3. By default for gcc "QMAKE_CFLAGS_ISYSTEM = -isystem", see [3].

4. gcc fails to find stdlib.h, again refer to J?rg's explanation in [1].

There is one difference here, however: In J?rg's explanation, it's about
headers which really aren't system headers (protobuf). But in this case, the headers really are system headers.

Quoted 4 lines

What we do here we force set QMAKE_CFLAGS_ISYSTEM to "" and so qmake won't use "-isystem" any longer instead expected "-I" will be used for all headers, see [4].

Another option would be to set it to -idirafter, which puts the directory at
the end of the default search path and I think it also still treats it as a system directory. But that would possibly lead to even worse side effects, so maybe not such a good idea.

I still don't understand how the -I$(STAGING_DIR)/usr/include gets added, by
the way. Isn't pkg-config supposed to suppress those, because they already are in the default search path? For instance, on my system I have a xf86dgaproto.pc which contains Cflags: -I${includedir}, but pkg-config --cflags xf86dgaproto gives empty.

But in the end it will probably come down to this patch anyway, so

However, I propose to wait another week or so to see if someone else comes up with a better idea.

Regards,
Arnout

Quoted 33 lines

That fixes building of Qt5Webkit on ARM with gcc 6.x and a number of autobuilder failures for ARC (the an arch that uses gcc 6 by default) like:
http://autobuild.buildroot.net/results/56a/56a6700774af692e7f5a99b452b15e4e8592310f
http://autobuild.buildroot.net/results/697/697412b29bf031bf8f246cc3af97ebcbf6bf6d1b

[1] https://git.buildroot.net/buildroot/commit/?id=e79272fa7ff3d66c18de3514b912cd9d68d121a4
[2] http://code.qt.io/cgit/qt/qtbase.git/tree/configure?h=5.6.1#n3660
[3] http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/common/gcc-base.conf?h=5.6.1#n47
[4] http://code.qt.io/cgit/qt/qtbase.git/tree/qmake/generators/unix/unixmake2.cpp?&h=5.6.1#n193

Cc Thomas Petazzoni <[email protected]>
Cc Peter Seiderer <[email protected]>
Cc Julien Corjon <[email protected]>
Cc "Yann E. MORIN" <[email protected]>
---
 package/qt5/qt5base/qmake.conf | 1 +
 1 file changed, 1 insertion(+)
package/qt5/qt5base/qmake.conf +1 -0
index 2152d3c..49cf898 100644
@@ -19,6 +19,7 @@ QMAKE_CXXFLAGS_RELEASE += -O3
 CONFIG                 += nostrip
 
 QMAKE_LIBS             += -lrt -lpthread -ldl
+QMAKE_CFLAGS_ISYSTEM   =
 
 include(../common/linux_device_post.conf)
 load(qt_config)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Hi Arnout,

Quoted 3 lines · Arnout Vandecappelle

?Hi Alexey,

?Excellent commit log!

That a pleasure to read this kind of comments really :)

Quoted 33 lines · Alexey Brodkin
Quoted 32 lines

Some Qt5 sub-projects as well as 3rd-party apps written on Qt
are failing to compile with gcc 6.x like that:
---------------------------->8-------------------------
In file included from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/bits/stl_algo.h:59:0, ?????????????????from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/algorithm:62, ?????????????????from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qglobal.h:88, ?????????????????from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qpair.h:37, ?????????????????from qmediametadata.h:37,
?????????????????from qmediametadata.cpp:28:
XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
?#include_next <stdlib.h>
?????????????????????????^
compilation terminated.
---------------------------->8-------------------------

That happens because qmake trying to play smart passes some include paths in Makefile with "-isystem" prefix. Which in some cases lead to build failure well described in [1].

A little bit more details below on what really happens:

1. In "configure" script Qt determines default include paths of the ???toolchain and stores them in DEFAULT_INCDIRS variable, see [2].

2. On qmake execution when it creates Makefile out of .pro-file ???it parses headers in INCLUDEPATH variable and if a path matches ???one in DEFAULT_INCDIRS then in CXXFLAGS that path is written ???with $QMAKE_CFLAGS_ISYSTEM prefix, otherwise non-matching include ???path ends up in CXXFLAGS with normal "-I" prefix.

Quoted 7 lines
Quoted 3 lines

3. By default for gcc "QMAKE_CFLAGS_ISYSTEM = -isystem", see [3].

4. gcc fails to find stdlib.h, again refer to J?rg's explanation in [1].

?There is one difference here, however: In J?rg's explanation, it's about headers which really aren't system headers (protobuf). But in this case, the headers really are system headers.

Indeed.

Quoted 11 lines
Quoted 5 lines

What we do here we force set QMAKE_CFLAGS_ISYSTEM to "" and so qmake won't use "-isystem" any longer instead expected "-I" will be used for all headers, see [4].

?Another option would be to set it to -idirafter, which puts the directory at the end of the default search path and I think it also still treats it as a system directory. But that would possibly lead to even worse side effects, so maybe not such a good idea.

Quoted 5 lines

?I still don't understand how the -I$(STAGING_DIR)/usr/include gets added, by the way. Isn't pkg-config supposed to suppress those, because they already are in the default search path? For instance, on my system I have a xf86dgaproto.pc which contains Cflags: -I${includedir}, but pkg-config --cflags xf86dgaproto gives empty.

That's how:
--------------------->8--------------------
export PATH=/XXX/output/host/usr/bin/:$PATH /XXX/output/build/qt5webkit-b889f460280ad98c89ede179bd3b9ce9cb02002b/Tools/qmake/config.tests/icu/pkg-config_wrapper.sh --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata ? --------------------->8--------------------

Looks like .pc files from "XXX/output/host/usr/lib/pkgconfig" are used.

And just FYI contents of "pkg-config_wrapper.sh":
--------------------->8--------------------
ccat /XXX/output/build/qt5webkit-b889f460280ad98c89ede179bd3b9ce9cb02002b/Tools/qmake/config.tests/icu/pkg- config_wrapper.sh?
#!/bin/sh
PKG_CONFIG_SYSROOT_DIR=/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot
export PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_LIBDIR=/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig export PKG_CONFIG_LIBDIR
exec pkg-config "$@"
--------------------->8--------------------

-Alexey

#3 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Quoted 3 lines · Alexey Brodkin

Hi Arnout,

On Sat, 2016-09-24 at 00:11 +0200, Arnout Vandecappelle wrote:

[snip]

Quoted 5 lines
Quoted 5 lines

I still don't understand how the -I$(STAGING_DIR)/usr/include gets added, by
the way. Isn't pkg-config supposed to suppress those, because they already are in the default search path? For instance, on my system I have a xf86dgaproto.pc which contains Cflags: -I${includedir}, but pkg-config --cflags xf86dgaproto gives empty.

I mean that it's _our_ pkg-config that does the wrong thing.

------ output/staging/usr/lib/pkgconfig/libpcre.pc -------- # Package Information for pkg-config

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libpcre
Description: PCRE - Perl compatible regular expressions C library with 8 bit character support
Version: 8.39
Libs: -L${libdir} -lpcre
Libs.private:
Cflags: -I${includedir}
------------------------------------------------------------

output/host/usr/bin/pkg-config --cflags libpcre -IXXX/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include

According to me, this should have returned empty.

So I've checked, and it looks like this is a feature of the full-fledged
pkg-config that pkgconf doesn't have:

pkg-config --cflags libpcre
<empty>

output/host/usr/bin/pkgconf --cflags libpcre
-I/usr/include

So ideally, we should patch pkgconf (and send upstream) to remove the default
search paths.

Quoted 10 lines

That's how:
--------------------->8--------------------
export PATH=/XXX/output/host/usr/bin/:$PATH /XXX/output/build/qt5webkit-b889f460280ad98c89ede179bd3b9ce9cb02002b/Tools/qmake/config.tests/icu/pkg-config_wrapper.sh --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Looks like .pc files from "XXX/output/host/usr/lib/pkgconfig" are used.

No, it's from the staging dir
XXX/output/host/usr/<tuple>/sysroot/usr/lib/pkgconfig

Quoted 9 lines

And just FYI contents of "pkg-config_wrapper.sh":
--------------------->8--------------------
ccat /XXX/output/build/qt5webkit-b889f460280ad98c89ede179bd3b9ce9cb02002b/Tools/qmake/config.tests/icu/pkg- config_wrapper.sh
#!/bin/sh
PKG_CONFIG_SYSROOT_DIR=/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot
export PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_LIBDIR=/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig

See?

Regards,
Arnout

Quoted 6 lines

export PKG_CONFIG_LIBDIR
exec pkg-config "$@"
--------------------->8--------------------

-Alexey

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Hi?Arnout,

Quoted 39 lines · Arnout Vandecappelle
Quoted 4 lines · Alexey Brodkin

Hi Arnout,

On Sat, 2016-09-24 at 00:11 +0200, Arnout Vandecappelle wrote:

[snip]

Quoted 7 lines
Quoted 7 lines

?I still don't understand how the -I$(STAGING_DIR)/usr/include gets added, by the way. Isn't pkg-config supposed to suppress those, because they already are in the default search path? For instance, on my system I have a xf86dgaproto.pc which contains Cflags: -I${includedir}, but pkg-config --cflags xf86dgaproto gives empty.

?I mean that it's _our_ pkg-config that does the wrong thing.

------ output/staging/usr/lib/pkgconfig/libpcre.pc -------- # Package Information for pkg-config

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libpcre
Description: PCRE - Perl compatible regular expressions C library with 8 bit character support
Version: 8.39
Libs: -L${libdir} -lpcre
Libs.private:
Cflags: -I${includedir}
------------------------------------------------------------

output/host/usr/bin/pkg-config --cflags libpcre -IXXX/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include

?According to me, this should have returned empty.

Quoted 8 lines

?So I've checked, and it looks like this is a feature of the full-fledged pkg-config that pkgconf doesn't have:

pkg-config --cflags libpcre
<empty>

output/host/usr/bin/pkgconf --cflags libpcre
-I/usr/include

Well note in our case pkg-config is just a wrapper script
that is created out of BR's "package/pkgconf/pkg-config.in":
--------------------->8--------------------
cat ./output/host/usr/bin/pkg-config
#!/bin/sh
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux- uclibc/sysroot/usr/lib/pkgconfig:/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/share/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} $(dirname $0)/pkgconf??$@
--------------------->8--------------------

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

Quoted 2 lines

?So ideally, we should patch pkgconf (and send upstream) to remove the default search paths.

Given my comments above I'm not really sure it's pkgconf who's guilty.

Any thoughts?

-Alexey

#5 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Quoted 9 lines · Alexey Brodkin

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Quoted 5 lines

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

Your pure pkgconf case is using the host icu-i18n, that's why the -L flag is
missing. The host icu-i18n doesn't have a -L bit in its Libs: stanza.

You should compare:

1) pkgconf case
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L$STAGING_DIR/usr/lib -licuuc -licudata

2) Real pkg-config case:
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot /usr/bin/pkg-config --libs icu-i18n -licui18n -licuuc -licudata

We switched from pkg-config to pkgconf because it builds a whole lot faster
(pkg-config has a whole lot of dependencies). Obviously we give up features with that, but this is the first one where I think it is an important feature that we're missing.

Regards,
Arnout

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

So ideally, we should patch pkgconf (and send upstream) to remove the default
search paths.

Given my comments above I'm not really sure it's pkgconf who's guilty.

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Quoted 12 lines · Arnout Vandecappelle
Quoted 9 lines · Alexey Brodkin

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Quoted 8 lines
Quoted 5 lines

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

Your pure pkgconf case is using the host icu-i18n, that's why the -L flag is
missing. The host icu-i18n doesn't have a -L bit in its Libs: stanza.

Hm, actually, icu-uc.pc *does* have a -L bit in its Libs: stanza. But for the
host, I guess it recognizes that ${libdir} == /usr/lib so it can be eliminated. So perhaps that can be extended to cover a sysroot as well.

BTW, I did a quick test with pkgconf 1.0.1 and it still behaves the same.

Regards,
Arnout

Quoted 27 lines

You should compare:

1) pkgconf case
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L$STAGING_DIR/usr/lib -licuuc -licudata

2) Real pkg-config case:
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot /usr/bin/pkg-config --libs icu-i18n -licui18n -licuuc -licudata

We switched from pkg-config to pkgconf because it builds a whole lot faster
(pkg-config has a whole lot of dependencies). Obviously we give up features with that, but this is the first one where I think it is an important feature that we're missing.

Regards,
Arnout

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

So ideally, we should patch pkgconf (and send upstream) to remove the default
search paths.

Given my comments above I'm not really sure it's pkgconf who's guilty.

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Hi?Arnout,

Quoted 25 lines · Arnout Vandecappelle
Quoted 14 lines · Arnout Vandecappelle
Quoted 10 lines · Alexey Brodkin

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Quoted 8 lines
Quoted 5 lines

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

?Your pure pkgconf case is using the host icu-i18n, that's why the -L flag is missing. The host icu-i18n doesn't have a -L bit in its Libs: stanza.

Quoted 5 lines

?Hm, actually, icu-uc.pc *does* have a -L bit in its Libs: stanza. But for the host, I guess it recognizes that ${libdir} == /usr/lib so it can be eliminated. So perhaps that can be extended to cover a sysroot as well.

?BTW, I did a quick test with pkgconf 1.0.1 and it still behaves the same.

Shall we then file an issue here?https://github.com/pkgconf/pkgconf/issues??

-Alexey

#8 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Hi Thomas, Arnout,

Quoted 32 lines · Alexey Brodkin

Hi?Arnout,

Quoted 29 lines · Arnout Vandecappelle
Quoted 25 lines · Arnout Vandecappelle
Quoted 12 lines · Alexey Brodkin

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux- uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Quoted 5 lines

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

?Your pure pkgconf case is using the host icu-i18n, that's why the -L flag is missing. The host icu-i18n doesn't have a -L bit in its Libs: stanza.

Quoted 7 lines
Quoted 5 lines

?Hm, actually, icu-uc.pc *does* have a -L bit in its Libs: stanza. But for the host, I guess it recognizes that ${libdir} == /usr/lib so it can be eliminated. So perhaps that can be extended to cover a sysroot as well.

?BTW, I did a quick test with pkgconf 1.0.1 and it still behaves the same.

Shall we then file an issue here?https://github.com/pkgconf/pkgconf/issues??

I'm wondering if there're any other thoughts on this one?
We're seeing more and more instances of that problem, for example with qt5serialport?here?http://autobuild.buildroot.net/results/b14/b143bc806d45a91d52c43fa49227e88dc8a105d5/

So if there're no objections we may apply this one and see if it breaks anything while we're far enough from the next BR release and in the worst case we'll just revert it further down the line.

-Alexey

#9 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

In reply to Arnout Vandecappelle

Hi?Arnout,

Quoted 34 lines · Arnout Vandecappelle
Quoted 10 lines · Alexey Brodkin

So it all boils down to:
1) "pkg-config" case:
--------------------->8-------------------- PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot} ./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L/XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib -licuuc -licudata --------------------->8--------------------

Quoted 5 lines

2. Pure "pkgconf" case:
--------------------->8--------------------
./output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -licuuc -licudata
--------------------->8--------------------

?Your pure pkgconf case is using the host icu-i18n, that's why the -L flag is missing. The host icu-i18n doesn't have a -L bit in its Libs: stanza.

?You should compare:

1) pkgconf case
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot output/host/usr/bin/pkgconf --libs icu-i18n
-licui18n -L$STAGING_DIR/usr/lib -licuuc -licudata

2) Real pkg-config case:
PKG_CONFIG_LIBDIR=$STAGING_DIR/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR/sysroot /usr/bin/pkg-config --libs icu-i18n -licui18n -licuuc -licudata

Quoted 4 lines

?We switched from pkg-config to pkgconf because it builds a whole lot faster (pkg-config has a whole lot of dependencies). Obviously we give up features with that, but this is the first one where I think it is an important feature that we're missing.

Thanks for explanation that definitely makes sense.

-Alexey

#10 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

In reply to Arnout Vandecappelle

Hello,

Quoted 19 lines · Arnout Vandecappelle

I mean that it's _our_ pkg-config that does the wrong thing.

------ output/staging/usr/lib/pkgconfig/libpcre.pc -------- # Package Information for pkg-config

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libpcre
Description: PCRE - Perl compatible regular expressions C library with 8 bit character support
Version: 8.39
Libs: -L${libdir} -lpcre
Libs.private:
Cflags: -I${includedir}
------------------------------------------------------------

Quoted 4 lines

output/host/usr/bin/pkg-config --cflags libpcre -IXXX/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include

According to me, this should have returned empty.

So in other words, you're withdrawing your Reviewed-by on Alexey's patch, and say that we should fix host-pkgconf instead, right ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#11 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

Quoted 26 lines · Thomas Petazzoni

Hello,

Quoted 22 lines · Arnout Vandecappelle

I mean that it's _our_ pkg-config that does the wrong thing.

------ output/staging/usr/lib/pkgconfig/libpcre.pc -------- # Package Information for pkg-config

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libpcre
Description: PCRE - Perl compatible regular expressions C library with 8 bit character support
Version: 8.39
Libs: -L${libdir} -lpcre
Libs.private:
Cflags: -I${includedir}
------------------------------------------------------------

output/host/usr/bin/pkg-config --cflags libpcre -IXXX/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include

Quoted 6 lines
Quoted 1 line

According to me, this should have returned empty.

So in other words, you're withdrawing your Reviewed-by on Alexey's patch, and say that we should fix host-pkgconf instead, right ?

Thomas

Au contraire. Ideally host-pkgconf should be improved, but that's not a simple
task. Until then, Alexey's patch will work.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#12 lore raw

PATCH 1/1 qt5: Disable passing of -isystem flag in CXXFLAGS

In reply to Alexey Brodkin

Hello,

Quoted 12 lines · Alexey Brodkin

Some Qt5 sub-projects as well as 3rd-party apps written on Qt
are failing to compile with gcc 6.x like that:
---------------------------->8-------------------------
In file included from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/bits/stl_algo.h:59:0,

                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/algorithm:62,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qglobal.h:88,
                 from XXX/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/qt5/QtCore/qpair.h:37,
                 from qmediametadata.h:37,
                 from qmediametadata.cpp:28:
XXX/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.2.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
Quoted 2 lines

compilation terminated. ---------------------------->8-------------------------

Applied to master, thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com