From patchwork Thu Feb 4 17:04:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 1436139 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) 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 4DWlKN0Qrfz9s1l for ; Fri, 5 Feb 2021 04:04:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A8AF280CF3; Thu, 4 Feb 2021 17:04:54 +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 kyA5_r6DCCLQ; Thu, 4 Feb 2021 17:04:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 14B3A8349B; Thu, 4 Feb 2021 17:04:54 +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 3DE5C1BF378 for ; Thu, 4 Feb 2021 17:04:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 394D086C76 for ; Thu, 4 Feb 2021 17:04:53 +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 ekdSCYyWt7qe for ; Thu, 4 Feb 2021 17:04:51 +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 CE1E086A94 for ; Thu, 4 Feb 2021 17:04:50 +0000 (UTC) X-Originating-IP: 78.113.208.92 Received: from localhost.localdomain (92.208.113.78.rev.sfr.net [78.113.208.92]) (Authenticated sender: kory.maincent@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 435AD40006 for ; Thu, 4 Feb 2021 17:04:46 +0000 (UTC) From: Kory Maincent To: buildroot@busybox.net Date: Thu, 4 Feb 2021 18:04:46 +0100 Message-Id: <20210204170446.15188-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH] boot/uboot: fix uboot build 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The make all command run the tools/makefile on the process. This makefile use "pkg-config" command to support static link. The issue is the use of pkg-config configured for crosscompiling to build binaries tools for host architecture. To fix it, I copied the behavior of QtWebengine by using a pkg-config executable preconfigured for host. Signed-off-by: Kory Maincent --- boot/uboot/host-pkg-config.in | 6 ++++++ boot/uboot/uboot.mk | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 boot/uboot/host-pkg-config.in diff --git a/boot/uboot/host-pkg-config.in b/boot/uboot/host-pkg-config.in new file mode 100644 index 0000000000..86a980648b --- /dev/null +++ b/boot/uboot/host-pkg-config.in @@ -0,0 +1,6 @@ +#!/bin/sh +PKG_CONFIG_SYSROOT_DIR="/" \ +PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \ +PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \ +PKG_CONFIG_LIBDIR="@HOST_DIR@/lib/pkgconfig:@HOST_DIR@/share/pkgconfig" \ +exec @HOST_DIR@/bin/pkgconf "$@" diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 2478a2a1e9..0bcc1ac9a9 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -302,11 +302,19 @@ endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY UBOOT_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_DTS_PATH)) +define UBOOT_CREATE_HOST_PKG_CONFIG + mkdir -p $(@D)/host-bin + sed s%@HOST_DIR@%$(HOST_DIR)%g $(UBOOT_PKGDIR)/host-pkg-config.in > $(@D)/host-bin/pkg-config + chmod +x $(@D)/host-bin/pkg-config +endef +UBOOT_PRE_CONFIGURE_HOOKS = UBOOT_CREATE_HOST_PKG_CONFIG +UBOOT_ENV = PATH=$(@D)/host-bin:$(BR_PATH) + define UBOOT_BUILD_CMDS $(if $(UBOOT_CUSTOM_DTS_PATH), cp -f $(UBOOT_CUSTOM_DTS_PATH) $(@D)/arch/$(UBOOT_ARCH)/dts/ ) - $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_OPTS) $(UBOOT_ENV) \ $(UBOOT_MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \ $(UBOOT_MAKE_TARGET) $(if $(BR2_TARGET_UBOOT_FORMAT_SD),