From patchwork Wed Nov 20 17:39:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preston X-Patchwork-Id: 1198356 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 47J92925vBz9sPJ for ; Thu, 21 Nov 2019 04:40:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6F41A21561; Wed, 20 Nov 2019 17:40:15 +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 0604eqC2hzcu; Wed, 20 Nov 2019 17:40:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id ECCD5235B8; Wed, 20 Nov 2019 17:40:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C9B5C1BF97F for ; Wed, 20 Nov 2019 17:39:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C41E3235B8 for ; Wed, 20 Nov 2019 17:39:56 +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 s3y0K1KMI6Is for ; Wed, 20 Nov 2019 17:39:54 +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 silver.osuosl.org (Postfix) with ESMTPS id 7FFA5204D2 for ; Wed, 20 Nov 2019 17:39:54 +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 1iXTxH-0008QV-8b; Wed, 20 Nov 2019 17:39:51 +0000 From: Thomas Preston To: buildroot@buildroot.org Date: Wed, 20 Nov 2019 17:39:21 +0000 Message-Id: <20191120173944.130142-8-thomas.preston@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191120173944.130142-1-thomas.preston@codethink.co.uk> References: <20191120173944.130142-1-thomas.preston@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [RFC PATCH v3 07/30] package/compiler-rt: new package 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: Michael Drake , Thomas Preston , Romain Naour , Ricardo Martincoski , Valentin Korenblit Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Matt Weber This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder. Signed-off-by: Matthew Weber Cc: Romain Naour Cc: Ricardo Martincoski Cc: Valentin Korenblit Signed-off-by: Michael Drake Signed-off-by: Thomas Preston --- DEVELOPERS | 1 + package/Config.in | 1 + package/clang/clang.mk | 2 +- package/compiler-rt/Config.in | 14 +++++++++++ package/compiler-rt/compiler-rt.hash | 2 ++ package/compiler-rt/compiler-rt.mk | 35 ++++++++++++++++++++++++++++ package/lld/lld.mk | 2 +- package/llvm/llvm.mk | 2 +- 8 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 package/compiler-rt/Config.in create mode 100644 package/compiler-rt/compiler-rt.hash create mode 100644 package/compiler-rt/compiler-rt.mk diff --git a/DEVELOPERS b/DEVELOPERS index 991be89849..47923399eb 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1535,6 +1535,7 @@ F: package/bridge-utils/ F: package/checkpolicy/ F: package/checksec/ F: package/cgroupfs-mount/ +F: package/compiler-rt/ F: package/crda/ F: package/cunit/ F: package/dacapo/ diff --git a/package/Config.in b/package/Config.in index f72c77b416..f3c69b60c2 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1703,6 +1703,7 @@ menu "Other" source "package/clapack/Config.in" source "package/classpath/Config.in" source "package/cmocka/Config.in" + source "package/compiler-rt/Config.in" source "package/cppcms/Config.in" source "package/cracklib/Config.in" source "package/dawgdic/Config.in" diff --git a/package/clang/clang.mk b/package/clang/clang.mk index 87bdf52e8d..2e33229eb3 100644 --- a/package/clang/clang.mk +++ b/package/clang/clang.mk @@ -4,7 +4,7 @@ # ################################################################################ -# LLVM, Clang and lld should be version bumped together +# LLVM, Clang, lld, and Compiler-rt should be version bumped together CLANG_VERSION = 9.0.0 CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION) CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz diff --git a/package/compiler-rt/Config.in b/package/compiler-rt/Config.in new file mode 100644 index 0000000000..9afc0d9d60 --- /dev/null +++ b/package/compiler-rt/Config.in @@ -0,0 +1,14 @@ +config BR2_PACKAGE_COMPILER_RT + bool "compiler-rt" + depends on BR2_PACKAGE_LLVM + depends on BR2_TOOLCHAIN_USES_GLIBC # asan lib requires + help + A collection of runtime libraries primarily used by clang and + llvm to provide builtins, sanitizer runtimes, and profiling + at runtime. + + https://compiler-rt.llvm.org/ + +comment "compiler-rt requires llvm to be enabled and a glibc toolchain" + depends on !BR2_PACKAGE_LLVM + depends on !BR2_TOOLCHAIN_USES_GLIBC diff --git a/package/compiler-rt/compiler-rt.hash b/package/compiler-rt/compiler-rt.hash new file mode 100644 index 0000000000..b17a96edc7 --- /dev/null +++ b/package/compiler-rt/compiler-rt.hash @@ -0,0 +1,2 @@ +sha256 56e4cd96dd1d8c346b07b4d6b255f976570c6f2389697347a6c3dcb9e820d10e compiler-rt-9.0.0.src.tar.xz +sha256 1a8f1058753f1ba890de984e48f0242a3a5c29a6a8f2ed9fd813f36985387e8d LICENSE.TXT diff --git a/package/compiler-rt/compiler-rt.mk b/package/compiler-rt/compiler-rt.mk new file mode 100644 index 0000000000..febd71b906 --- /dev/null +++ b/package/compiler-rt/compiler-rt.mk @@ -0,0 +1,35 @@ +################################################################################ +# +# compiler-rt +# +################################################################################ + +# LLVM, Clang, lld, and Compiler-rt should be version bumped together +COMPILER_RT_VERSION = 9.0.0 +COMPILER_RT_SOURCE = compiler-rt-$(COMPILER_RT_VERSION).src.tar.xz +COMPILER_RT_SITE = http://llvm.org/releases/$(COMPILER_RT_VERSION) +COMPILER_RT_LICENSE = NCSA MIT +COMPILER_RT_LICENSE_FILES = LICENSE.TXT +COMPILER_RT_DEPENDENCIES = host-clang llvm + +COMPILER_RT_INSTALL_STAGING = YES +COMPILER_RT_INSTALL_TARGET = NO + +COMPILER_RT_CONF_OPTS=-DCOMPILER_RT_STANDALONE_BUILD=OFF \ + -DCOMPILER_RT_STANDALONE_BUILD=ON \ + -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) \ + -DLLVM_CONFIG_PATH=$(HOST_DIR)/usr/bin/llvm-config + +# The installation of the target runtime libraries defaults to DESTDIR, however +# host-clang resources directory needs a link so Clang can find the runtime +# libraries in the same location they would be if built as part of the Clang +# build. The "resources" directory is loosely documented and seems to be +# assumed, as compiler-rt is usually build at the same time as Clang and not +# standalone. +define COMPILER_RT_SETUP_RUNTIME_LIBS + mkdir -p $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib + ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/lib/linux $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib/linux +endef +COMPILER_RT_POST_INSTALL_STAGING_HOOKS += COMPILER_RT_SETUP_RUNTIME_LIBS + +$(eval $(cmake-package)) diff --git a/package/lld/lld.mk b/package/lld/lld.mk index bba608d64a..ccba3ae180 100644 --- a/package/lld/lld.mk +++ b/package/lld/lld.mk @@ -4,7 +4,7 @@ # ################################################################################ -# LLVM, Clang and lld should be version bumped together +# LLVM, Clang, lld, and Compiler-rt should be version bumped together LLD_VERSION = 9.0.0 LLD_SITE = https://llvm.org/releases/$(LLD_VERSION) LLD_SOURCE = lld-$(LLD_VERSION).src.tar.xz diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index d15ca80d75..fc147e6d12 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -4,7 +4,7 @@ # ################################################################################ -# LLVM, Clang and lld should be version bumped together +# LLVM, Clang, lld, and Compiler-rt should be version bumped together LLVM_VERSION = 9.0.0 LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION) LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz