From patchwork Fri Oct 30 07:06:07 2015 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: 538177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 78B221412D8 for ; Fri, 30 Oct 2015 18:06:36 +1100 (AEDT) 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=HPOzioNd; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4D9CC8D363; Fri, 30 Oct 2015 07:06:35 +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 EbmsQDI8syPK; Fri, 30 Oct 2015 07:06:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 64EC28C398; Fri, 30 Oct 2015 07:06:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D10091C105E for ; Fri, 30 Oct 2015 07:06:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CBA792EF45 for ; Fri, 30 Oct 2015 07:06:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Oblk4jEEXM8B for ; Fri, 30 Oct 2015 07:06:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by silver.osuosl.org (Postfix) with ESMTPS id DC50026A00 for ; Fri, 30 Oct 2015 07:06:28 +0000 (UTC) Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id 3330E209E8 for ; Fri, 30 Oct 2015 08:06:26 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3nnF6n4hTQz5vN0 for ; Fri, 30 Oct 2015 08:06:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded.rocks (Postfix) with ESMTP id 882C8EE0C2C; Fri, 30 Oct 2015 08:06:24 +0100 (CET) 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:x-mailer:message-id:date:date:subject:subject:from :from:received:received; s=default; t=1446188770; x=1446793571; bh=CQ/LQuq8TGNeK2QIMLMzFGRPBKyokXwlrJki2XFGJ3w=; b=HPOzioNd92/U cv1AL1ViGB6kbIAmp+1Ghc0sWiwZcCeO8AYnLKc6oHaIK7b1uMvGdnJucKW/Qd99 3RlrIFWKwkvb8cX1Zohhwesgwrp/yQtyt2sActcC3zcyf97tfladoDxlNORBBfNw v55hZZvzX85tkXZlCp58D1RhuE8JBs10tnVi1sSoZU+qDZRqCl3h+g/Eb6qQ7lwK 7q9p0n3JozMIiYt0zVliHbrrCWlkj8tceH4S3lMCOFaHyYIgpWcYpWZCAtCOav1d Cw/9eYzbK6cJWG6lp9uzVnszSHH9pU91rW+HPNAS0vM9uq+Vaf53y3R7sZ6lBpdb eSeO706x6A== X-Virus-Scanned: Debian amavisd-new at mail.embedded.rocks 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 Hl7X6NSuFSzj; Fri, 30 Oct 2015 08:06:10 +0100 (CET) Received: from nzxt.fritz.box (x4d0236ba.dyn.telefonica.de [77.2.54.186]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Fri, 30 Oct 2015 08:06:10 +0100 (CET) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Fri, 30 Oct 2015 08:06:07 +0100 Message-Id: <1446188767-14602-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/jsoncpp: add patch to fix musl build issue on x86 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" This patch is replaces two previous sumbissions, the first by Bernd Kuhls [1], the second by me [2]. The posix_memalign declaration is incompatible with musl for C++ on x86, because of the exception specification [2]. Note, the referenced patch is part of a patch series to "Add musl support to GCC". However, this build issue only happens if compilation is done with the GCC compiler option '-pedantic' [3] which is done so in jsoncpp. Fortunately, upstream accepted a patch to opt-out '-pedantic' [4]. We backport this patch to fix autobuild errors. Fixes: http://autobuild.buildroot.net/results/588/5885d33b8d9f17878f565f3ae5371017dc89aede/ http://autobuild.buildroot.net/results/0d9/0d90c7c13ae1640b07709c4c686e0237ada1324d/ http://autobuild.buildroot.net/results/30b/30b98ac7362c27254218a6e521d29971070f8c3c/ http://autobuild.buildroot.net/results/292/29289c125166630aeaf884ccc006bcf12c8aa0f6/ and many more. [1] https://patchwork.ozlabs.org/patch/505425/ [2] https://patchwork.ozlabs.org/patch/533169/ [3] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html [4] https://github.com/open-source-parsers/jsoncpp/commit/48bfe910622d79507983fc36254ca9f3ca63acb6 Signed-off-by: Jörg Krause --- .../0002-Add-option-JSONCPP_WITH_STRICT_ISO.patch | 68 ++++++++++++++++++++++ package/jsoncpp/jsoncpp.mk | 3 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 package/jsoncpp/0002-Add-option-JSONCPP_WITH_STRICT_ISO.patch diff --git a/package/jsoncpp/0002-Add-option-JSONCPP_WITH_STRICT_ISO.patch b/package/jsoncpp/0002-Add-option-JSONCPP_WITH_STRICT_ISO.patch new file mode 100644 index 0000000..f6172e9 --- /dev/null +++ b/package/jsoncpp/0002-Add-option-JSONCPP_WITH_STRICT_ISO.patch @@ -0,0 +1,68 @@ +From 9c5478562eba4bed32577a1dd7ce02b3bb7f6b4e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Thu, 29 Oct 2015 09:19:41 +0100 +Subject: [PATCH 1/1] Add option JSONCPP_WITH_STRICT_ISO +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +'-pedantic' issues all warnings demanded by strict ISO C/C++; rejecting +extensions that do not follow ISO C/C++. Without this option, certain GNU +extensions and traditional C/C++ features are supported as well. + +With this option enabled building jsoncpp fails with the musl toolchain on +x86 because of an incompatible posix_memalign declaration [1]. Without +'-pedantic' there is no error anymore and jsoncpp builds fine. + +Add an option JSONCPP_WITH_STRICT_ISO to disable compilation with '-pedantic' +with GCC. If jsoncpp is build with the JSONCPP_WITH_WARNING_AS_ERROR option +'-pedantic-errors' is used instead. + +[1] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html + +Backported from: 48bfe910622d79507983fc36254ca9f3ca63acb6 + +Signed-off-by: Jörg Krause +--- + CMakeLists.txt | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62bf203..60ecb6f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,7 @@ ENABLE_TESTING() + OPTION(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON) + OPTION(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" ON) + OPTION(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occurs" OFF) ++OPTION(JSONCPP_WITH_STRICT_ISO "Issue all the warnings demanded by strict ISO C and ISO C++" ON) + OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON) + OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF) + OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF) +@@ -83,6 +84,9 @@ macro(UseCompilationWarningAsError) + # Only enabled in debug because some old versions of VS STL generate + # warnings when compiled in release configuration. + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ") ++ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ if (JSONCPP_WITH_STRICT_ISO) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") + endif( MSVC ) + endmacro() + +@@ -100,8 +104,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wno-sign-conversion") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra -pedantic") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra") + # not yet ready for -Wsign-conversion ++ ++ if (JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") ++ endif () + endif() + + IF(JSONCPP_WITH_WARNING_AS_ERROR) +-- +2.6.2 + diff --git a/package/jsoncpp/jsoncpp.mk b/package/jsoncpp/jsoncpp.mk index 132e264..52db2cd 100644 --- a/package/jsoncpp/jsoncpp.mk +++ b/package/jsoncpp/jsoncpp.mk @@ -12,6 +12,7 @@ JSONCPP_INSTALL_STAGING = YES JSONCPP_CONF_OPTS += \ -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \ - -DJSONCPP_WITH_TESTS=OFF + -DJSONCPP_WITH_TESTS=OFF \ + -DJSONCPP_WITH_STRICT_ISO=OFF $(eval $(cmake-package))