From patchwork Thu Dec 16 17:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35284 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 DBA9E27BBEA; Thu, 16 Dec 2021 17:59: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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 265DB27BBE9 for ; Thu, 16 Dec 2021 17:59:30 +0000 (GMT) Received: from localhost ([::1]:42640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2P-0008Kh-B6 for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007ea-DQ for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007yx-4x for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1z-0006kT-4P for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 03/12] gnu: clang: Add 'compiler-cpu-architectures' property. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525876 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006jC-7v for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1l-0006hm-CN for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from [2001:470:142:3::e] (port=44364 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0007tB-2K; Thu, 16 Dec 2021 12:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=akp4J/T/ngJSGbARlTwRHi1VKqG5dsx9Z4tiXpIvQ04=; b=RnSyYadA6ypm4+a+Iujf b7Wwmkgq+/PMwgIZ50DCDuhJ8FDFFpZ/9CwrPS1cgxL1KXvqzxRfnHs+7sYmYx8HQ2nUVrj5aueAM JJSBvQWvpNhQYh173qvDLuVp8B/sm3oCDSg8+KW+Ux/2Cyjo4Duyxq0sqT0mGpRsAqInB8N856kb0 BF0CbFD2LUKHB5KtI19y+PGE3OuFC84mdZBgtxJ+xFl6hro9uzSYwt15XVN9UofKZuxbyfdX8tsPr uY2WEx7rIhMqcHRqmLQWe9NJkcuF8SEoGhsn1meNajTccg+4J9ih1TseK62y2PaD5awpOy2HpIHpm YeqEbcG085HO3A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0000YX-1i; Thu, 16 Dec 2021 12:58:44 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:18 +0100 Message-Id: <20211216175827.2077-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/llvm.scm (clang-from-llvm): Add #:properties and honor it. (clang-properties): New procedures. (make-clang-toolchain): Set 'properties' field. --- gnu/packages/llvm.scm | 71 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 051bbfeab5..d87ab570ff 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -155,7 +155,9 @@ (define* (clang-runtime-from-llvm llvm hash (supported-systems (delete "mips64el-linux" %supported-systems)))) (define* (clang-from-llvm llvm clang-runtime hash - #:key (patches '()) tools-extra) + #:key (patches '()) tools-extra + (properties + (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', @@ -426,10 +428,76 @@ (define (move program) Objective-C++ programming languages. It uses LLVM as its back end. The Clang project includes the Clang front end, the Clang static analyzer, and several code analysis tools.") + (properties properties) (license (if (version>=? version "9.0") license:asl2.0 ;with LLVM exceptions license:ncsa)))) +(define (clang-properties version) + "Return package properties for Clang VERSION." + `((compiler-cpu-architectures + ("x86_64" + ;; This list was obtained by running: + ;; + ;; guix shell clang -- llc -march=x86-64 -mattr=help + ;; + ;; filtered from uninteresting entries such as "i686" and "pentium". + ,@(if (version>=? version "10.0") ;TODO: refine + '("atom" + "barcelona" + "bdver1" + "bdver2" + "bdver3" + "bdver4" + "bonnell" + "broadwell" + "btver1" + "btver2" + "c3" + "c3-2" + "cannonlake" + "cascadelake" + "cooperlake" + "core-avx-i" + "core-avx2" + "core2" + "corei7" + "corei7-avx" + "generic" + "geode" + "goldmont" + "goldmont-plus" + "haswell" + "icelake-client" + "icelake-server" + "ivybridge" + "k8" + "k8-sse3" + "knl" + "knm" + "lakemont" + "nehalem" + "nocona" + "opteron" + "opteron-sse3" + "sandybridge" + "silvermont" + "skx" + "skylake" + "skylake-avx512" + "slm" + "tigerlake" + "tremont" + "westmere" + "x86-64" + "x86-64-v2" + "x86-64-v3" + "x86-64-v4" + "znver1" + "znver2" + "znver3") + '()))))) + (define (make-clang-toolchain clang) (package (name (string-append (package-name clang) "-toolchain")) @@ -471,6 +539,7 @@ (define (make-clang-toolchain clang) (search-paths (package-search-paths clang)) (license (package-license clang)) + (properties (package-properties clang)) ;for 'compiler-cpu-architectures' (home-page "https://clang.llvm.org") (synopsis "Complete Clang toolchain for C/C++ development") (description "This package provides a complete Clang toolchain for C/C++