From patchwork Wed Sep 21 23:31:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 673096 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 3sfbWL1zb9z9sCg for ; Thu, 22 Sep 2016 09:32:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=j9jd3tOx; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6A4B48B81C; Wed, 21 Sep 2016 23:32:11 +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 8joslAOf32EI; Wed, 21 Sep 2016 23:32:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C4E718B905; Wed, 21 Sep 2016 23:32:06 +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 39B441C1EB7 for ; Wed, 21 Sep 2016 23:32:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 338C583FDD for ; Wed, 21 Sep 2016 23:32:04 +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 x6qIGw+FNRWb for ; Wed, 21 Sep 2016 23:32:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by whitealder.osuosl.org (Postfix) with ESMTPS id AC05D83845 for ; Wed, 21 Sep 2016 23:32:02 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3sfbVy2QTyzyv4 for ; Thu, 22 Sep 2016 01:31:49 +0200 (CEST) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=default; t= 1474500708; x=1475105509; bh=bZzt4AVS2iSvD+CGluG7Bh3uNK72BU7pbJC fb3jOdhs=; b=j9jd3tOx3OO8RLghOyEkzhXzxclEr3KQyLCa8Biy5/40slKLKau wilL3TFVwv1SGEQ68/Cv6902nJPdTB7rZlEorIG5DAisNYJ4dL1xmoKfdmr/kyUF xb648FS89Hhnh33Yz+G0IGp1lmbXr3qkHiNBoNoCLQx4QkhzHOQh9cyX0ad2xdRX oL/u8Xnom3uu0TWWmlLXT3u0VH87n9FSFQfsMKBAkEbV713PbSLxUXC4PLZ/qs+4 0N7VTgPaNN+AZtlpMJ61uXa++zXxWAShjIjTlzK+x9Oc7ahnyLKrmjJD4dfTiwZv Ij+uG0bGZVSOz/mmD77tcO9BC+cq1/B9MGg== Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id BDE2b_8fec-n; Thu, 22 Sep 2016 01:31:48 +0200 (CEST) Received: from nzxt.fritz.box (x2f76d87.dyn.telefonica.de [2.247.109.135]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Thu, 22 Sep 2016 01:31:48 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Thu, 22 Sep 2016 01:31:43 +0200 Message-Id: <20160921233143.28149-3-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20160921233143.28149-1-joerg.krause@embedded.rocks> References: <20160921233143.28149-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] package/ola: add patch to fix build with GCC 6 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" Fixes: http://autobuild.buildroot.net/results/2d5/2d55b5d88a06c7b8e6baeb96973009a451e992d9/ http://autobuild.buildroot.net/results/899/89922e61c583cf1d11bd0bafdd5586c35d8f6e15/ http://autobuild.buildroot.net/results/d5b/d5b8fe66ff8d9ea91e87ef6fbe8274f5e24aa7b0/ http://autobuild.buildroot.net/results/89b/89b136e6dced6ca9842a1f23141b0cb999f783da/ .. and many more. Building OLA with a GCC 6 cross-toolchain fails: ``` /usr/bin/arm-linux-g++ -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./include -I./include -Wall -Wformat -W -isystem /usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pthread -c -o libs/acn/e131_transmit_test.o libs/acn/e131_transmit_test.cpp /usr/bin/arm-linux-g++ -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./include -I./include -Wall -Wformat -W -isystem /usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pthread -c -o libs/acn/E131TestFramework.o libs/acn/E131TestFramework.cpp In file included from /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/ext/string_conversions.h:41:0, from /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/bits/basic_string.h:5402, from /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/string:52, from ./tools/ola_trigger/config.ypp:2: /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory #include_next ^ compilation terminated. ``` The C++ library in GCC 6 now provides its own `` header that wraps the C library header of the same name, so in `` the header include ``` #include ``` has become ``` #include_next ``` `#include_next` is sensitive to the order of directories in the preprocessor's search path, so if that order is changed with `-isystem` then the compiler can't find the right header: ``` [1] /usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include [2] /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0 [..] End of search list. ``` `` is located in [2] whereas `` (C library header) is in [1]. In this case, the `#include_next ` statement in ``, located in [2], is evaluated **after** the search path [1], so the compiler does not find the right system header. The problem here is that the OLA build system replaces the `-I` in the CFLAGS from libprotobuf with `-isystem` to fix some warnings treated as errors in the libprotobuf header files. `-isystem` should be used to suppress warnings in system headers only and the libprotobuf header files are not system files. The correct fix is to compile with less restrictions and remove `-Werror` for the build. This is already done by passing `--disable-fatal-warnings` to OLA. Fix the reordering of the GCC search paths by removing the replacement of `-I` with `-isystem`. Upstream status: https://github.com/OpenLightingProject/ola/pull/1126 Signed-off-by: Jörg Krause --- .../ola/0002-Remove-replacing-I-with-isystem.patch | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 package/ola/0002-Remove-replacing-I-with-isystem.patch diff --git a/package/ola/0002-Remove-replacing-I-with-isystem.patch b/package/ola/0002-Remove-replacing-I-with-isystem.patch new file mode 100644 index 0000000..010c99a --- /dev/null +++ b/package/ola/0002-Remove-replacing-I-with-isystem.patch @@ -0,0 +1,106 @@ +From bbb03794def326c2e8ad2de523c5a61a4c8cb464 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Thu, 22 Sep 2016 00:58:58 +0200 +Subject: [PATCH] Remove replacing -I with -isystem +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Building OLA with a GCC 6 cross-toolchain fails: + +``` +/usr/bin/arm-linux-g++ -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE +-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./include -I./include +-Wall -Wformat -W -isystem +/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include -pthread +-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os +-pthread -c -o libs/acn/e131_transmit_test.o +libs/acn/e131_transmit_test.cpp +/usr/bin/arm-linux-g++ -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE +-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./include -I./include +-Wall -Wformat -W -isystem +/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include -pthread +-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os +-pthread -c -o libs/acn/E131TestFramework.o +libs/acn/E131TestFramework.cpp +In file included from +/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/ext/string_conversions.h:41:0, + from +/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/bits/basic_string.h:5402, + from +/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/string:52, + from ./tools/ola_trigger/config.ypp:2: +/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0/cstdlib:75:25: +fatal error: stdlib.h: No such file or directory + #include_next + ^ +compilation terminated. +``` + +The C++ library in GCC 6 now provides its own `` header that +wraps the C library header of the same name, so in `` the +header include + +``` +#include +``` + +has become + +``` +#include_next +``` + +`#include_next` is sensitive to the order of directories in the +preprocessor's search path, so if that order is changed with `-isystem` +then the compiler can't find the right header: + +``` +[1] /usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include +[2] /opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/6.1.0 +[..] +End of search list. +``` + +`` is located in [2] whereas `` (C library header) is +in [1]. In this case, the `#include_next ` statement in +``, located in [2], is evaluated **after** the search path [1], +so the compiler does not find the right system header. + +The problem is that the OLA build system replaces the `-I` in the CFLAGS +from libprotobuf with `-isystem` to fix some warnings treated as errors +in the libprotobuf header files. + +`-isystem` should be used to suppress warnings in system headers only +and the libprotobuf header files are not system files. + +The correct fix is to compile with less restrictions and remove +`-Werror` for the build. + +As using `-isystem` is reordering GCCs search path and using `-isystem` +is really not necessary, remove the faulty replacement of `-I`. + +Upstream status: https://github.com/OpenLightingProject/ola/pull/1126 + +Signed-off-by: Jörg Krause +--- + config/ola.m4 | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/config/ola.m4 b/config/ola.m4 +index 2796cfb..d3b8cc8 100644 +--- a/config/ola.m4 ++++ b/config/ola.m4 +@@ -24,9 +24,6 @@ AC_DEFUN([PROTOBUF_SUPPORT], + AC_REQUIRE_CPP() + PKG_CHECK_MODULES(libprotobuf, [protobuf >= $1]) + +-# We want to replace -I with -isystem here to disable errors in the .h files +-# See https://groups.google.com/forum/#!topic/open-lighting/39Mj0KXlCIk +-libprotobuf_CFLAGS=`echo $libprotobuf_CFLAGS | sed 's/-I/-isystem /'` + AC_SUBST([libprotobuf_CFLAGS]) + + AC_ARG_WITH([protoc], +-- +2.10.0 +