From patchwork Tue Jul 10 23:42:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Kogut X-Patchwork-Id: 942280 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iu5++SRT"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41QJdw6msvz9s2L for ; Wed, 11 Jul 2018 09:42:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 634018797E; Tue, 10 Jul 2018 23:42:24 +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 SOjZms1MpMEI; Tue, 10 Jul 2018 23:42:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 04522870FB; Tue, 10 Jul 2018 23:42:23 +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 A1BC41C1310 for ; Tue, 10 Jul 2018 23:42:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9F4838768A for ; Tue, 10 Jul 2018 23:42:21 +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 5mN3oZ8ZhOAE for ; Tue, 10 Jul 2018 23:42:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1647B870FB for ; Tue, 10 Jul 2018 23:42:21 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id r5-v6so2355372pgv.0 for ; Tue, 10 Jul 2018 16:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nKWdDtC2HQovM2nu4dEiFAX0N6Xx+bpA2mUNiaoYtYQ=; b=iu5++SRTPBySO+YyWUTD2tFOToB2/TVGq9cBIyp2VKd9YSa51H7HEYoN9VbzUlgeL1 l3MHJzcnsp1ZV3h1bu15BbEIPC0/3eP7LPrn1ojlUFnYC6VovcZXsUndbKNaCjiB6ULb JmTk4qLZKY2yc4VFlT+vcgv/MkMVoxjcncwbREuQoXj37ye7K8fpWWKXwBhIQ6WpUqXt FKMY+PmwkUDcxHTvedIhVsNoK6tIOHn54zj1r6dJgrLD6He/rRQXlvRa5vJhf3MSELcz ffXasgRwhJiBp/dB6TbzEYS1haanjEdZbVo+uWUmwfUJ2yNTGOEL338tXnBEkM+X2ByY fxpA== 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; bh=nKWdDtC2HQovM2nu4dEiFAX0N6Xx+bpA2mUNiaoYtYQ=; b=Uj+r/FxXmy6KtKWQggaI6AW7UVM5+7FDU4cVBCjjFUK6q3AEWdd4gvfp6812VX2/3H FgSLUgOgTRK11JsKedkUlltiEDVbv8UVSlxteKvUX10nebD4xOtHBaRBn4Ovc50ppbvA tjJwVqwvwn5hOGnKU70I8k44CQ+Xs5+z+WoVCUiniUYN5a67Wuw55QHhkSWPnakSnfEN ogeMJhpUgHko/bReWGcH9r5FjC3PT48HlEuXuoba0dG2J7cZskOW0Jx/7NLvX++g/8v4 8efKEBuYJjROlTlTYABpbZpv/Ehn05CKSDppbSji+qDVv0rlFpAM6E2YcHp6P53/JXjj TUMA== X-Gm-Message-State: APt69E0ZWc1MmkDQNB2mTUU6UY+/Zal8+zwsFYW+Z2W8PxrbMdF9Z3ZZ xU5w2K3Fy1gETXI/asfD3OzQQ6Lv0y0= X-Google-Smtp-Source: AAOMgpc7lcdg/VGLlkXBUdcxp0u+jbOqWKbbPgCXptLrXWWt0IpBXU67mALRDz8MSROsn/aPBXh1NQ== X-Received: by 2002:a63:24c:: with SMTP id 73-v6mr17939444pgc.252.1531266140337; Tue, 10 Jul 2018 16:42:20 -0700 (PDT) Received: from JAKWS.YakimaSteel.local ([162.251.69.147]) by smtp.gmail.com with ESMTPSA id b62-v6sm83147464pfm.97.2018.07.10.16.42.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 16:42:19 -0700 (PDT) From: Joseph Kogut To: buildroot@buildroot.org Date: Tue, 10 Jul 2018 16:42:10 -0700 Message-Id: <20180710234212.4297-3-joseph.kogut@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710234212.4297-1-joseph.kogut@gmail.com> References: <20180710234212.4297-1-joseph.kogut@gmail.com> Subject: [Buildroot] [PATCH v6 2/4] llvm: add config to build backend for host arch X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joseph Kogut , Valentin Korenblit , Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Joseph Kogut --- 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 7838ffc219..3725c2c81d 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -30,6 +30,7 @@ menu "Host utilities" source "package/jsmin/Config.in.host" source "package/lpc3250loader/Config.in.host" source "package/lttng-babeltrace/Config.in.host" + source "package/llvm/Config.in.host" source "package/mfgtools/Config.in.host" source "package/mkpasswd/Config.in.host" source "package/mtd/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 fb0ae4ce5c..31c31630ad 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -39,8 +39,9 @@ LLVM_CONF_OPTS += -DLLVM_BUILD_GLOBAL_ISEL=OFF 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. @@ -56,9 +57,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