From patchwork Fri Jun 22 00:33:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Kogut X-Patchwork-Id: 933010 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="VaDpWjEl"; 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 41BfhL0Q1Tz9s3C for ; Fri, 22 Jun 2018 10:34:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6DD1F88F89; Fri, 22 Jun 2018 00:34:07 +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 rnznK+rM4Lcb; Fri, 22 Jun 2018 00:34:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A8EF88F40; Fri, 22 Jun 2018 00:34: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 0341E1C292E for ; Fri, 22 Jun 2018 00:34:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F2A4188891 for ; Fri, 22 Jun 2018 00:34:01 +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 DqSCpZGmBTDH for ; Fri, 22 Jun 2018 00:34:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0D28D887A4 for ; Fri, 22 Jun 2018 00:34:01 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id w17-v6so2539399pll.9 for ; Thu, 21 Jun 2018 17:34:01 -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=2/hMfYQJoTstImyil0/G69jjs+0hWOasla5vtPDA2w4=; b=VaDpWjElSYkGZwPurvnaK9QjjehS/vhPHbR79z6Y9buyyJ5JMP/HlU6sytu/hJEXHL 17p8dOliMkY16AlBSZB7ZWwHT3r54PFHMq+qKJNKcTvtVixg4usyoJhna3QfGJeHmo6r aY4a7lTHga8MMSwWxLZBkFmlRgIddroPsKHgihVYwmwWZzPoGtZDouFaOgStCIgz3B1Z 9alN2U8sh7R7gMeDX/KNWoxldqv3QkJ9F4Vw8R48pFQ6nkvY5OPijtD5toENzBn8A6aC RYny6KaWh8ZGVJ8AcTsga9VkYjXdfgOw/ZFs0xkMxl7y3Q9biZuRSxkokq1tTkNqC9di 2VgA== 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=2/hMfYQJoTstImyil0/G69jjs+0hWOasla5vtPDA2w4=; b=sUnqxybN67RlpKfUsJ/5b0hVmo2Bb4cKDHUbOUfvakF5Gf76ffQxln/a+Vb7mt4+CT gg0CmRChqo5pBocfVFDeui7VeQtr3AHwbR/KVUXoJnDfAhq9BW419XNOH06TxAKuoLDc +lqRBarraQaMLfiv3KlfmAQNxVi/ZcKkTMHhUAiEgdDRhRxiW2Tf8sWCNJ+QxdwJJ/AO 5xV5lO4kStqL6BGGZ8bAgJfv9ROg4Go1dVWdvPmn32TX+hLXymZqRiT0/EYfxmR7uwKK kptWQ2RGJ5XtthzB66XEp1ncqBS3oFUzCv+8eOOfy42dDtpaAy3G2WcbmZwScTpRVrnt DdwA== X-Gm-Message-State: APt69E0RzgfCExTRaryI4afB+Lb+hIOCD3Cq21L2rGwCh6rfuFQhFzfo bkKwNfPLlo+uIQZvmSfl8h3xGDNleRM= X-Google-Smtp-Source: ADUXVKIkIliOyujPBzV4qxlLdnPgjs0QAda68IP9/PNbHKWB4OXR3K2ERtZuNy3cayu7cCYvdqobeg== X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr30807736plc.294.1529627640432; Thu, 21 Jun 2018 17:34:00 -0700 (PDT) Received: from JAKWS.YakimaSteel.local ([162.251.69.147]) by smtp.gmail.com with ESMTPSA id n76-v6sm14590974pfg.98.2018.06.21.17.33.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 17:33:59 -0700 (PDT) From: Joseph Kogut To: buildroot@buildroot.org Date: Thu, 21 Jun 2018 17:33:38 -0700 Message-Id: <20180622003340.10859-5-joseph.kogut@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180622003340.10859-1-joseph.kogut@gmail.com> References: <20180622003340.10859-1-joseph.kogut@gmail.com> Subject: [Buildroot] [RFC PATCH v5 4/6] 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/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 38543e7390..d0374d351e 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