From patchwork Thu Dec 5 17:14:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Drake X-Patchwork-Id: 1204740 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.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 47TNGR2xJvz9sP3 for ; Fri, 6 Dec 2019 04:37:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E7D3A88C0A; Thu, 5 Dec 2019 17:37:49 +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 gfzIfLxq+z8X; Thu, 5 Dec 2019 17:37:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 4BBDA88C39; Thu, 5 Dec 2019 17:37:49 +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 82BF21BF5AA for ; Thu, 5 Dec 2019 17:37:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7FF4B8655C for ; Thu, 5 Dec 2019 17:37:47 +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 t7PSTqd87dZ9 for ; Thu, 5 Dec 2019 17:37:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from imap2.colo.codethink.co.uk (imap2.colo.codethink.co.uk [78.40.148.184]) by fraxinus.osuosl.org (Postfix) with ESMTPS id EF6BC86160 for ; Thu, 5 Dec 2019 17:37:46 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap2.colo.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1icuiu-0007Yj-3P; Thu, 05 Dec 2019 17:15:28 +0000 From: Michael Drake To: buildroot@busybox.net Date: Thu, 5 Dec 2019 17:14:53 +0000 Message-Id: <20191205171517.96639-7-michael.drake@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191205171517.96639-1-michael.drake@codethink.co.uk> References: <20191205171517.96639-1-michael.drake@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v1 06/30] package/llvm: add config to build backend for host arch 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: Joseph Kogut , Michael Drake , Thomas Preston Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Joseph Kogut When cross-compiling for a different architecture to the host, LLVM only has target architecture support. This change adds support for compiling for the host architecture as well. Signed-off-by: Joseph Kogut Signed-off-by: Michael Drake Signed-off-by: Thomas Preston --- package/llvm/Config.in | 6 ++++++ package/llvm/llvm.mk | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package/llvm/Config.in b/package/llvm/Config.in index 1d21d879da..ae96d30a64 100644 --- a/package/llvm/Config.in +++ b/package/llvm/Config.in @@ -28,6 +28,12 @@ config BR2_PACKAGE_LLVM if BR2_PACKAGE_LLVM +config BR2_PACKAGE_HOST_LLVM_HOST_ARCH + string + default "X86" if BR2_HOSTARCH = "x86" || BR2_HOSTARCH = "x86_64" + default "AArch64" if BR2_HOSTARCH="aarch64" + default "ARM" if BR2_HOSTARCH = "arm" + config BR2_PACKAGE_LLVM_AMDGPU bool "AMDGPU backend" help diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 2b2bcf336e..300ac3e300 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -42,7 +42,10 @@ LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH)) # Build backend for target architecture. This include backends like AMDGPU. LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) -HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" +HOST_LLVM_TARGETS_TO_BUILD = \ + $(LLVM_TARGETS_TO_BUILD) \ + $(call qstrip,$(BR2_PACKAGE_HOST_LLVM_HOST_ARCH)) +HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(HOST_LLVM_TARGETS_TO_BUILD))" LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" # LLVM target to use for native code generation. This is required for JIT generation. @@ -58,6 +61,7 @@ LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH) # output only $(LLVM_TARGET_ARCH) if not, and mesa3d won't build as # it thinks AMDGPU backend is not installed on the target. ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y) +HOST_LLVM_TARGETS_TO_BUILD += AMDGPU LLVM_TARGETS_TO_BUILD += AMDGPU endif