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@ "$@"