From patchwork Mon Jun 10 21:20:22 2019 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: 1113339 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks 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="oXKCpGjx"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45N5dn4Dyqz9sND for ; Tue, 11 Jun 2019 07:20:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E2D3020453; Mon, 10 Jun 2019 21:20:42 +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 V8PwvffptryR; Mon, 10 Jun 2019 21:20:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E15F220454; Mon, 10 Jun 2019 21:20:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D7C7D1BF57C for ; Mon, 10 Jun 2019 21:20:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D09CF8759E for ; Mon, 10 Jun 2019 21:20:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XCTs73Lz3ILA for ; Mon, 10 Jun 2019 21:20:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6906B87447 for ; Mon, 10 Jun 2019 21:20:33 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 5CA9716005D for ; Mon, 10 Jun 2019 23:20:30 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 45N5dT49Qgz6tmG for ; Mon, 10 Jun 2019 23:20:29 +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= 1560201628; x=1560806429; bh=/MB2dqS+ubGOK5Av4RMgTiXQHSl/0ePGbMy dG4Cyx8w=; b=oXKCpGjxKYdGIPxnVpTjMKsZQGOC6ZLQLJLv0Xh8pHljCZXzn4m 1nqa7o//7+LrH45iLP1B/bkQBaRJV7z53uFC6ABp6jjqei2fMIIPMicR1msZAsJN CbA17MxRT5zG759zCbkhj7OY+hkM44hxStHnzkVJ+HFT2qweaZUC8Oj6rhxE82kE ERNFhIYyPAVB7+qzkaUnAuy+0cnYybUCQuQkdbatnm9f7LFMDgktYZxtrxlGQ5sE /CAI6RlnJyCjPoWdsabmD+zCKlZ64TaOBnX5CpUnLwtBcVLvEswVg0MWzPDGHL7M zEjg46bIiISheM6S7K8MGreShvXWpbtgBQg== 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 Q0sggkSbcwxv; Mon, 10 Jun 2019 23:20:28 +0200 (CEST) Received: from nzxt.fritz.box (port-92-193-131-223.dynamic.qsc.de [92.193.131.223]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Mon, 10 Jun 2019 23:20:28 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Mon, 10 Jun 2019 23:20:22 +0200 Message-Id: <20190610212023.9483-2-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190610212023.9483-1-joerg.krause@embedded.rocks> References: <20190610212023.9483-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] package/taglib: add upstream patch to fix taglib-config 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The current taglib-config program does not work when cross-compiling as it only returns paths to the host, which breaks building programs which link against taglib. For example gerbera uses `taglib-config` and it fails with: ``` [..] -- Found TagLib: -L/usr/lib -ltag [..] arm-linux-gnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib' ``` Before the patch the output of `taglib-config` is: ``` $ ./output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/taglib-config --libs -L/usr/lib -ltag ``` Add a patch from upstream which fixes taglib-config. After applying the fix, the pkg-config file is correct: ``` $ ./output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/taglib-config --libs -L/home/joerg/Development/git/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -ltag ``` Signed-off-by: Jörg Krause --- ...-config-file-for-cross-compiling-906.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 package/taglib/0001-fix-taglib-config-file-for-cross-compiling-906.patch diff --git a/package/taglib/0001-fix-taglib-config-file-for-cross-compiling-906.patch b/package/taglib/0001-fix-taglib-config-file-for-cross-compiling-906.patch new file mode 100644 index 0000000000..2c6ebd74db --- /dev/null +++ b/package/taglib/0001-fix-taglib-config-file-for-cross-compiling-906.patch @@ -0,0 +1,66 @@ +From 7470f92a67375d00e53b3785a88fa7b26ad6f1da Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Fri, 17 May 2019 13:13:35 +0200 +Subject: [PATCH] fix taglib-config file for cross compiling (#906) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The current taglib-config program does not work for cross-compiling as it only +returns the paths to the host, which breaks building programs which uses +`taglib-config` to link against taglib. + +Fix this by passing sysroot to the `prefix` and `exec_prefix` fields. + +Backported from: 7470f92a67375d00e53b3785a88fa7b26ad6f1da + +Signed-off-by: Jörg Krause +--- + CMakeLists.txt | 2 +- + taglib-config.cmake | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2de06324..1a0302c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,7 +105,7 @@ math(EXPR TAGLIB_SOVERSION_PATCH "${TAGLIB_SOVERSION_REVISION}") + include(ConfigureChecks.cmake) + + if(NOT WIN32) +- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/taglib-config") ++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/taglib-config" @ONLY) + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/taglib-config" DESTINATION "${BIN_INSTALL_DIR}") + endif() + +diff --git a/taglib-config.cmake b/taglib-config.cmake +index 2bc2811a..96ef6883 100644 +--- a/taglib-config.cmake ++++ b/taglib-config.cmake +@@ -14,10 +14,10 @@ EOH + exit 1; + } + +-prefix=${CMAKE_INSTALL_PREFIX} +-exec_prefix=${CMAKE_INSTALL_PREFIX} +-libdir=${LIB_INSTALL_DIR} +-includedir=${INCLUDE_INSTALL_DIR} ++prefix=@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@ ++exec_prefix=@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@ ++libdir=${exec_prefix}/lib ++includedir=${prefix}/include + + flags="" + +@@ -35,7 +35,7 @@ do + flags="$flags -I$includedir/taglib" + ;; + --version) +- echo ${TAGLIB_LIB_VERSION_STRING} ++ echo @TAGLIB_LIB_VERSION_STRING@ + ;; + --prefix) + echo $prefix +-- +2.22.0 + From patchwork Mon Jun 10 21:20:23 2019 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: 1113338 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks 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="M4xbTQEh"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45N5dk5dYXz9sNp for ; Tue, 11 Jun 2019 07:20:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7974784D5E; Mon, 10 Jun 2019 21:20:38 +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 0ot6Dr9toFS7; Mon, 10 Jun 2019 21:20:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C5F4084D62; Mon, 10 Jun 2019 21:20:37 +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 136FD1BF57C for ; Mon, 10 Jun 2019 21:20:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 10AF7857D0 for ; Mon, 10 Jun 2019 21:20: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 lR2tmND4OhTA for ; Mon, 10 Jun 2019 21:20:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by whitealder.osuosl.org (Postfix) with ESMTPS id C0968855B4 for ; Mon, 10 Jun 2019 21:20:33 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 84FDB160061 for ; Mon, 10 Jun 2019 23:20:30 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 45N5dV0g6Jz6tmG for ; Mon, 10 Jun 2019 23:20:30 +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= 1560201629; x=1560806430; bh=+khBKcXms/jhhjLTYYm9naDHaeXEn00TNPX dgiXO/Kw=; b=M4xbTQEhWAKJAbFUpQ+ImPAnIdz8OQoZ5N2jmj+RHqonSR15Osw pt0hFAyHNRXeZj8IEYIYO1ACWnxp311N1dqhHw4cLusJZ2I8mJUWK1xEgDsdRrz2 dmksww/bw0U0yV0+zQFV8LkGlywmLzMgSxpCHBRgS7GallHe3ieg2YPr7n098KfJ lI357LYI9vOlSwq/Ypmk78uC3t210M8uAAqYqdPcdcl8X4yEqBm7XF7tHhkref/p BMHzJPP6scyadDOfO3k5Os41AnAGBHEhZZRJZWW4l8Q87ycSsYtD6G998B3GhAGs +CIdDG9aaodNNqwgCD9supd7XDQ0GEccJLg== 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 PMFex9lSQZi8; Mon, 10 Jun 2019 23:20:29 +0200 (CEST) Received: from nzxt.fritz.box (port-92-193-131-223.dynamic.qsc.de [92.193.131.223]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Mon, 10 Jun 2019 23:20:28 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Mon, 10 Jun 2019 23:20:23 +0200 Message-Id: <20190610212023.9483-3-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190610212023.9483-1-joerg.krause@embedded.rocks> References: <20190610212023.9483-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/gerbera: add upstream patch to fix find_program with taglib-config 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add an from from upstream to fix linking Gerbera with taglib. The patch fixes the following issue: When cross-compiling CMakes `find_program()` will search for binaries on the host. This is typically correct, e.g. when search for compilers or shells. When cross-compiling, searching for `taglib-config` using `find_program` should not find the binary on the host, instead it should find the binary in the sysroot directory, as the host `taglib-config` will output the wrong host paths and libs, whereas the sysroot `taglib-config` will output the correct sysroot paths and libs. Therefore, use the `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM` variable when cross-compiling. This variable controls whether the `CMAKE_FIND_ROOT_PATH` and `CMAKE_SYSROOT` are used by find_program(). Signed-off-by: Jörg Krause --- ...m-taglib-config-when-cross-compiling.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 package/gerbera/0002-Fix-find_program-taglib-config-when-cross-compiling.patch diff --git a/package/gerbera/0002-Fix-find_program-taglib-config-when-cross-compiling.patch b/package/gerbera/0002-Fix-find_program-taglib-config-when-cross-compiling.patch new file mode 100644 index 0000000000..d5cc908e22 --- /dev/null +++ b/package/gerbera/0002-Fix-find_program-taglib-config-when-cross-compiling.patch @@ -0,0 +1,46 @@ +From 0f78b883f02651bd15a96a7294e01f94b28c20f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Mon, 13 May 2019 13:42:14 +0200 +Subject: [PATCH] Fix find_program taglib-config when cross-compiling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When cross-compiling Gerbera CMakes `find_program()` will search for +binaries on the host. This is typically correct, e.g. when search for +compilers or shells. + +When cross-compiling searching for `taglib-config` should not find the +binary on the host, instead it should find the binary in the sysroot +directory, as the host `taglib-config` will output the wrong host paths +and libs, whereas the sysroot `taglib-config` will output the correct sysroot +paths and libs. + +Therefore, use the `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM` variable when +cross-compiling. This variable controls whether the `CMAKE_FIND_ROOT_PATH` +and `CMAKE_SYSROOT` are used by find_program(). + +Backported from: 0f78b883f02651bd15a96a7294e01f94b28c20f8 + +Signed-off-by: Jörg Krause +--- + cmake/FindTaglib.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/FindTaglib.cmake b/cmake/FindTaglib.cmake +index 46a20ff2..7135d766 100644 +--- a/cmake/FindTaglib.cmake ++++ b/cmake/FindTaglib.cmake +@@ -19,6 +19,9 @@ ELSE() + endif(NOT TAGLIB_MIN_VERSION) + + if(NOT WIN32) ++ if (CMAKE_CROSSCOMPILING) ++ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) ++ endif(CMAKE_CROSSCOMPILING) + find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS + ${BIN_INSTALL_DIR} + ) +-- +2.22.0 +