From patchwork Wed May 22 16:32:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Jean Texier X-Patchwork-Id: 1103468 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=koncepto.io Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=koncepto.io header.i=@koncepto.io header.b="Ncf295DJ"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 458JBS3Nj0z9s00 for ; Thu, 23 May 2019 02:34:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6B337842F6; Wed, 22 May 2019 16:34:36 +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 hSPYWH7Bj4s6; Wed, 22 May 2019 16:34:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C5A7A83365; Wed, 22 May 2019 16:34:34 +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 D07E41BF3F4 for ; Wed, 22 May 2019 16:34:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CDE2520797 for ; Wed, 22 May 2019 16:34:32 +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 j0EGjjXUXEqq for ; Wed, 22 May 2019 16:34:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from koncepto.io (koncepto.io [195.154.119.111]) by silver.osuosl.org (Postfix) with ESMTPS id 41ECC20796 for ; Wed, 22 May 2019 16:34:31 +0000 (UTC) Received: from localhost.localdomain (lfbn-1-8938-37.w193-250.abo.wanadoo.fr [193.250.79.37]) by koncepto.io (Postfix) with ESMTPSA id 3FE0760024; Wed, 22 May 2019 18:34:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=koncepto.io; s=default; t=1558542860; bh=YMdpkJLu+Rs4ia6iXALDTbnUWgNkSnL+sVFdRJQEToA=; h=From:To:Cc:Subject:Date:From; b=Ncf295DJ5PffmXR/3yrjXf9uvvpCqTg1MDjmCEPMj8/nAd77BoOXPvuTMb7RVN/dh QKik6WUWR0XidpgUDxpfbxqJ6QrRoUDWmW4h9Ujwm1zZ1v5Ar6r+Xb9sj+2VavC7mW Oua9LuQU0pLNX/7R7R1UsEKf8qqatJmx7v+z5KfY1MlPIPZQZbUtmdGU1+9XgpQ7ht V6pQVpkYHHYBQkyIsUylVX2TUq+J0cOW03A0YSDBqGBNyj+kxK5km+ueWemK2Y5n00 VEBuPM7TxsMHou4qNFG2jiSceRlpvUzhExTKU1Y2h3gOls9h4R/dG1qatizN7H4i6v RDYpph6FcNI3w== From: Pierre-Jean Texier To: buildroot@buildroot.org Date: Wed, 22 May 2019 18:32:36 +0200 Message-Id: <1558542756-8919-1-git-send-email-pjtexier@koncepto.io> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCH/next v2 1/1] package/libubootenv: fix build with musl and static lib X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre-Jean Texier Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: - http://autobuild.buildroot.net/results/e18/e1837ccbe774071876642655b1fcffbd69dd7947/ - http://autobuild.buildroot.net/results/206/206f1eba0dec39de1c02d760fa8f961d5a3879d0/ Signed-off-by: Pierre-Jean Texier --- Changes v1 -> v2: - Do not force shared build (sendt upstream) (suggested by Thomas Petazzoni) - Add missing define _GNU_SOURCE (sendt upstream) (suggested by Thomas Petazzoni) - Remove BR2_STATIC_LIBS and BR2_TOOLCHAIN_USES_MUSL dependencies (suggested by Thomas Petazzoni) - fix compilation for glibc version >= 2.28 (sent upstream) - Build is now OK: ./utils/test-pkg -c libuboot.config -p libubootenv br-arm-full [1/6]: OK br-arm-cortex-a9-glibc [2/6]: OK br-arm-cortex-m4-full [3/6]: OK br-x86-64-musl [4/6]: OK br-arm-full-static [5/6]: OK sourcery-arm [6/6]: OK ...sts.txt-do-not-force-the-build-of-a-share.patch | 46 ++++++++++++++++++++++ .../0001-uboot_env-fix-build-with-musl-libc.patch | 31 +++++++++++++++ ...nv-fix-compilation-for-glibc-version-2.28.patch | 40 +++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 package/libubootenv/0001-src-CMakeLists.txt-do-not-force-the-build-of-a-share.patch create mode 100644 package/libubootenv/0001-uboot_env-fix-build-with-musl-libc.patch create mode 100644 package/libubootenv/0002-uboot_env-fix-compilation-for-glibc-version-2.28.patch diff --git a/package/libubootenv/0001-src-CMakeLists.txt-do-not-force-the-build-of-a-share.patch b/package/libubootenv/0001-src-CMakeLists.txt-do-not-force-the-build-of-a-share.patch new file mode 100644 index 0000000..c1196d6 --- /dev/null +++ b/package/libubootenv/0001-src-CMakeLists.txt-do-not-force-the-build-of-a-share.patch @@ -0,0 +1,46 @@ +From 5448ca9d92f7fa197060323a82a5f060ce7c31e7 Mon Sep 17 00:00:00 2001 +From: Pierre-Jean Texier +Date: Wed, 22 May 2019 10:26:27 +0200 +Subject: [PATCH] src/CMakeLists.txt: do not force the build of a shared + library + +By definition, projects using CMake which can build either static or shared +libraries use a BUILD_SHARED_LIBS flag to allow selecting between both. +So, let CMake rely on the standard BUILD_SHARED_LIBS variable to decide +whether a static or shared library should be built. + +however, we can control the behaviour as follows: + + $. cmake -DBUILD_SHARED_LIBS=OFF ... + + $. cmake -DBUILS_SHARED_LIBS=ON ... + +With Yocto/OE, just add the following option into the libubootenv recipe : + +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON" + +Signed-off-by: Pierre-Jean Texier +[Upstream status: http://patchwork.ozlabs.org/patch/1103437/] +--- + src/CMakeLists.txt | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 051732b..c5f6dcb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -10,10 +10,9 @@ SET(include_HEADERS + libuboot.h + ) + +-add_library(ubootenv SHARED ${libubootenv_SOURCES} ${include_HEADERS}) ++add_library(ubootenv ${libubootenv_SOURCES} ${include_HEADERS}) + SET_TARGET_PROPERTIES(ubootenv PROPERTIES SOVERSION ${SOVERSION}) + +-ADD_LIBRARY(ubootenv_static STATIC ${libubootenv_SOURCES} ${include_HEADERS}) + add_executable(fw_printenv fw_printenv.c) + add_executable(fw_setenv fw_setenv.c) + target_link_libraries(fw_printenv ubootenv z) +-- +2.7.4 + diff --git a/package/libubootenv/0001-uboot_env-fix-build-with-musl-libc.patch b/package/libubootenv/0001-uboot_env-fix-build-with-musl-libc.patch new file mode 100644 index 0000000..605b40a --- /dev/null +++ b/package/libubootenv/0001-uboot_env-fix-build-with-musl-libc.patch @@ -0,0 +1,31 @@ +From 113a4ea9ec48b9428b3abac21ecca7d8f11502fe Mon Sep 17 00:00:00 2001 +From: Pierre-Jean Texier +Date: Tue, 21 May 2019 21:32:27 +0200 +Subject: [libubootenv][PATCH 1/2] uboot_env: fix build with musl libc + +Fixes the following compile failure when building with musl: + + - http://autobuild.buildroot.net/results/206/206f1eba0dec39de1c02d760fa8f961d5a3879d0/ + +Signed-off-by: Pierre-Jean Texier +[Upstream status: http://patchwork.ozlabs.org/patch/1103009/] +--- + src/uboot_env.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/uboot_env.c b/src/uboot_env.c +index 4c298d1..a0f977c 100644 +--- a/src/uboot_env.c ++++ b/src/uboot_env.c +@@ -11,6 +11,8 @@ + * @brief This is the implementation of libubootenv library + * + */ ++ ++#define _GNU_SOURCE + + #include + #include +-- +2.7.4 + diff --git a/package/libubootenv/0002-uboot_env-fix-compilation-for-glibc-version-2.28.patch b/package/libubootenv/0002-uboot_env-fix-compilation-for-glibc-version-2.28.patch new file mode 100644 index 0000000..7801e43 --- /dev/null +++ b/package/libubootenv/0002-uboot_env-fix-compilation-for-glibc-version-2.28.patch @@ -0,0 +1,40 @@ +From fa991d153a73e312683b751e9f65d8df6ac61732 Mon Sep 17 00:00:00 2001 +From: Pierre-Jean Texier +Date: Tue, 21 May 2019 21:40:23 +0200 +Subject: [libubootenv][PATCH 2/2] uboot_env: fix compilation for glibc version + >= 2.28 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Starting with glibc 2.28, include file sys/stat.h will have a +definition for struct statx, in which case include file linux/stat.h should be +avoided, in order to prevent a duplicate definition. + +This commit fixes (if _GNU_SOURCE is defined): + +/usr/include/linux/stat.h:56:8: error: redefinition of ‘struct statx_timestamp’ + struct statx_timestamp { + ^~~~~~~~~~~~~~~ + +Signed-off-by: Pierre-Jean Texier +[Upstream status: http://patchwork.ozlabs.org/patch/1103010/] +--- + src/uboot_env.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/uboot_env.c b/src/uboot_env.c +index a0f977c..e8483bf 100644 +--- a/src/uboot_env.c ++++ b/src/uboot_env.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + +-- +2.7.4 +