From patchwork Sun Nov 13 05:01:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44485 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CE09927BBEE; Sun, 13 Nov 2022 05:03:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D527027BBEA for ; Sun, 13 Nov 2022 05:03:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ou599-0003Dz-87; Sun, 13 Nov 2022 00:03:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ou595-0003DV-9Y for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ou595-0004p5-1b for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ou594-0003KE-Mw for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH 1/3] gnu: Add llvm-15. References: <20221113045354.26955-1-maxim.cournoyer@gmail.com> In-Reply-To: <20221113045354.26955-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Nov 2022 05:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59237 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59237@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.166831574012702 (code B ref 59237); Sun, 13 Nov 2022 05:03:02 +0000 Received: (at 59237) by debbugs.gnu.org; 13 Nov 2022 05:02:20 +0000 Received: from localhost ([127.0.0.1]:49804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58N-0003Im-Rx for submit@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:20 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:36377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58D-0003IC-6E for 59237@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:18 -0500 Received: by mail-qt1-f170.google.com with SMTP id fz10so5178074qtb.3 for <59237@debbugs.gnu.org>; Sat, 12 Nov 2022 21:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GVGm9Ef9/JuYyZCp7D7Bc3SEraoZ2JiZ50RMwUqFWAo=; b=okY223IV7+quZTNkpvpxtAuJdiYAspncndCBClBBDkb8DkwhQxPfp/eV4eYhR3G+bs EfrJxDqpGIC1Gp/rYOCpS8V22S6XMV351ZEYPkPU4o9IwhFCAxbwwm3IIYiBXUEuY5np MuXOSksMPItCwyEHFuqBnJSxWGUTPd4tMIF5YBr/jzJ4x33X3zWbm83BgRhmPFE0a28U Hg55B2w9VRF80tukd9T+/sgNICkGo0fsvPVt9L1D/onUC7kv7q0vYTF2AxLNiuL+EKG6 bXTi5vD5MGPb1vhz10srBBWXAO0I0Zbcp/8L4WKc1upwNUUBt7AgoEQ2V22qNHdaJi3g AjJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GVGm9Ef9/JuYyZCp7D7Bc3SEraoZ2JiZ50RMwUqFWAo=; b=xOZsp6n6az4CmKCGAXqxVkpvdUyRNwSzejXYJj7gbGGbqR/s7xeJF6wgATwlOn4NdW y+iuDcBJ5ScUcULtGZStrVxGbO8LComQhPCcgPAEuJAK6RvNq+cFMwD5eyt+1cX1RKIc qYq/DRzgD9z1SA8IZ5SmJhUXHn5N4K14xITHyZ4SYjzlDtYTTqDP46hqIteTTaxUsq58 2GzsWNh0LEJ449ubxUWwCaKO4uGfwCX9ATfxVX9agg7fyRlQ67Zwr1mYou9ybmOz5wEI c0zVjZA+sksOgLMo1QpM2ecYE9DfUR31vE4W1flZu7PbBoJwfgpzmPN4gtfJRRhGHT4u lUCw== X-Gm-Message-State: ANoB5pnv+m1OD4Xrwn70atA4/IoaFizhcA1WcecTw+yFAxusiV8UUxhT vfEphXacHUnqGiGO2m9uh/EZjVWI6Y8= X-Google-Smtp-Source: AA0mqf4ExovBDRhY4D0ZvslrcvGi2MF15xPJ7ot4fvOQl3ktGkzbExKu1UEnjrUhAYYTaOO4ujVrUw== X-Received: by 2002:ac8:4e4f:0:b0:3a5:4f7e:bab2 with SMTP id e15-20020ac84e4f000000b003a54f7ebab2mr7497334qtw.527.1668315723164; Sat, 12 Nov 2022 21:02:03 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id j6-20020a05620a410600b006ee949b8051sm4282671qko.51.2022.11.12.21.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 21:02:02 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Nov 2022 00:01:58 -0500 Message-Id: <20221113050200.27277-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/llvm.scm (llvm-15): New variable. * gnu/packages/patches/clang-15.0-libc-search-path.patch: New file. * gnu/local.mk: Register it. --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 69 +++++++++++++- .../patches/clang-15.0-libc-search-path.patch | 95 +++++++++++++++++++ 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/clang-15.0-libc-search-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index e3e02314bb..6b6ada17a5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -976,6 +976,7 @@ dist_patch_DATA = \ %D%/packages/patches/clang-12.0-libc-search-path.patch \ %D%/packages/patches/clang-13.0-libc-search-path.patch \ %D%/packages/patches/clang-14.0-libc-search-path.patch \ + %D%/packages/patches/clang-15.0-libc-search-path.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 324149116b..0a35aed7c6 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -545,10 +545,12 @@ (define (make-clang-toolchain clang libomp) ("libc-static" ,glibc "static"))))) (define %llvm-monorepo-hashes - '(("14.0.6" . "14f8nlvnmdkp9a9a79wv67jbmafvabczhah8rwnqrgd5g3hfxxxx"))) + '(("14.0.6" . "14f8nlvnmdkp9a9a79wv67jbmafvabczhah8rwnqrgd5g3hfxxxx") + ("15.0.4" . "0j5kx4s970qzcjr83kk6776zzjqfshl61x9fagqz8kjxcjbpg8cj"))) (define %llvm-patches - '(("14.0.6" . ("clang-14.0-libc-search-path.patch")))) + '(("14.0.6" . ("clang-14.0-libc-search-path.patch")) + ("15.0.4" . ("clang-15.0-libc-search-path.patch")))) (define (llvm-monorepo version) (origin @@ -560,6 +562,69 @@ (define (llvm-monorepo version) (sha256 (base32 (assoc-ref %llvm-monorepo-hashes version))) (patches (map search-patch (assoc-ref %llvm-patches version))))) +;;; TODO: Make the base llvm all other LLVM inherit from on core-updates. +(define-public llvm-15 + (package + (name "llvm") + (version "15.0.4") + (source (llvm-monorepo version)) + (build-system cmake-build-system) + (outputs '("out" "opt-viewer")) + (arguments + (list + #:configure-flags + #~(list + ;; These options are required for cross-compiling LLVM according + ;; to . + #$@(if (%current-target-system) + #~((string-append "-DLLVM_TABLEGEN=" + #+(file-append this-package + "/bin/llvm-tblgen")) + #$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" + (%current-target-system)) + #$(string-append "-DLLVM_TARGET_ARCH=" + (system->llvm-target)) + #$(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target))) + '()) + ;; Note: sadly, the build system refuses the use of + ;; -DBUILD_SHARED_LIBS=ON and the large static archives are needed to + ;; build clang-runtime, so we cannot delete them. + "-DLLVM_BUILD_LLVM_DYLIB=ON" + "-DLLVM_LINK_LLVM_DYLIB=ON" + "-DLLVM_ENABLE_FFI=ON" + "-DLLVM_ENABLE_RTTI=ON" ;for some third-party utilities + "-DLLVM_INSTALL_UTILS=ON" ;needed for rustc + "-DLLVM_PARALLEL_LINK_JOBS=1") ;cater to smaller build machines + ;; Don't use '-g' during the build, to save space. + #:build-type "Release" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'change-directory + (lambda _ + (chdir "llvm"))) + (add-after 'install 'install-opt-viewer + (lambda* (#:key outputs #:allow-other-keys) + (let* ((opt-viewer-share (string-append #$output:opt-viewer + "/share"))) + (mkdir-p opt-viewer-share) + (rename-file (string-append #$output "/share/opt-viewer") + opt-viewer-share))))))) + (native-inputs (list python-wrapper perl)) + (inputs (list libffi)) + (propagated-inputs (list zlib)) ;to use output from llvm-config + (home-page "https://www.llvm.org") + (synopsis "Optimizing compiler infrastructure") + (description + "LLVM is a compiler infrastructure designed for compile-time, link-time, +runtime, and idle-time optimization of programs from arbitrary programming +languages. It currently supports compilation of C and C++ programs, using +front-ends derived from GCC 4.0.1. A new front-end for the C family of +languages is in development. The compiler infrastructure includes mirror sets +of programming tools as well as libraries with equivalent functionality.") + (license license:asl2.0) + (properties `((release-monitoring-url . ,%llvm-release-monitoring-url))))) + (define-public llvm-14 (package (name "llvm") diff --git a/gnu/packages/patches/clang-15.0-libc-search-path.patch b/gnu/packages/patches/clang-15.0-libc-search-path.patch new file mode 100644 index 0000000000..20726859b2 --- /dev/null +++ b/gnu/packages/patches/clang-15.0-libc-search-path.patch @@ -0,0 +1,95 @@ +Clang attempts to guess file names based on the OS and distro (yes!), +but unfortunately, that doesn't work for us. + +This patch makes it easy to insert libc's $libdir so that Clang passes the +correct absolute file name of crt1.o etc. to 'ld'. It also disables all +the distro-specific stuff and removes the hard-coded FHS directory names +to make sure Clang also works on foreign distros. + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/libDriver/Distro.cpp +index 1898667..35de813 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/libDriver/Distro.cpp +@@ -97,6 +97,10 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) { + } + + static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { ++ // The compiler should always behave the same, even when used via Guix on a ++ // foreign distro. ++ return Distro::UnknownDistro; ++ + Distro::DistroType Version = Distro::UnknownDistro; + + // Newer freedesktop.org's compilant systemd-based systems +diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/libDriver/ToolChains/Cuda.cpp +index 7ad990d..e4da4d4 100644 +--- a/clang/lib/Driver/ToolChains/Cuda.cpp ++++ b/clang/libDriver/ToolChains/Cuda.cpp +@@ -117,6 +117,9 @@ CudaInstallationDetector::CudaInstallationDetector( + const Driver &D, const llvm::Triple &HostTriple, + const llvm::opt::ArgList &Args) + : D(D) { ++ // Don't look for CUDA in /usr. ++ return; ++ + struct Candidate { + std::string Path; + bool StrictChecking; +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/libDriver/ToolChains/Linux.cpp +index ceb1a98..9d7a14a 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/libDriver/ToolChains/Linux.cpp +@@ -188,6 +188,10 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + + Generic_GCC::PushPPaths(PPaths); + ++ // Comment out the distro-specific tweaks so that they don't bite when ++ // using Guix on a foreign distro. ++#if 0 ++ + Distro Distro(D.getVFS(), Triple); + + if (Distro.IsAlpineLinux() || Triple.isAndroid()) { +@@ -256,6 +260,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + + if (IsAndroid || Distro.IsOpenSUSE()) + ExtraOpts.push_back("--enable-new-dtags"); ++#endif + + // The selection of paths to try here is designed to match the patterns which + // the GCC driver itself uses, as this is part of the GCC-compatible driver. +@@ -276,6 +281,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + } + Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths); + ++#if 0 + addPathIfExists(D, concat(SysRoot, "/lib", MultiarchTriple), Paths); + addPathIfExists(D, concat(SysRoot, "/lib/..", OSLibDir), Paths); + +@@ -304,9 +310,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + addPathIfExists(D, concat(SysRoot, "/", OSLibDir, ABIName), Paths); + addPathIfExists(D, concat(SysRoot, "/usr", OSLibDir, ABIName), Paths); + } ++#endif + + Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths); + ++#if 0 + // The deprecated -DLLVM_ENABLE_PROJECTS=libcxx configuration installs + // libc++.so in D.Dir+"/../lib/". Detect this path. + // TODO Remove once LLVM_ENABLE_PROJECTS=libcxx is unsupported. +@@ -316,6 +324,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + + addPathIfExists(D, concat(SysRoot, "/lib"), Paths); + addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths); ++#endif ++ ++ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o, ++ // and friends can be found. ++ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths); ++ ++ // Add GCC's lib/ directory so libstdc++.so can be found. ++ addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths); + } + + ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const { From patchwork Sun Nov 13 05:01:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44487 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7C15027BBE9; Sun, 13 Nov 2022 05:03:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AFF9727BBEA for ; Sun, 13 Nov 2022 05:03:37 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ou59D-0003GP-9Y; Sun, 13 Nov 2022 00:03:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ou596-0003Dj-Hp for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ou595-0004pJ-LD for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ou595-0003KN-BB for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH 2/3] gnu: Add clang-runtime-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Nov 2022 05:03:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59237 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59237@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.166831574012708 (code B ref 59237); Sun, 13 Nov 2022 05:03:03 +0000 Received: (at 59237) by debbugs.gnu.org; 13 Nov 2022 05:02:20 +0000 Received: from localhost ([127.0.0.1]:49806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58O-0003Ip-Gx for submit@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:20 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:39819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58L-0003IP-Mi for 59237@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:18 -0500 Received: by mail-qk1-f171.google.com with SMTP id g10so5660366qkl.6 for <59237@debbugs.gnu.org>; Sat, 12 Nov 2022 21:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RLDM7Oa/YxgF7Pikd4Cfv+lyMzKTnfs0+ypa9mX/MNE=; b=qmQnBOjmiiBSYnxdLiRIa4L69LcqcUssOJwtlgjLTI5gtffK84PPX6CAlk5H8z0Ouw 2RiiIPT5cLRoT3FmwJblBXjSv3Fdkrtd7MoGd/pAb/c8JqOzNvp+Er9lu7C6xt4ftk8r oKRYjsYOy52nFmvv2tFTmRCSr2zPv50Icv5tFuBAm0n6Ena0OL6KZ+NBJXFy5pSyCANW r2owcBigCg7KXJtr06kVVl9wLLgnYV64bLgXp6LIsTBBD45jWgVrmNgvlz8Hi6rtHOHL Up5LtN1EM7uUbb9pOnY4iuUm1jNvw0FxtD1MXOk9dbzXD/xsDxM0GJvQ0D9FucMPkOyC cy1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RLDM7Oa/YxgF7Pikd4Cfv+lyMzKTnfs0+ypa9mX/MNE=; b=KDgi54N4rQ+WLv2xTo5ClWJAPuBMLZCkSvBdDJA8rBrt1p7pA1+zGTT56FZPmPw68z frG7G7iPPfgcc9xe6SRfAz6ZL7xZsPrhHM5bNvB4+h9+MSxzG07IuuE8gGKdpPIuOOUK 26Gsb3Q7uHIP/49v+ttSq5LFvhfsXc8wvIjOak3yvH/ZKZ80//kV/5zSmfX/tXXLzKNN 3XUxM1VwUErMah2R9wLI6KiHHKeSOR7OmY/0gr4HQEjweP70C0HY1ug+SKJ1+szuxECv yR5BRvTXoSL1UEJjyS3NiI6xKE+4/GV+eW8uMN5hnuBf/F15HPDoLGXGiP6+k6D+FbyH jdOw== X-Gm-Message-State: ANoB5pnwEpl2k6RCED4vd4NeWQ2a1aaaBAZtrwDJt8MvKwKUahbmzyyg LQTflM8JnOWrIPhURunj8SI20JREG1s= X-Google-Smtp-Source: AA0mqf6YyOkvyHgyTzfOU04BTMnDBiw6ISvcRNQxwvE5luoQyyIxJbJehJ1/f/ovETryJAV6vt2NjQ== X-Received: by 2002:a05:620a:4806:b0:6fa:da64:4879 with SMTP id eb6-20020a05620a480600b006fada644879mr6769946qkb.312.1668315732106; Sat, 12 Nov 2022 21:02:12 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id j6-20020a05620a410600b006ee949b8051sm4282671qko.51.2022.11.12.21.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 21:02:11 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Nov 2022 00:01:59 -0500 Message-Id: <20221113050200.27277-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221113050200.27277-1-maxim.cournoyer@gmail.com> References: <20221113050200.27277-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/llvm.scm (clang-runtime-15): New variable. --- gnu/packages/llvm.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 0a35aed7c6..d7b6207dc4 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -690,6 +690,29 @@ (define-public llvm-14 (license license:asl2.0) (properties `((release-monitoring-url . ,%llvm-release-monitoring-url))))) +(define-public clang-runtime-15 + (let ((template (clang-runtime-from-llvm llvm-15))) + (package + (inherit template) + (arguments + (substitute-keyword-arguments (package-arguments template) + ((#:phases phases '(@ (guix build cmake-build-system) %standard-phases)) + #~(modify-phases #$phases + (add-after 'unpack 'change-directory + (lambda _ + (chdir "compiler-rt"))) + (add-after 'install 'delete-static-libraries + ;; Reduce size from 33 MiB to 7.4 MiB. + (lambda _ + (for-each delete-file + (find-files #$output "\\.a(\\.syms)?$")))))))) + (native-inputs + (modify-inputs (package-native-inputs template) + (prepend gcc-12))) ;libfuzzer fails to build with GCC 11 + (inputs + (modify-inputs (package-inputs template) + (append libffi)))))) + (define-public clang-runtime-14 (let ((template (clang-runtime-from-llvm llvm-14))) (package From patchwork Sun Nov 13 05:02:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44486 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 20E9927BBE9; Sun, 13 Nov 2022 05:03:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 629DD27BBEB for ; Sun, 13 Nov 2022 05:03:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ou599-0003F2-U2; Sun, 13 Nov 2022 00:03:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ou596-0003Dl-M9 for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ou596-0004pP-5X for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ou595-0003KU-Vr for guix-patches@gnu.org; Sun, 13 Nov 2022 00:03:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH 3/3] gnu: Add clang-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Nov 2022 05:03:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59237 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59237@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.166831574412720 (code B ref 59237); Sun, 13 Nov 2022 05:03:03 +0000 Received: (at 59237) by debbugs.gnu.org; 13 Nov 2022 05:02:24 +0000 Received: from localhost ([127.0.0.1]:49808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58R-0003J5-RY for submit@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:24 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:38496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou58N-0003IR-A6 for 59237@debbugs.gnu.org; Sun, 13 Nov 2022 00:02:19 -0500 Received: by mail-qv1-f47.google.com with SMTP id o8so6033590qvw.5 for <59237@debbugs.gnu.org>; Sat, 12 Nov 2022 21:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LCMvRriAcwVLzDQW4q1WTHk/0RvPn8+I/w7apWsmcEE=; b=q1Zsu7PxmaHWkCG0H2jZVdyjPbgJ8Pt7qJFBbsV8N7fQWAy4f0MAk3fUjh01T1HI0m bXCT6s/041QT1ckx2Xv2TGbsb2Ji6BeFUCvUlhlgknrYtoRbccJvsFZAuih2XkYzp1Ud aQP4T3Mh3Y5sx7OJ2jpUJuEDoM2OCUwWDlDoGmvi7Z8IhAkK6vnwbKYIERwYE3T00GUX DcwFmSq7JDyOlqYKt8YbRB1ZsyY0dvxPUxIS2Q6wuQXSXX7jGT4wVyln58F3a+iq8/ch hi+mqHrJI8X4Uhd7CzJgQJFDw9WG7oEeQkJu8dAGJYZBgOBig30Hf7yGch9hN0427KBt GB4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LCMvRriAcwVLzDQW4q1WTHk/0RvPn8+I/w7apWsmcEE=; b=xOe8L1elwC3dk83/SEJsy9fM7hfWLzOKZ+Tg8+HHhTYNSAyXVymiuTnOjiJ87/G6KE qylbQT/r0Q5xUddeXgGMoO5UzeHvQ/ShBkPUQPscSSg2IPmzdTM9Za9rTdQ4CVaiCThN Fhau6+XXfxkTxKnuGxSjzRLTuSuHrYnratCAQ8SxftI1NjJ52uKgn42BzcOuGbE+T7yq Lk54sm3XDThR94hgqPaFfZb5I6wnYA3Wce5xykW2bpHn796wplQ5u02xCcNGBgWv9gzF NT/tXu/ZQXyYmskPAsN/x6bd2vlHIbLiQW+RiHOWU4dgqv/HsnTbU45UOrUY6T96ADWa D54w== X-Gm-Message-State: ANoB5pl1rOV2aS1Y2bznLaTjKlS4jHE7+z/0sjG1mTntYJpzfJOVW56B lYqr3wEa2IsY/RvGPuDBKSzPJQmP1qI= X-Google-Smtp-Source: AA0mqf4kerqZXVAOgZ//p1e2md67kGmjlixOq8x2ek5I62Y4sQoPOu8i7xwP3uxCEkJFvBVcklK+eQ== X-Received: by 2002:a05:6214:2b97:b0:4b1:95bf:57f2 with SMTP id kr23-20020a0562142b9700b004b195bf57f2mr7927260qvb.113.1668315733658; Sat, 12 Nov 2022 21:02:13 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id j6-20020a05620a410600b006ee949b8051sm4282671qko.51.2022.11.12.21.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 21:02:13 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Nov 2022 00:02:00 -0500 Message-Id: <20221113050200.27277-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221113050200.27277-1-maxim.cournoyer@gmail.com> References: <20221113050200.27277-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/llvm.scm (clang-from-llvm*): New helper. (clang-15): New variable. --- gnu/packages/llvm.scm | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index d7b6207dc4..12e1e642c6 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -422,6 +422,43 @@ (define* (clang-from-llvm llvm clang-runtime license:asl2.0 ;with LLVM exceptions license:ncsa)))) +;;; TODO: Integrate into original on core-updates, perhaps with an extra +;;; option such as #:build-shared-libs? documented as a legacy feature. +(define* (clang-from-llvm* llvm clang-runtime + #:optional hash + #:key (patches '()) tools-extra + (properties + (append `((release-monitoring-url + . ,%llvm-release-monitoring-url)) + (clang-properties (package-version llvm))))) + "Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the +given PATCHES. When TOOLS-EXTRA is given, it must point to the +'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace', +'modularize', and other tools." + (let ((base (clang-from-llvm llvm clang-runtime hash + #:patches patches #:tools-extra tools-extra + #:properties properties))) + (package + (inherit base) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases ''%standard-phases) + #~(modify-phases #$phases + ;; Like the original, sans BUILD_SHARED_LIBS patching. + #$@(if tools-extra + #~((replace 'add-tools-extra + (lambda* (#:key inputs #:allow-other-keys) + ;; Unpack the 'clang-tools-extra' tarball under + ;; tools/. + (let ((extra (assoc-ref inputs "clang-tools-extra"))) + (invoke "tar" "xf" extra) + (rename-file #$(string-append + "clang-tools-extra-" + (string-delete #\- (package-version llvm)) + ".src") + "tools/extra"))))) + #~())))))))) + (define (clang-properties version) "Return package properties for Clang VERSION." `((compiler-cpu-architectures @@ -729,6 +766,30 @@ (define-public clang-runtime-14 ("gcc" ,gcc-11) ,@(package-native-inputs template)))))) +(define-public clang-15 + (let ((template + (clang-from-llvm* + llvm-15 clang-runtime-15 + #:tools-extra + (origin + (method url-fetch) + (uri (llvm-uri "clang-tools-extra" + (package-version llvm-15))) + (sha256 + (base32 + "03adxlh84if9p53m6izjsql500rjza9rng8akab2pdqibgrg73rh")))))) + (package + (inherit template) + (arguments + (substitute-keyword-arguments (package-arguments template) + ((#:configure-flags flags ''()) + #~(cons "-DCLANG_LINK_CLANG_DYLIB=ON" #$flags)) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'change-directory + (lambda _ + (chdir "clang")))))))))) + (define-public clang-14 (let ((template (clang-from-llvm llvm-14 clang-runtime-14