From patchwork Sun Oct 21 12:21:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 987305 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=none (p=none dis=none) header.from=rockwellcollins.com 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 42dJfv6L9hz9s5c for ; Sun, 21 Oct 2018 23:21:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BA07C231E9; Sun, 21 Oct 2018 12:21:39 +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 noWESx12-YRr; Sun, 21 Oct 2018 12:21:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 619EE22E8C; Sun, 21 Oct 2018 12:21:37 +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 E03631BF38C for ; Sun, 21 Oct 2018 12:21:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DDD5A867C6 for ; Sun, 21 Oct 2018 12:21:35 +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 dgC3bEWlhYFP for ; Sun, 21 Oct 2018 12:21:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0389F86357 for ; Sun, 21 Oct 2018 12:21:34 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 21 Oct 2018 07:21:34 -0500 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by dtulimr01.rockwellcollins.com (Postfix) with ESMTP id E206160167; Sun, 21 Oct 2018 07:21:33 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Sun, 21 Oct 2018 07:21:35 -0500 Message-Id: <1540124495-63551-1-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v2] package/clang: default linker to the cross GNU 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: Valentin Korenblit MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" By default clang is assuming the system linker /usr/bin/ld. This patchset updates the default to point at the cross toolchain ld. Previously clang had been used on target only, this update is required for host clang/clang++ to be used as a frontend for cross-compiling. Example build command: output/host/bin/clang++ -mcpu=cortex-a53 \ --sysroot //output/staging/ \ -B //output/host/opt/ext-toolchain/ \ foobar.cc -o foobar Cc: Valentin Korenblit Reviewed-by: Romain Naour Signed-off-by: Matthew Weber --- Changes v1 -> v2 [Romain - Added example build command in commit description as example for an eventual wrapper - Moved setting of ld path option to be with other path assignments --- package/clang/clang.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/clang/clang.mk b/package/clang/clang.mk index 52e0b98..f9d4ae3 100644 --- a/package/clang/clang.mk +++ b/package/clang/clang.mk @@ -49,7 +49,8 @@ CLANG_CONF_OPTS += \ -DCLANG_INCLUDE_DOCS=OFF \ -DCLANG_INCLUDE_TESTS=OFF -HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config +HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config \ + -DCLANG_DEFAULT_LINKER=$(TARGET_LD) CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \ -DCLANG_TABLEGEN:FILEPATH=$(HOST_DIR)/bin/clang-tblgen \ -DLLVM_TABLEGEN_EXE:FILEPATH=$(HOST_DIR)/bin/llvm-tblgen