From patchwork Fri Dec 28 13:25:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1019168 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=none (p=none dis=none) header.from=bootlin.com 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 43R6t32Sbvz9s2P for ; Sat, 29 Dec 2018 00:26:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 67FB78608F; Fri, 28 Dec 2018 13:26:15 +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 1RQZOSTaIYqm; Fri, 28 Dec 2018 13:26:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 744CC85978; Fri, 28 Dec 2018 13:26:12 +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 D96CB1C0F45 for ; Fri, 28 Dec 2018 13:26:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D690D836F1 for ; Fri, 28 Dec 2018 13:26:11 +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 QNXFPaGbz94O for ; Fri, 28 Dec 2018 13:26:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 7727082953 for ; Fri, 28 Dec 2018 13:26:10 +0000 (UTC) Received: by mail.bootlin.com (Postfix, from userid 110) id E90CE20A02; Fri, 28 Dec 2018 14:26:08 +0100 (CET) Received: from localhost (mat33-2-88-189-187-82.fbx.proxad.net [88.189.187.82]) by mail.bootlin.com (Postfix) with ESMTPSA id 609DC2070E; Fri, 28 Dec 2018 14:25:54 +0100 (CET) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Fri, 28 Dec 2018 14:25:50 +0100 Message-Id: <20181228132551.29819-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/cargo: pass appropriate library path to the linker 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: Eric Le Bihan , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When linking the host cargo binary, the linker should be told to find libraries in $(HOST_DIR)/lib, otherwise it will not work libraries such as libhttp_parser. This was found with per-package directory support, where the build failed with: = note: /usr/bin/ld: cannot find -lhttp_parser collect2: error: ld returned 1 exit status In order to fix this, instead of passing -L$(HOST_DIR)/lib during the build of Cargo, we make sure all flags in $(HOST_LDFLAGS) are passed. Signed-off-by: Thomas Petazzoni --- package/cargo/cargo.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/cargo/cargo.mk b/package/cargo/cargo.mk index 1b1053ba41..a387281b4c 100644 --- a/package/cargo/cargo.mk +++ b/package/cargo/cargo.mk @@ -70,7 +70,7 @@ HOST_CARGO_SNAP_OPTS = \ $(if $(VERBOSE),--verbose) HOST_CARGO_ENV = \ - RUSTFLAGS="-Clink-arg=-Wl,-rpath,$(HOST_DIR)/lib" \ + RUSTFLAGS="$(addprefix -Clink-arg=,$(HOST_LDFLAGS))" \ CARGO_HOME=$(HOST_CARGO_HOME) define HOST_CARGO_BUILD_CMDS