From patchwork Wed Nov 16 14:18:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44541 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 F3A1327BBEC; Wed, 16 Nov 2022 14:19:41 +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 66BD927BBE9 for ; Wed, 16 Nov 2022 14:19:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJFq-0000Ci-Qg; Wed, 16 Nov 2022 09:19:06 -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 1ovJFp-0000AY-8l for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:05 -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 1ovJFm-0000ZF-NZ for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovJFm-0001UX-Hz for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH v2 1/5] gnu: Add llvm-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 14:19: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: ludo@gnu.org, Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.16686083295663 (code B ref 59237); Wed, 16 Nov 2022 14:19:02 +0000 Received: (at 59237) by debbugs.gnu.org; 16 Nov 2022 14:18:49 +0000 Received: from localhost ([127.0.0.1]:56444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFZ-0001TF-2e for submit@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:49 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:38834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFX-0001St-At for 59237@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:48 -0500 Received: by mail-qv1-f42.google.com with SMTP id o8so11963684qvw.5 for <59237@debbugs.gnu.org>; Wed, 16 Nov 2022 06:18:47 -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=jjvx1acHjAqfo83kydNEnsr6wsxeHlfTuiEzZoYhEno=; b=lRphehqktUXweGT/f9OgGLXlPzmYhfp5ubFltbVCCAjy2954wwfF/ZnHob/nCo3kjw KASKq3/vpfZUdhMsm/PcDchY+77u1nNHvJsQpbVBHW7JHYV4LM30p1T5C+JYQNx18ibq ndqzFuG7s3WPIY98zI+87s0TrYIYcWsNnIGOMy1j8IAeWzfExn9zQs4Bh4zaNh1l7xkF ZkpUpCwv8/ZwFy4dy/n6I6xXrkj0ehNz7NWuKiu3XaGVUuCt14SkBkIcPBRxbhly89op tyOHygp1Y/n9nHLlS19aKH0aOMNrMgvtuOvERA/jfQYHWznvdHIVMnkh6hsavkkjaEC1 iP0Q== 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=jjvx1acHjAqfo83kydNEnsr6wsxeHlfTuiEzZoYhEno=; b=amGqjOdxlxdy0uyXKcQPd++o+OAH1ArgzWyQ7SvFj4YDSNWjdpInvwRCOX0clI18mc DeIKg+qve2iOi38/dLmSqf2k5O5X18w1X99MusYvNMRstepRIcCQFFUxG4Sjr2mNOe9H qXHwbjKGaKX2UiDVGh/0gVg905xVBoNu8OATqVDyKJKg6WZ1d8aRz9DpcV1crFCUpLl9 DW5J22OKOfBkgu9rcSN5N/JCrHt2zh6Jx9/iqUFLpSWZWSbmjau0kr7dG8/FGM+rlLUZ zfRsrQDB47VLQWJ38Ft5LJA12rq3nkn0g04d9vrmK+i5YjNxyEO3KVocsp15RS//KoDS RMBg== X-Gm-Message-State: ANoB5pm7U/F7+bTDBLOgNKPm25+7EKduUsk+JFaWzSvcO0P4CO0dtHKR fgXhl8vXvkUK8e/RfpGS3yA2NxoIaT1MWw== X-Google-Smtp-Source: AA0mqf4eLN0OS4iUweV3p0ub3/S3zD6/l2fZaGSS6pMJlHzr7YbPYH56oTZ1lwE0AxiGGuiL6MNNjg== X-Received: by 2002:ad4:55e3:0:b0:4bc:13a3:9c82 with SMTP id bu3-20020ad455e3000000b004bc13a39c82mr20726108qvb.62.1668608321498; Wed, 16 Nov 2022 06:18:41 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id n16-20020a05620a295000b006b640efe6dasm10006660qkp.132.2022.11.16.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:18:41 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 09:18:26 -0500 Message-Id: <20221116141830.12398-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116141830.12398-1-maxim.cournoyer@gmail.com> References: <20221116141830.12398-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 (llvm-15): New variable. (llvm-14): Inherit from it, removing duplicated fields. * 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 | 93 +++++++++++++----- .../patches/clang-15.0-libc-search-path.patch | 95 +++++++++++++++++++ 3 files changed, 167 insertions(+), 22 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 71472f8410..4fcaa6801a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -977,6 +977,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..5a64c712af 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,20 +562,74 @@ (define (llvm-monorepo version) (sha256 (base32 (assoc-ref %llvm-monorepo-hashes version))) (patches (map search-patch (assoc-ref %llvm-patches version))))) -(define-public llvm-14 +;;; TODO: Make the base llvm all other LLVM inherit from on core-updates. +(define-public llvm-15 (package (name "llvm") - (version "14.0.6") + (version "15.0.4") (source (llvm-monorepo version)) (build-system cmake-build-system) (outputs '("out" "opt-viewer")) - (native-inputs - `(("python" ,python-wrapper) - ("perl" ,perl))) - (inputs - (list libffi)) - (propagated-inputs - (list zlib)) ;to use output from llvm-config + (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 + (inherit llvm-15) + (version "14.0.6") + (source (llvm-monorepo version)) (arguments (list #:configure-flags @@ -613,17 +669,10 @@ (define-public llvm-14 (mkdir-p opt-viewer-share-dir) (rename-file (string-append out "/share/opt-viewer") opt-viewer-dir))))))) - (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))))) + + (native-inputs + `(("python" ,python-wrapper) + ("perl" ,perl))))) (define-public clang-runtime-14 (let ((template (clang-runtime-from-llvm llvm-14))) 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 Wed Nov 16 14:18:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44542 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 93C1127BBED; Wed, 16 Nov 2022 14:19:53 +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=ham 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 1230C27BBE9 for ; Wed, 16 Nov 2022 14:19:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJFs-0000Ex-NM; Wed, 16 Nov 2022 09:19:08 -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 1ovJFp-0000Ad-9T for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:05 -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 1ovJFn-0000ZH-5P for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovJFn-0001Ue-01 for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH v2 2/5] gnu: Add clang-runtime-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 14:19: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: ludo@gnu.org, Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.16686083345686 (code B ref 59237); Wed, 16 Nov 2022 14:19:02 +0000 Received: (at 59237) by debbugs.gnu.org; 16 Nov 2022 14:18:54 +0000 Received: from localhost ([127.0.0.1]:56448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFd-0001Td-RU for submit@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:54 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:35691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFY-0001Sx-I2 for 59237@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:48 -0500 Received: by mail-qv1-f41.google.com with SMTP id i12so11970115qvs.2 for <59237@debbugs.gnu.org>; Wed, 16 Nov 2022 06:18:48 -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=FmH3cX8p8fEcq5H4fZ613recdkfLgU4I9y+wA7jjhys=; b=CmfjcC4T3oqyILmHoztyHC3ZhvZ3KLhZWY/j4ZspWrHxH9B1Gi7WOSgfe6aS65MB3z XxUdaAp13L9R3GxdGHihZ8Ztg6o26bL0IqVL1meYgQqU1p8Nz1/jyY8jJB9AxFeia6Nh P5WbUT/8dGcNpcnDaMO6eHJPU0q43qZ9Et5MdXrqznJxi2/tIPoLCvr6lFi3Gu5YwmKN y9NR9lrusYflY3zWzfVz8Mdfu3DX5kRcsVTsiq70sFfB2ww6u9Lonny8DJ89q+mIbDRB 9A4vaDvpMCli8n5ACNszVg4YQO3nF9byioNS12wKwdOp/AStHlEqDhWaEPxYS2dWYNQm iDLQ== 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=FmH3cX8p8fEcq5H4fZ613recdkfLgU4I9y+wA7jjhys=; b=LGDnWGRGBVjD2l1pg8Qz7qoUGqx/+0be8AqsNv9qwZP8cZQ44usnLWau37d9C0dvda 2M19S5AHwu/DX0ZD7MrJkvB67DYhqdPWtKjbsXkvAXz+ho+4i9XM9AOlIOVfqP/odIUi I7Z45l6w8zMxYACEly1Go7hftewCG0WgHbNkTGvy17nAZOV2UYuEECCzBa/9MFrrFIhl p45kSRXKwqIssGXbe4mV4QkvTIfCY84QC/lJhiHC5/255AzuRRis0TIK5ACgrFkxRFPM p7UkO19fmFRKlRwKkZdv/o45NM/0DlOed2Omi1WOVBfd4sz9telWqy7JYC2rKNPQ5Nvn qSjg== X-Gm-Message-State: ANoB5pl/n97FR7C7bvmrswOMYB0nlFX/9tdYAD2YpgSnr4w5UqYF0nuf eW7VfGm/faqFOq/N6EttQxxBPKktTQYB1A== X-Google-Smtp-Source: AA0mqf4M7deBEZ0L+oCB4zDdHf0OvrrwIZCqtmw6cccO7+5Qkt5I4ffD6xLGOcT6DtDcgjyndBl6FQ== X-Received: by 2002:a05:6214:5652:b0:4bb:5669:fb53 with SMTP id mh18-20020a056214565200b004bb5669fb53mr21089495qvb.84.1668608322843; Wed, 16 Nov 2022 06:18:42 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id n16-20020a05620a295000b006b640efe6dasm10006660qkp.132.2022.11.16.06.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:18:42 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 09:18:27 -0500 Message-Id: <20221116141830.12398-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116141830.12398-1-maxim.cournoyer@gmail.com> References: <20221116141830.12398-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 5a64c712af..9f4f64e0d0 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -674,6 +674,29 @@ (define-public llvm-14 `(("python" ,python-wrapper) ("perl" ,perl))))) +(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 Wed Nov 16 14:18:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44540 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 CF2C927BBEC; Wed, 16 Nov 2022 14:19:17 +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 4F9C727BBE9 for ; Wed, 16 Nov 2022 14:19:15 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJFr-0000DF-E5; Wed, 16 Nov 2022 09:19: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 1ovJFp-0000Aa-93 for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:05 -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 1ovJFn-0000ZI-Ij for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovJFn-0001Um-Dz for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH v2 3/5] gnu: Add clang-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 14:19: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: ludo@gnu.org, Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.16686083345695 (code B ref 59237); Wed, 16 Nov 2022 14:19:03 +0000 Received: (at 59237) by debbugs.gnu.org; 16 Nov 2022 14:18:54 +0000 Received: from localhost ([127.0.0.1]:56450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFe-0001Tf-4J for submit@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:54 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:34801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFZ-0001Sz-Qq for 59237@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:50 -0500 Received: by mail-qk1-f174.google.com with SMTP id 8so11683015qka.1 for <59237@debbugs.gnu.org>; Wed, 16 Nov 2022 06:18:49 -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=2mqrq2YRboY3ypFfnryZEinT8ccc4q/v4xzQGWhoPWQ=; b=BpaM+1BiORIKH1SuMVZTElpnH2x2pdl7FWXpMsJxM67bwo7CAL4APVhItqvfW8D+tg b2kz8OLBgE+Fwn6uYJFvgcpsR5wtH0qPJ9ZamfkXDesY3SWyUzQdfdxjA/tO8aOpwjO3 3iBuLaMqqMagwno7Yb8L4JEEvdDYcnTYTi0FvokuZAERvzKyUdStZ4vJj1umkIj7VGKv b/6NxF05IaYme8iZ3eEfqBo1E5n3L25Mk3izAwlpsYZ7WznA9fyE2Dlq73D+YE52Jft+ 52DB/qWLcyZlYw+ueaGui/fuTWRsnQwCs2UFQg+pC9VDi605duFbgqb0W5eKVGJMmD+V qRkQ== 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=2mqrq2YRboY3ypFfnryZEinT8ccc4q/v4xzQGWhoPWQ=; b=E1URh8gexN46UH9arQlrryUTUCZny3Pbpi5Pdj/TaaA0ppmvl2ikGNz+aw5enBosWd Pi91pzP4ssOWbm6pS8SmsNiN433Uh6QubfZI7Bxu2tKxQ3pK6AkYJl3bVjNeR4SnUB67 PmbDZJ79WggagxhWpgRoh+eiL65lnKUS20Ma1johDyxHbrliGbstlYNyTcJAHMYO/KpO LxKt60fBsz2pnl9wQj5wTnbOJgOC6hUJoEi5CSWSOk6gRyw4GmAzPpcVtRZKYBIHrvdM +QNNFyfjTQfEzyg6YeMpbCtuo7zaCsGyYizmAo4g6TR9C2XYLfx8MT+nSxA1ioiov4qF uUvw== X-Gm-Message-State: ANoB5plOBbPQzzKi6SFv/Y8hHExLW2Em8HR+0ci4YKXmWwItvdmK7Nee tlVKhAl+72PEqcPZwwlAjU5ybTgTfhY0Lw== X-Google-Smtp-Source: AA0mqf4JKnDyAxmVpWZSV40gA1wyhIdnFkmbiDbmIZ326Rs/bPEOagBwBPsYZQ8sYV124hLRYHKemQ== X-Received: by 2002:a37:554:0:b0:6fa:3f2c:c65e with SMTP id 81-20020a370554000000b006fa3f2cc65emr19102370qkf.326.1668608324022; Wed, 16 Nov 2022 06:18:44 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id n16-20020a05620a295000b006b640efe6dasm10006660qkp.132.2022.11.16.06.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:18:43 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 09:18:28 -0500 Message-Id: <20221116141830.12398-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116141830.12398-1-maxim.cournoyer@gmail.com> References: <20221116141830.12398-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): Add LEGACY-BUILD-SHARED-LIBS? argument and update doc. [configure-flags]: Conditionally add -DCLANG_LINK_CLANG_DYLIB=ON. [phases]{change-directory}: Conditionally add phase. {add-tools-extra}: Conditionally patch AddClang.cmake file. (clang-15): New variable. (clang-14): Streamline. (clang-13, clang-12, clang-11, clang-10, clang-9, clang-8, clang-7, clang-6) (clang-3.9.1, clang-3.8, clang-3.7, clang-3.5): Set LEGACY-BUILD-SHARED-LIBS? argument to #t. --- gnu/packages/llvm.scm | 96 +++++++++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 31 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 9f4f64e0d0..2b958b060e 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -176,11 +176,14 @@ (define* (clang-from-llvm llvm clang-runtime (properties (append `((release-monitoring-url . ,%llvm-release-monitoring-url)) - (clang-properties (package-version llvm))))) + (clang-properties (package-version llvm)))) + (legacy-build-shared-libs? #f)) "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." +'modularize', and other tools. LEGACY-BUILD-SHARED-LIBS? is used to configure +the package to use the legacy BUILD_SHARED_LIBS CMake option, which was used +until LLVM/Clang 14." (package (name "clang") (version (package-version llvm)) @@ -221,14 +224,17 @@ (define* (clang-from-llvm llvm clang-runtime (string-append "-DC_INCLUDE_DIRS=" (assoc-ref %build-inputs "libc") "/include") - ,@(if (target-riscv64?) - (list "-DLIBOMP_LIBFLAGS=-latomic" - "-DCMAKE_SHARED_LINKER_FLAGS=-latomic") - `())) + ,@(if (target-riscv64?) + (list "-DLIBOMP_LIBFLAGS=-latomic" + "-DCMAKE_SHARED_LINKER_FLAGS=-latomic") + `()) + ,@(if legacy-build-shared-libs? + '() + (list "-DCLANG_LINK_CLANG_DYLIB=ON"))) ,@(if (target-riscv64?) - `(#:make-flags '("LDFLAGS=-latomic")) - '()) + `(#:make-flags '("LDFLAGS=-latomic")) + '()) ;; Don't use '-g' during the build to save space. #:build-type "Release" @@ -247,9 +253,11 @@ (define* (clang-from-llvm llvm clang-runtime (string-delete #\- (package-version llvm)) ".src") "tools/extra") - ;; Build and link to shared libraries. - (substitute* "cmake/modules/AddClang.cmake" - (("BUILD_SHARED_LIBS") "True")) + ,@(if legacy-build-shared-libs? + ;; Build and link to shared libraries. + '((substitute* "cmake/modules/AddClang.cmake" + (("BUILD_SHARED_LIBS") "True"))) + '()) #t)))) '()) (add-after 'unpack 'add-missing-triplets @@ -323,6 +331,15 @@ (define* (clang-from-llvm llvm clang-runtime (("@GLIBC_LIBDIR@") (string-append libc "/lib")))))) #t))) + ;; Awkwardly, multiple phases added after the same phase, + ;; e.g. unpack, get applied in the reverse order. In other + ;; words, adding 'change-directory last means it occurs + ;; first after the unpack phase. + ,@(if (version>=? version "14") + '((add-after 'unpack 'change-directory + (lambda _ + (chdir "clang")))) + '()) ,@(if (version>=? version "10") `((add-after 'install 'adjust-cmake-file (lambda* (#:key outputs #:allow-other-keys) @@ -713,26 +730,31 @@ (define-public clang-runtime-14 ("gcc" ,gcc-11) ,@(package-native-inputs template)))))) +(define-public clang-15 + (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"))))) + (define-public clang-14 - (let ((template - (clang-from-llvm llvm-14 clang-runtime-14 - #:tools-extra - (origin - (method url-fetch) - (uri (llvm-uri "clang-tools-extra" - (package-version llvm-14))) - (sha256 - (base32 - "0rhq4wkmvr369nkk059skzzw7jx6qhzqhmiwmqg4sp66avzviwvw")))))) - (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 "clang")))))))))) + (clang-from-llvm + llvm-14 clang-runtime-14 + #:legacy-build-shared-libs? #t + #:tools-extra + (origin + (method url-fetch) + (uri (llvm-uri "clang-tools-extra" + (package-version llvm-14))) + (sha256 + (base32 + "0rhq4wkmvr369nkk059skzzw7jx6qhzqhmiwmqg4sp66avzviwvw"))))) + (define-public libomp-14 (package @@ -805,6 +827,7 @@ (define-public clang-runtime-13 (define-public clang-13 (clang-from-llvm llvm-13 clang-runtime-13 "1j8pr5kk8iqyb4jds3yl7c6x672617h4ngkpl4575j7mk4nrwykq" + #:legacy-build-shared-libs? #t #:patches '("clang-13.0-libc-search-path.patch") #:tools-extra (origin @@ -919,6 +942,7 @@ (define-public clang-runtime-12 (define-public clang-12 (clang-from-llvm llvm-12 clang-runtime-12 "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf" + #:legacy-build-shared-libs? #t #:patches '("clang-12.0-libc-search-path.patch") #:tools-extra (origin @@ -973,6 +997,7 @@ (define-public clang-runtime-11 (define-public clang-11 (clang-from-llvm llvm-11 clang-runtime-11 "02ajkij85966vd150iy246mv16dsaph1kfi0y8wnncp8w6nar5hg" + #:legacy-build-shared-libs? #t #:patches '("clang-11.0-libc-search-path.patch") #:tools-extra (origin @@ -1029,12 +1054,13 @@ (define-public clang-runtime-10 (define-public clang-10 (clang-from-llvm llvm-10 clang-runtime-10 "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr" + #:legacy-build-shared-libs? #t #:patches '("clang-10.0-libc-search-path.patch") #:tools-extra (origin (method url-fetch) (uri (llvm-uri "clang-tools-extra" - (package-version llvm-10))) + (package-version llvm-10))) (sha256 (base32 "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh"))))) @@ -1098,6 +1124,7 @@ (define-public clang-runtime-9 (define-public clang-9 (clang-from-llvm llvm-9 clang-runtime-9 "0ls2h3iv4finqyflyhry21qhc9cm9ga7g1zq21020p065qmm2y2p" + #:legacy-build-shared-libs? #t #:patches '("clang-9.0-libc-search-path.patch"))) (define-public libomp-9 @@ -1141,6 +1168,7 @@ (define-public clang-runtime-8 (define-public clang-8 (clang-from-llvm llvm-8 clang-runtime-8 "0ihnbdl058gvl2wdy45p5am55bq8ifx8m9mhcsgj9ax8yxlzvvvh" + #:legacy-build-shared-libs? #t #:patches '("clang-8.0-libc-search-path.patch"))) (define-public libomp-8 @@ -1183,6 +1211,7 @@ (define-public clang-runtime-7 (define-public clang-7 (clang-from-llvm llvm-7 clang-runtime-7 "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9" + #:legacy-build-shared-libs? #t #:patches '("clang-7.0-libc-search-path.patch"))) (define-public libomp-7 @@ -1224,6 +1253,7 @@ (define-public clang-runtime-6 (define-public clang-6 (clang-from-llvm llvm-6 clang-runtime-6 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w" + #:legacy-build-shared-libs? #t #:patches '("clang-6.0-libc-search-path.patch"))) (define-public libomp-6 @@ -1285,6 +1315,7 @@ (define-public clang-runtime-3.9.1 (define-public clang-3.9.1 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76" + #:legacy-build-shared-libs? #t #:patches '("clang-3.8-libc-search-path.patch"))) (define-public llvm-3.8 @@ -1311,6 +1342,7 @@ (define-public clang-runtime-3.8 (define-public clang-3.8 (clang-from-llvm llvm-3.8 clang-runtime-3.8 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc" + #:legacy-build-shared-libs? #t #:patches '("clang-3.8-libc-search-path.patch"))) (define-public llvm-3.7 @@ -1337,6 +1369,7 @@ (define-public clang-runtime-3.7 (define-public clang-3.7 (clang-from-llvm llvm-3.7 clang-runtime-3.7 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn" + #:legacy-build-shared-libs? #t #:patches '("clang-3.5-libc-search-path.patch"))) (define-public llvm-3.6 @@ -1396,6 +1429,7 @@ (define-public clang-runtime-3.5 (define-public clang-3.5 (clang-from-llvm llvm-3.5 clang-runtime-3.5 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg" + #:legacy-build-shared-libs? #t #:patches '("clang-3.5-libc-search-path.patch"))) ;; Default LLVM and Clang version. From patchwork Wed Nov 16 14:18:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44544 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 312FE27BBEC; Wed, 16 Nov 2022 14:20:18 +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 CD79327BBE9 for ; Wed, 16 Nov 2022 14:20:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJFs-0000Ey-RI; Wed, 16 Nov 2022 09:19:08 -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 1ovJFp-0000Ac-99 for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:05 -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 1ovJFn-0000ZJ-VA for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovJFn-0001Ut-QE for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH v2 4/5] gnu: Add libomp-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 14:19: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: ludo@gnu.org, Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.16686083355701 (code B ref 59237); Wed, 16 Nov 2022 14:19:03 +0000 Received: (at 59237) by debbugs.gnu.org; 16 Nov 2022 14:18:55 +0000 Received: from localhost ([127.0.0.1]:56452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFe-0001To-OB for submit@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:55 -0500 Received: from mail-qk1-f173.google.com ([209.85.222.173]:43963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFa-0001T0-KS for 59237@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:51 -0500 Received: by mail-qk1-f173.google.com with SMTP id i9so11651912qki.10 for <59237@debbugs.gnu.org>; Wed, 16 Nov 2022 06:18:50 -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=knewoYUPye4EtPrsR2bfKapncUD9H0L6/PE2F3FfYLY=; b=VtPtzjydrwV+TDDpi/KuWwJGq+C+O1YMqYt1IldiN3wJxVO0Ic9CKjb4igZyqGgG5c GeDx4/lk8ollmkkhsw4xcsqqsU0Gc4x+WCkCrbuoW0/kcCuiR46EAsnm7pRMPYtfYdJT neK4IwXyQRHCfzTpvMx8t08zYIDbhL8rSYxUBUWaRS/Vecx+cLIv2Wz3kEm23q/cvTCp pUx8J46yc3PTBMJKfzjvds4pexwIOiFpmPpShTtEdmPRNGDNHyodvC5HbMS2qHPFjqJF 4g33y1bfHEgWr/jxZgPH7xLloMdOCcsYB5aJBV11yAT8E50tVCTAKJgMrVnr6bTBx2hb 7dNQ== 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=knewoYUPye4EtPrsR2bfKapncUD9H0L6/PE2F3FfYLY=; b=s+2mKwe3v4JYaGTtKfSVmJe8tIy+FOOdPidCfsmTNFNwCDxG39WWpN+ptHQIR+RQL2 frv42O74HjhhkcKlTB4k8wPbeRGYNMxOnujdnrH495dwSpKDLrBNRf7bhnawBJwhsDrq ZzJCa1G+yF8hjOLbQXzCM4VshdZzSwklcvf/zUzhA4Ey/LQtzOlzRYX7JWkul7sTrRmR S5vlQJ/eDBMJiSiyKaHj3qWA/V0n+FuaZlYKJmrrhTT49RUMYq/krRtd2kb1O6uXkkxp uSYkYNwh6KeOAefbTNG81oov8voazBSrmzVWAQt70+p7BpjVEwBuig2/FYhFUt84rDUq K4zw== X-Gm-Message-State: ANoB5pldZJz1OzjcB62IuUTlrWwflMbifsm6SmqS8jHRGlsgMrNY7ymP tZBeSGH4pccJUqQTUjsIcipW6gykYlkBVg== X-Google-Smtp-Source: AA0mqf6kUtBG+Yd56zwtJwVkQSBBlRgXLoDGpIUmg1bQfH6r6YuxGU3jMq9eINhI2hUfhw9q94SwYw== X-Received: by 2002:a37:a902:0:b0:6fa:2bd2:897f with SMTP id s2-20020a37a902000000b006fa2bd2897fmr19293451qke.87.1668608324969; Wed, 16 Nov 2022 06:18:44 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id n16-20020a05620a295000b006b640efe6dasm10006660qkp.132.2022.11.16.06.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:18:44 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 09:18:29 -0500 Message-Id: <20221116141830.12398-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116141830.12398-1-maxim.cournoyer@gmail.com> References: <20221116141830.12398-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 (libomp-15): New variable. (libomp-14): Inherit from it. [arguments]: Use substitute-keyword-arguments and override the chdir-to-source-and-install-license phase. Remove redundant fields. --- gnu/packages/llvm.scm | 75 ++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 2b958b060e..528c2bc359 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -755,10 +755,44 @@ (define-public clang-14 (base32 "0rhq4wkmvr369nkk059skzzw7jx6qhzqhmiwmqg4sp66avzviwvw"))))) +(define-public libomp-15 + (package + (name "libomp") + (version (package-version llvm-15)) + (source (llvm-monorepo version)) + (build-system cmake-build-system) + ;; XXX: Note this gets built with GCC because building with Clang itself + ;; fails (missing , even when libcxx is added as an input.) + (arguments + (list + #:configure-flags + #~(list "-DLIBOMP_USE_HWLOC=ON" + "-DOPENMP_TEST_C_COMPILER=clang" + "-DOPENMP_TEST_CXX_COMPILER=clang++") + #:test-target "check-libomp" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir-to-source-and-install-license + (lambda _ + (chdir "openmp") + (install-file "LICENSE.TXT" + (string-append #$output "/share/doc"))))))) + (native-inputs (list clang-15 llvm-15 perl pkg-config python)) + (inputs (list `(,hwloc "lib"))) + (home-page "https://openmp.llvm.org") + (synopsis "OpenMP run-time support library") + (description "This package provides the run-time support library developed +by the LLVM project for the OpenMP multi-theaded programming extension. This +package notably provides @file{libgomp.so}, which is has a binary interface +compatible with that of libgomp, the GNU Offloading and Multi Processing +Library.") + (properties `((release-monitoring-url . ,%llvm-release-monitoring-url) + (upstream-name . "openmp"))) + (license license:expat))) (define-public libomp-14 (package - (name "libomp") + (inherit libomp-15) (version (package-version llvm-14)) (source (origin (method url-fetch) @@ -767,36 +801,19 @@ (define-public libomp-14 (base32 "07zby3gwy5c8jssabrhjk3nsxlwipnm6sk4dsvck1l5d0br1ywsg")) (file-name (string-append "libomp-" version ".tar.xz")))) - (build-system cmake-build-system) - ;; XXX: Note this gets built with GCC because building with Clang itself - ;; fails (missing , even when libcxx is added as an input.) (arguments - (list - #:configure-flags #~(list "-DLIBOMP_USE_HWLOC=ON" - "-DOPENMP_TEST_C_COMPILER=clang" - "-DOPENMP_TEST_CXX_COMPILER=clang++") - #:test-target "check-libomp" - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'chdir-to-source-and-install-license - (lambda _ - (chdir #$(string-append "../openmp-" version ".src")) - (install-file "LICENSE.TXT" - (string-append #$output "/share/doc"))))))) + (substitute-keyword-arguments (package-arguments libomp-15) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'chdir-to-source-and-install-license + (lambda _ + (chdir #$(string-append "../openmp-" version ".src")) + (install-file "LICENSE.TXT" + (string-append #$output "/share/doc")))))))) (native-inputs - (list clang-14 llvm-14 perl pkg-config python)) - (inputs - (list `(,hwloc "lib"))) - (home-page "https://openmp.llvm.org") - (synopsis "OpenMP run-time support library") - (description - "This package provides the run-time support library developed by the LLVM -project for the OpenMP multi-theaded programming extension. This package -notably provides @file{libgomp.so}, which is has a binary interface compatible -with that of libgomp, the GNU Offloading and Multi Processing Library.") - (properties `((release-monitoring-url . ,%llvm-release-monitoring-url) - (upstream-name . "openmp"))) - (license license:expat))) + (modify-inputs (package-native-inputs libomp-15) + (replace "clang" clang-14) + (replace "llvm" llvm-14))))) (define-public clang-toolchain-14 (make-clang-toolchain clang-14 libomp-14)) From patchwork Wed Nov 16 14:18:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 44543 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 46A4127BBE9; Wed, 16 Nov 2022 14:20:06 +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 35CFA27BBEC for ; Wed, 16 Nov 2022 14:20:05 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJFr-0000DG-EU; Wed, 16 Nov 2022 09:19: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 1ovJFp-0000Ab-93 for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:05 -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 1ovJFo-0000ZO-DF for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovJFo-0001V0-8z for guix-patches@gnu.org; Wed, 16 Nov 2022 09:19:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59237] [PATCH v2 5/5] gnu: Add clang-toolchain-15. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 14:19:04 +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: ludo@gnu.org, Maxim Cournoyer Received: via spool by 59237-submit@debbugs.gnu.org id=B59237.16686083405718 (code B ref 59237); Wed, 16 Nov 2022 14:19:04 +0000 Received: (at 59237) by debbugs.gnu.org; 16 Nov 2022 14:19:00 +0000 Received: from localhost ([127.0.0.1]:56455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFk-0001UA-9G for submit@debbugs.gnu.org; Wed, 16 Nov 2022 09:19:00 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:34304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovJFf-0001TQ-L9 for 59237@debbugs.gnu.org; Wed, 16 Nov 2022 09:18:55 -0500 Received: by mail-qk1-f182.google.com with SMTP id 8so11683214qka.1 for <59237@debbugs.gnu.org>; Wed, 16 Nov 2022 06:18:55 -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=47SO+yKgOa0+K4I/b+mWleiouqs1T+PbRe2zeVC0bAg=; b=M46mlGRzl14oJw/UOJqn5sP/Li4CIwHqN0MZsVipOIa/rFQd/RSoWxCo34EbzIHP4r u6UogBh/GKNFpAeT/DOAu3awGokjRNpfRjHxwpTim6oC5Xvj6NgGCYNd/2i4+WbS4BvT nQDbm/GcT7nN22U0nIMvp5ydkS+xIpaJPTwmtIpjQEIgk50FdaSZ77TQZuYaoWL547Sx k9mSglBke73czQ3TZxPmGdZsyHwKedcW8yHHWhV0foII1p7Z+232xrN+FRMWQ/83QoN1 HyR6DBT1+oCZB//c4QpvNa8oZvEatso79HqGzIaqBooaetA93jim8N6mI3XOe+CkKFhz i6TA== 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=47SO+yKgOa0+K4I/b+mWleiouqs1T+PbRe2zeVC0bAg=; b=gj08qTJWUAPgk4AqGnDkDa6acPpKTFh+E5iMuRRi8yonXW0KqEEOEcm3wlPVNluPyx 2oqRLbBhXpUOOxYoL1iNmeER7zn3jmyI1ydX0LS0r6i5OTfPUUxRwnR7r9Kdff51YdNI GO4elWAkzGMZ0bY8ybDa298wLlAr4SWDtpOOujhKWOXDi+0lVgWqAjsNPqMH/PU173Ll upSCBE4vwWGVpv7+CNbJQyTgOcbRHAYSQULm+nZw/dsN1sL1NQKn6t5Vc1/25saDSKDj a+y4QnFV2WtnMy1lopJ4HubPQyRz6pf5v+qrBzqnoITFmkOHy8e5nX00DEKCm1JUsuzU XmHA== X-Gm-Message-State: ANoB5pmU8VJDdOx++Y+g2oKHV1Rf+C/aiWCBc5TlzLCis5hGJ9Mb1JQp sFQQZV19cSqfO4OKYy1HXU0ZxNo2ZW9hdw== X-Google-Smtp-Source: AA0mqf79rqkS1f9IOh0+Y9A9uEUlTVysbO8/jKjGjlP8/hRSJ9Mqa6yvauF4LJikYoEJ/1lm+rWx6Q== X-Received: by 2002:ae9:eb4d:0:b0:6fa:35d5:eb25 with SMTP id b74-20020ae9eb4d000000b006fa35d5eb25mr18754268qkg.400.1668608326066; Wed, 16 Nov 2022 06:18:46 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id n16-20020a05620a295000b006b640efe6dasm10006660qkp.132.2022.11.16.06.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:18:45 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 09:18:30 -0500 Message-Id: <20221116141830.12398-6-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116141830.12398-1-maxim.cournoyer@gmail.com> References: <20221116141830.12398-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-toolchain-15): New variable. --- gnu/packages/llvm.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 528c2bc359..d315149c42 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -790,6 +790,9 @@ (define-public libomp-15 (upstream-name . "openmp"))) (license license:expat))) +(define-public clang-toolchain-15 + (make-clang-toolchain clang-15 libomp-15)) + (define-public libomp-14 (package (inherit libomp-15)