From patchwork Fri Sep 23 14:58:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 674113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sgc2G0WgVz9t0v for ; Sat, 24 Sep 2016 00:59:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AD1EDC1171; Fri, 23 Sep 2016 14:58:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L8wYkuIuIe9j; Fri, 23 Sep 2016 14:58:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id DFCEDC116D; Fri, 23 Sep 2016 14:58:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 599021C1F31 for ; Fri, 23 Sep 2016 14:58:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 54C4C8C365 for ; Fri, 23 Sep 2016 14:58:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OyEp9kf7pInO for ; Fri, 23 Sep 2016 14:58:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.60.111]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8742C8C35D for ; Fri, 23 Sep 2016 14:58:56 +0000 (UTC) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id A85AB10C1741; Fri, 23 Sep 2016 07:58:55 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 9B10955F13; Fri, 23 Sep 2016 07:58:55 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 5961755F02; Fri, 23 Sep 2016 07:58:55 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 42DD7D10; Fri, 23 Sep 2016 07:58:55 -0700 (PDT) Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id 7CBA2D0D; Fri, 23 Sep 2016 07:58:53 -0700 (PDT) From: Alexey Brodkin To: buildroot@busybox.net Date: Fri, 23 Sep 2016 17:58:49 +0300 Message-Id: <1474642729-40702-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.6.3 MIME-Version: 1.0 Cc: Thomas Petazzoni , Peter Seiderer , Alexey Brodkin , "Yann E. MORIN" Subject: [Buildroot] [PATCH] qt5: Disable passing of -isystem flag in CXXFLAGS X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 ^ 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 Cc: Thomas Petazzoni Cc: Peter Seiderer Cc: Julien Corjon Cc: "Yann E. MORIN" Reviewed-by: Arnout Vandecappelle (Essensium/Mind) --- 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)