From patchwork Wed Feb 19 23:37:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1241072 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=bootlin.com 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 48NDfy5Nzjz9sRG for ; Thu, 20 Feb 2020 10:38:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7462F20502; Wed, 19 Feb 2020 23:38:00 +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 AZLfi3HV+tEs; Wed, 19 Feb 2020 23:37:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3B78420781; Wed, 19 Feb 2020 23:37:59 +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 E64201BF239 for ; Wed, 19 Feb 2020 23:37:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DBDAE8493F for ; Wed, 19 Feb 2020 23:37: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 g3sFHj9KoxyM for ; Wed, 19 Feb 2020 23:37:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 02551846D3 for ; Wed, 19 Feb 2020 23:37:55 +0000 (UTC) X-Originating-IP: 173.221.118.3 Received: from localhost (173.221.118.3.nw.nuvox.net [173.221.118.3]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 9384740005; Wed, 19 Feb 2020 23:37:51 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Thu, 20 Feb 2020 00:37:47 +0100 Message-Id: <20200219233748.680423-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/brltty: use host pkg-config when building host tools 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: Fabrice Fontaine , Thomas Petazzoni , Mario Lang Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" brltty builds host tools which rely on the expat library, and pkg-config is used to detect the expat library. Since commit cd16e18584066d2817d3acb3822e173f9f23455e ("pkgconf: always keep system libs"), the wrapper script added --keep-system-libs, which adds a -L$(STAGING_DIR)/usr/lib to the pkg-config results instead of just -lexpat. So, previously, by chance, the pkg-config result for the target expat was "good enough" for the host expat as well. But now that -L$(STAGING_DIR)/usr/lib is added, it breaks the build in all sort of ways as obviously building host binaries with the library search path pointing to $(STAGING_DIR) is not a good idea. To fix that, this commit adjusts the brltty build system so that the PKG_CONFIG_FOR_BUILD variable is used when using pkg-config to build host binaries. Fixes: http://autobuild.buildroot.net/results/5a64dfb845389882c366b6c91aaf5868c090a802/ Many thanks to the initial work from Fabrice Fontaine at http://patchwork.ozlabs.org/patch/1238163/ which provided an initial starting point for this investigation. Signed-off-by: Thomas Petazzoni --- ...ss-PKG_CONFIG_FOR_BUILD-to-the-nativ.patch | 38 +++++++++++++++++++ package/brltty/brltty.mk | 3 ++ 2 files changed, 41 insertions(+) create mode 100644 package/brltty/0003-mk4build-also-pass-PKG_CONFIG_FOR_BUILD-to-the-nativ.patch diff --git a/package/brltty/0003-mk4build-also-pass-PKG_CONFIG_FOR_BUILD-to-the-nativ.patch b/package/brltty/0003-mk4build-also-pass-PKG_CONFIG_FOR_BUILD-to-the-nativ.patch new file mode 100644 index 0000000000..5839f78f3f --- /dev/null +++ b/package/brltty/0003-mk4build-also-pass-PKG_CONFIG_FOR_BUILD-to-the-nativ.patch @@ -0,0 +1,38 @@ +From 568e0d6070021a9b805ba1fe1543e4b43a073413 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Thu, 20 Feb 2020 00:23:35 +0100 +Subject: [PATCH] mk4build: also pass PKG_CONFIG_FOR_BUILD to the native + configure + +In commit 0414ad2b4e8978a14343d920a5a1f11da892eaf3, mk4build was +modified to pass a number of *_FOR_BUILD variables down to the +configure script called for building the native tools. + +However, this configure script also uses the pkg-config tool, and the +pkg-config to use for the native build and the cross build may be +different, so let's also pass PKG_CONFIG_FOR_BUILD down to the +sub-configure, as PKG_CONFIG, following the same logic as the other +variables. + +Signed-off-by: Thomas Petazzoni +Upstream: https://github.com/brltty/brltty/pull/248 +[Upstream patch is different, due to other upstream changes.] +--- + mk4build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mk4build b/mk4build +index 3c64963b7..ad88ee69c 100755 +--- a/mk4build ++++ b/mk4build +@@ -73,6 +73,7 @@ then + CXXFLAGS=${CXXFLAGS_FOR_BUILD} \ + LDFLAGS=${LDFLAGS_FOR_BUILD} \ + LDLIBS=${LDLIBS_FOR_BUILD} \ ++ PKG_CONFIG=${PKG_CONFIG_FOR_BUILD} \ + "${sourceRoot}/configure" \ + --disable-api \ + --disable-gpm \ +-- +2.24.1 + diff --git a/package/brltty/brltty.mk b/package/brltty/brltty.mk index 11b8c0d35f..acc172fab0 100644 --- a/package/brltty/brltty.mk +++ b/package/brltty/brltty.mk @@ -15,6 +15,9 @@ BRLTTY_LICENSE_FILES = LICENSE-LGPL README BRLTTY_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-autoconf host-pkgconf \ $(if $(BR2_PACKAGE_AT_SPI2_CORE),at-spi2-core) +BRLTTY_CONF_ENV = \ + PKG_CONFIG_FOR_BUILD=$(HOST_DIR)/bin/pkgconf + BRLTTY_CONF_OPTS = \ --disable-java-bindings \ --disable-lisp-bindings \