From patchwork Thu Jun 14 22:48:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Kogut X-Patchwork-Id: 929734 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="Cf+HwuQr"; 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 416JhC54qyz9s3C for ; Fri, 15 Jun 2018 08:48:59 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 135F389723; Thu, 14 Jun 2018 22:48:57 +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 uEui4jp9kt0n; Thu, 14 Jun 2018 22:48:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 5EBD789727; Thu, 14 Jun 2018 22:48:51 +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 E1EA31C121B for ; Thu, 14 Jun 2018 22:48:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EBB4488748 for ; Thu, 14 Jun 2018 22:48: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 FlqjpseFZJMa for ; Thu, 14 Jun 2018 22:48:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 37C1E8873C for ; Thu, 14 Jun 2018 22:48:47 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id c10-v6so3560935pgu.9 for ; Thu, 14 Jun 2018 15:48:47 -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=wjfShoHDGqGzcjnulZxkm1l55hKreEUxqXKFisEkAb8=; b=Cf+HwuQrnCzm/OyKUrb9ihP/WAHVaLBOA+A8LLhyKXfE/fGY8kAkJQXd50fbUCtznv Sy4ZyBvZMuM5agkqNyqoB6+Hp1SiQrol+01cbXY/WIaC/iKyF+rIAD1A58DzeFvcbbhD z1GFzCFxmsJACJvTEgQGo3heozswPAAi5pyQ40lAmHyM5RZLQ5H3rjZxxNJfafXEQGCw obFSrB4Ag3BCyZSL/sLk7VDDi8qNVy7TkFv5Q9ZjjeA3T1IM3LtezzZblzG0B7l67972 lQ1hKKzQgoEUrZt5aPlrxhRi9FEgWmOomWgyWlc/Yo2eByvWNvhJhu+crJAAzyhDJMDf nvQw== 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=wjfShoHDGqGzcjnulZxkm1l55hKreEUxqXKFisEkAb8=; b=nrv7ewUcJX02/Itp6CF67X2EUaC4FGg2SJcJzZU4lSS6xNY8V64HfDrX6FJYzxhz7w KankQGlF3K4d/smol8nR60QPexvqOq8wjMNf8ix1zv3yQaFVts0ZVREI6Tlt/Bka9Lvs cY0ZiNsL8dac/bwKeeQ5vBUCJorAHxvwqgFNE6cxRgmkVYmDWx2A/o2OJuYaf3e0dk8p 7xZI+8k1UQoWyuGuxcpEoBYY1Gm8UaOotgLcFSrhEbvnuPQ10kZS2P/UDh86SA/i2r9L YDJ/jxQEeERE65AezyYh+3y0LEOOKiIkNRLRSKPuP02aqWbeCMaP+gUNERykMeoS24Bx y56w== X-Gm-Message-State: APt69E3EXKFDK/5L8jTouDIxA0zIkePpVAVIvjRXwGsxxustAyJ5Xgxl XaiJSYLL2mpfGygBUAuWXuvqvaC8 X-Google-Smtp-Source: ADUXVKIjTbnBe84ETd2akwXm/tNNSGQaFGiX8YCd1EMS6J1xNjoDGqDMyUBBhMw7CNoxxTi/JVQtew== X-Received: by 2002:a62:9652:: with SMTP id c79-v6mr11496809pfe.114.1529016526483; Thu, 14 Jun 2018 15:48:46 -0700 (PDT) Received: from JAKWS.YakimaSteel.local ([162.251.69.147]) by smtp.gmail.com with ESMTPSA id s2-v6sm11224905pfb.127.2018.06.14.15.48.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 15:48:45 -0700 (PDT) From: Joseph Kogut To: buildroot@buildroot.org Date: Thu, 14 Jun 2018 15:48:16 -0700 Message-Id: <20180614224820.27126-6-joseph.kogut@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180614224820.27126-1-joseph.kogut@gmail.com> References: <20180610205417.13963-1-joseph.kogut@gmail.com> <20180614224820.27126-1-joseph.kogut@gmail.com> Subject: [Buildroot] [RFC PATCH v4 5/9] 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: Valentin Korenblit , Joseph Kogut , Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Joseph Kogut --- package/llvm/Config.in | 11 +++++++++++ package/llvm/llvm.mk | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package/llvm/Config.in b/package/llvm/Config.in index 83e94660eb..dd07b23e07 100644 --- a/package/llvm/Config.in +++ b/package/llvm/Config.in @@ -11,6 +11,12 @@ config BR2_PACKAGE_LLVM_TARGET_ARCH default "ARM" if BR2_arm || BR2_armeb default "X86" if BR2_i386 || BR2_x86_64 +config BR2_PACKAGE_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_LLVM bool "llvm" depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS @@ -27,6 +33,11 @@ config BR2_PACKAGE_LLVM http://llvm.org +config BR2_PACKAGE_LLVM_ENABLE_HOST_ARCH + bool "Build backend for host architecture" + help + Build code generator for host machine. + if BR2_PACKAGE_LLVM config BR2_PACKAGE_LLVM_AMDGPU diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 3abf428989..50cc74d299 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_LLVM_ENABLE_HOST_ARCH),y) +HOST_LLVM_TARGETS_TO_BUILD += $(call qstrip,$(BR2_PACKAGE_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