From patchwork Tue Feb 4 14:24:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1233367 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=mind.be Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=St36jOfx; 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 48Bn684sMjzB3xT for ; Wed, 5 Feb 2020 01:25:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E340D204C3; Tue, 4 Feb 2020 14:25:18 +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 2DIlZVF85kFS; Tue, 4 Feb 2020 14:25:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 23047203A2; Tue, 4 Feb 2020 14:25:17 +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 9B63B1BF3D8 for ; Tue, 4 Feb 2020 14:25:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 97706203A2 for ; Tue, 4 Feb 2020 14:25:16 +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 Up5JUXIckRZX for ; Tue, 4 Feb 2020 14:25:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by silver.osuosl.org (Postfix) with ESMTPS id 7DB4820349 for ; Tue, 4 Feb 2020 14:25:15 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id z3so23344746wru.3 for ; Tue, 04 Feb 2020 06:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ig+T28DvmtnCMg9piyUyGPRzXB0Jz7N5O7caeItVfkk=; b=St36jOfx8NqvtRGuuzLeZJkLyp3KykNRGepyoTYdskCrMKWn/qtMiACHyWNbq8tSl/ XKRUc51aT3kFRdTI+R84SUwCJg3huKzsxpSzR2Hh0qJ0oZ29fkp9tzNVqjTgTUl8IhHC ay1AhO1OVxXNgu0DzE85hBKlVi6r5ZnhEhpwUraPXZtUseoRt639n31Dq7aRCk6c8KiP hw+rKo4h8RAHAdLceZCb/bKc07HzyUDNNuYXdg+6saKZIf7yEMG5qUioy0fn+G77bnWO vN2FhaK/8uoQ0YlQqGFgi1yYHyJYCN/Yfoq2tbo9dXJ6hrqKheycOtoIQwcRjCUhimMk 4w3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ig+T28DvmtnCMg9piyUyGPRzXB0Jz7N5O7caeItVfkk=; b=fo4kBtpoB5PphlASq0o5Cr7kO2garZQUGEC7OsU+Q+EesZJtUIqLrDoxq+BcV03dFZ 2PvZyCHVbqe3iEBEF0zzbACIQV20SDpQPqckSabXj4Z4lHwbCdBNPk5TtoxC6FkXltYZ AP9FPJrt1nDSKmc8K67OQTZya0j/F8jWv1MsF2EgwKnuZyiG6Y23ZYy8m0ozkyAAEBik eJoULtGCuUBA67UgVBmAB484R4wt+H5OU1Klx2BaV1unSHX0bQA22fMFMAvzQ3038Pyc QdZEM6p4D+SDcnGPxgt9+1ujM7ouplsHyW0NYxjFExdM+xNZBuP0W/orP+PsL0ZgUBJl xXew== X-Gm-Message-State: APjAAAWgy3IfYrILwpWS2mmDPkYZ1XjDDIQ7QgT7Jj3HZzUaXV0S7pzV qoBnjEYHY2RnMGW1gQfijycEYEtUHKU= X-Google-Smtp-Source: APXvYqwNKE0osB34lkeaJPTbTunX+U8IoAp9IH2cugrBe30Vp4b1R/ymWz9CopA2C+Gm/EtjM2EFdQ== X-Received: by 2002:adf:cd0a:: with SMTP id w10mr22553861wrm.107.1580826313747; Tue, 04 Feb 2020 06:25:13 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:c6df:61c8:f82e:fd3c]) by smtp.gmail.com with ESMTPSA id z133sm4234615wmb.7.2020.02.04.06.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 06:25:13 -0800 (PST) From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Tue, 4 Feb 2020 15:24:52 +0100 Message-Id: <20200204142456.1537358-2-arnout@mind.be> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200204142456.1537358-1-arnout@mind.be> References: <20200204142456.1537358-1-arnout@mind.be> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/5] package/Makefile.in: add HOST_BIN_CROSS 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: Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Many packages make use of configuration scripts to find various paths (includes, libraries, etc.). In the best case, pkg-config is used, but there are dozen of other scripts as well. These scripts have to be configured or called differently depending on whether we're doing cross compilation (i.e. building a target package) or native compilation (i.e. host compilation). Currently, we use various ways to make sure the correct configure script with the correct settings is used - mostly by passing environment variables in the configuration step. To create more convergence and simplify our understanding of what is going on, let's make a separate directory for cross-compilation configuration scripts. This is particularly useful for meson, because meson makes an explicit difference between native and cross compilation, with a full configuration file for both. Define HOST_BIN_CROSS as a subdirectory of $(HOST_DIR)/$(GNU_TARGET_NAME). This makes it easy for the wrapper script to use a relative path to ../sysroot to find STAGING_DIR, which makes them relocatable. Note that we can't use $(HOST_DIR)/$(GNU_TARGET_NAME)/bin, because for an internal toolchain, gcc and binutils install the cross-executables there without target prefix. Putting that directory in PATH makes it impossible to do native compilation at all, because gcc will call 'as' and 'ld' from PATH, i.e. the cross-tools instead of the native tools. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/Makefile.in b/package/Makefile.in index 285e2837ef..c82e30069e 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -230,6 +230,9 @@ HOST_CFLAGS += $(HOST_CPPFLAGS) HOST_CXXFLAGS += $(HOST_CFLAGS) HOST_LDFLAGS += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib +# Location of scripts/wrappers for cross-compilation +HOST_BIN_CROSS = $(HOST_DIR)/$(GNU_TARGET_NAME)/cross-bin + # host-intltool should be executed with the system perl, so we save # the path to the system perl, before a host-perl built by Buildroot # might get installed into $(HOST_DIR)/bin and therefore appears @@ -241,7 +244,7 @@ export PERL=$(shell which perl) # finds this perl module by exporting the proper value for PERL5LIB. export PERL5LIB=$(HOST_DIR)/lib/perl -TARGET_MAKE_ENV = PATH=$(BR_PATH) +TARGET_MAKE_ENV = PATH=$(HOST_BIN_CROSS):$(BR_PATH) TARGET_CONFIGURE_OPTS = \ $(TARGET_MAKE_ENV) \