All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] qt5: Disable passing of -isystem flag in CXXFLAGS
Date: Fri, 23 Sep 2016 17:58:49 +0300	[thread overview]
Message-ID: <1474642729-40702-1-git-send-email-abrodkin@synopsys.com> (raw)

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

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Seiderer <ps.report@gmx.net>
Cc: Julien Corjon <corjon.j@ecagroup.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/qt5/qt5base/qmake.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/qt5/qt5base/qmake.conf b/package/qt5/qt5base/qmake.conf
index 2152d3c..49cf898 100644
--- a/package/qt5/qt5base/qmake.conf
+++ b/package/qt5/qt5base/qmake.conf
@@ -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)
-- 
2.6.3

             reply	other threads:[~2016-09-23 14:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 14:58 Alexey Brodkin [this message]
2016-09-23 22:11 ` [Buildroot] [PATCH] qt5: Disable passing of -isystem flag in CXXFLAGS Arnout Vandecappelle
2016-09-26 11:30   ` Alexey Brodkin
2016-09-27 22:33     ` Arnout Vandecappelle
2016-09-28  8:54       ` Alexey Brodkin
2016-09-29 21:05         ` Arnout Vandecappelle
2016-09-29 21:34           ` Arnout Vandecappelle
2016-09-30  8:55             ` Alexey Brodkin
2016-10-05  7:12               ` Alexey Brodkin
2016-09-30  8:54           ` Alexey Brodkin
2016-09-28  8:57       ` Thomas Petazzoni
2016-09-29 21:30         ` Arnout Vandecappelle
2016-10-05  8:01 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474642729-40702-1-git-send-email-abrodkin@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.