From patchwork Thu Oct 17 15:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Drake X-Patchwork-Id: 1178743 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=fail (p=none dis=none) header.from=codethink.co.uk 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 46vCn61DChz9sPx for ; Fri, 18 Oct 2019 02:30:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5F34F24B78; Thu, 17 Oct 2019 15:30:12 +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 op25gsVOtH-9; Thu, 17 Oct 2019 15:30:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0641024BEA; Thu, 17 Oct 2019 15:30:05 +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 51E6A1BF9BD for ; Thu, 17 Oct 2019 15:29:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4F23286901 for ; Thu, 17 Oct 2019 15:29:41 +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 sexk1BbehBBD for ; Thu, 17 Oct 2019 15:29:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) by fraxinus.osuosl.org (Postfix) with ESMTPS id EF61E8699B for ; Thu, 17 Oct 2019 15:29:39 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iL7ic-0002Zy-2B; Thu, 17 Oct 2019 16:29:38 +0100 From: Michael Drake To: buildroot@buildroot.org Date: Thu, 17 Oct 2019 16:29:04 +0100 Message-Id: <20191017152929.49153-6-michael.drake@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017152929.49153-1-michael.drake@codethink.co.uk> References: <20191017152929.49153-1-michael.drake@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [RFC PATCH v2 05/30] 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 Signed-off-by: Joseph Kogut Signed-off-by: Michael Drake Signed-off-by: Thomas Preston --- package/Config.in.host | 1 + package/llvm/Config.in.host | 18 ++++++++++++++++++ package/llvm/llvm.mk | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 package/llvm/Config.in.host diff --git a/package/Config.in.host b/package/Config.in.host index 1501889b72..3122f5abca 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -34,6 +34,7 @@ menu "Host utilities" source "package/jq/Config.in.host" source "package/jsmin/Config.in.host" source "package/libp11/Config.in.host" + source "package/llvm/Config.in.host" source "package/lpc3250loader/Config.in.host" source "package/lttng-babeltrace/Config.in.host" source "package/mender-artifact/Config.in.host" diff --git a/package/llvm/Config.in.host b/package/llvm/Config.in.host new file mode 100644 index 0000000000..4d73fb8c75 --- /dev/null +++ b/package/llvm/Config.in.host @@ -0,0 +1,18 @@ +config BR2_PACKAGE_HOST_LLVM + bool "host llvm" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on BR2_HOST_GCC_AT_LEAST_4_8 + help + The LLVM Project is a collection of modular and reusable + compiler and toolchain technologies. + + http://llvm.org + +config BR2_PACKAGE_HOST_LLVM_HOST_ARCH + string + default "AArch64" if BR2_HOSTARCH="aarch64" + default "X86" if BR2_HOSTARCH = "x86" || BR2_HOSTARCH = "x86_64" + default "ARM" if BR2_HOSTARCH = "arm" + +config BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH + bool diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 3c62285188..5c413064c0 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -41,8 +41,9 @@ HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH)) # Build backend for target architecture. This include backends like AMDGPU. +HOST_LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) -HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" +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,9 +59,15 @@ 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 +# Build backend for host architecture +ifeq ($(BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH),y) +HOST_LLVM_TARGETS_TO_BUILD += $(call qstrip,$(BR2_PACKAGE_HOST_LLVM_HOST_ARCH)) +endif + # Use native llvm-tblgen from host-llvm (needed for cross-compilation) LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen