From patchwork Tue Oct 1 12:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preston X-Patchwork-Id: 1169885 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=fail (p=none dis=none) header.from=codethink.co.uk 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 46jJn21xBMz9s7T for ; Tue, 1 Oct 2019 22:41:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5059D20491; Tue, 1 Oct 2019 12:41:54 +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 hTH5-+6YRbIe; Tue, 1 Oct 2019 12:41:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 508F620524; Tue, 1 Oct 2019 12:41:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 535501BF348 for ; Tue, 1 Oct 2019 12:41:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 50CDE83F07 for ; Tue, 1 Oct 2019 12:41:41 +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 uF2InLfheTnJ for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 614A785D54 for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iFHTF-0005HX-Qw; Tue, 01 Oct 2019 13:41:37 +0100 From: Thomas Preston To: buildroot@buildroot.org, michael.drake@codethink.co.uk Date: Tue, 1 Oct 2019 13:41:30 +0100 Message-Id: <20191001124132.107700-1-thomas.preston@codethink.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/3] pkgconf: Split pkgconf command into multi-line 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: Thomas Preston Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The pkgconf command is a long and confusing line, which is about to get longer. Split it up into logical stages so that it is easier to visualise changes. Signed-off-by: Thomas Preston --- package/pkgconf/pkg-config.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 99c0add8fb..8795f64b68 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -2,4 +2,7 @@ PKGCONFDIR=$(dirname $0) DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ -PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@" + +PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \ + PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \ + exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@" From patchwork Tue Oct 1 12:41:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preston X-Patchwork-Id: 1169884 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=codethink.co.uk Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jJms27JJz9s7T for ; Tue, 1 Oct 2019 22:41:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id BE7D887874; Tue, 1 Oct 2019 12:41:44 +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 RjEylLqO6RDF; Tue, 1 Oct 2019 12:41:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 034698777B; Tue, 1 Oct 2019 12:41:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D63411BF956 for ; Tue, 1 Oct 2019 12:41:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D355285C37 for ; Tue, 1 Oct 2019 12:41:41 +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 pSGqTTtGFinx for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5F20F85D40 for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iFHTG-0005HX-3O; Tue, 01 Oct 2019 13:41:38 +0100 From: Thomas Preston To: buildroot@buildroot.org, michael.drake@codethink.co.uk Date: Tue, 1 Oct 2019 13:41:31 +0100 Message-Id: <20191001124132.107700-2-thomas.preston@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001124132.107700-1-thomas.preston@codethink.co.uk> References: <20191001124132.107700-1-thomas.preston@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/3] pkgconf: Add pkgconf system lib and include path 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: Thomas Preston Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Buildroot does not reconfigure pkgconf system library and system include dirs to STAGING_DIR. This means that pkgconf prints the sysroot system library and system include dirs instead of letting the compiler handle the logical sysroot. This breaks the -isystem compiler flag, as it increases the priority of the system library and system include directories. For example: $ output/host/bin/pkg-config --cflags glib-2.0 -Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0 -Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/lib/glib-2.0/include -Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include A header in `.../sysroot/usr/include` will be included before a header in any directory specified with -isystem flags. Specifically, this breaks the Chromium build system, which expects a C++ math.h in a bundled LLVM C++ library, and gets a GNU C math.h instead. Fix this by telling pkgconf about the sysroot's system library and system include directories, so that it doesn't accidentally print them. Signed-off-by: Thomas Preston --- package/pkgconf/pkg-config.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 8795f64b68..894069c492 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,8 +1,12 @@ #!/bin/sh PKGCONFDIR=$(dirname $0) +DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib +DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/include DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ -PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \ +PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH}} \ + PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH}} \ + PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \ PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \ exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@" From patchwork Tue Oct 1 12:41:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preston X-Patchwork-Id: 1169886 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=fail (p=none dis=none) header.from=codethink.co.uk 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 46jJn41j1mz9s7T for ; Tue, 1 Oct 2019 22:42:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8E3CF83F07; Tue, 1 Oct 2019 12:41:58 +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 JMjWfp1H_S0Q; Tue, 1 Oct 2019 12:41:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EFD8A85C37; Tue, 1 Oct 2019 12:41:57 +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 C80031BF348 for ; Tue, 1 Oct 2019 12:41:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B1A8020533 for ; Tue, 1 Oct 2019 12:41:56 +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 HZyzt2qQ5ODS for ; Tue, 1 Oct 2019 12:41:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) by silver.osuosl.org (Postfix) with ESMTPS id B17A8203DE for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iFHTG-0005HX-Cp; Tue, 01 Oct 2019 13:41:38 +0100 From: Thomas Preston To: buildroot@buildroot.org, michael.drake@codethink.co.uk Date: Tue, 1 Oct 2019 13:41:32 +0100 Message-Id: <20191001124132.107700-3-thomas.preston@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001124132.107700-1-thomas.preston@codethink.co.uk> References: <20191001124132.107700-1-thomas.preston@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] pkgconf: Configure using pkgconf-personality 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: Thomas Preston Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The correct way to configure pkgconf when cross-compiling is to use pkgconf-personality, rather than using environment variables. The personality is selected with a symbolic link mechanism, which we now use in the pkg-config wrapper script. Signed-off-by: Thomas Preston --- package/pkgconf/pkg-config.in | 11 +---------- package/pkgconf/pkgconf.mk | 12 +++++++++++- package/pkgconf/target.personality | 5 +++++ 3 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 package/pkgconf/target.personality diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 894069c492..51db4d87e1 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,12 +1,3 @@ #!/bin/sh PKGCONFDIR=$(dirname $0) -DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib -DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/include -DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig -DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ - -PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH}} \ - PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH}} \ - PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \ - PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \ - exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@" +exec ${PKGCONFDIR}/@GNU_TARGET_NAME@-pkg-config @STATIC@ "$@" diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk index 1851ecfca4..66bc61d797 100644 --- a/package/pkgconf/pkgconf.mk +++ b/package/pkgconf/pkgconf.mk @@ -11,15 +11,25 @@ PKGCONF_LICENSE = pkgconf license PKGCONF_LICENSE_FILES = COPYING PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/bin/pkg-config +PKG_CONFIG_HOST_PERSONALITYD = $(HOST_DIR)/usr/share/pkgconfig/personality.d define PKGCONF_LINK_PKGCONFIG ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config endef define HOST_PKGCONF_INSTALL_WRAPPER + $(INSTALL) -m 0775 -D package/pkgconf/target.personality \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + $(SED) 's,@STAGING_DIR@,$(STAGING_DIR),g' \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + $(SED) 's,@GNU_TARGET_NAME@,$(GNU_TARGET_NAME),g' \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + ln -sf $(HOST_DIR)/bin/pkgconf \ + $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-pkg-config + $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/bin/pkg-config - $(SED) 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),g' \ + $(SED) 's,@GNU_TARGET_NAME@,$(GNU_TARGET_NAME),g' \ $(HOST_DIR)/bin/pkg-config endef diff --git a/package/pkgconf/target.personality b/package/pkgconf/target.personality new file mode 100644 index 0000000000..cee4d236c4 --- /dev/null +++ b/package/pkgconf/target.personality @@ -0,0 +1,5 @@ +Triplet: @GNU_TARGET_NAME@ +SysrootDir: @STAGING_DIR@ +DefaultSearchPaths: @STAGING_DIR@/usr/lib/pkgconfig:@STAGING_DIR@/usr/share/pkgconfig +SystemIncludePaths: @STAGING_DIR@/usr/include +SystemLibraryPaths: @STAGING_DIR@/usr/lib