projects/guix·blob java-team · refs

107 lines · 5.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 Ludovic Courtès <[email protected]>
3;;; Copyright © 2024, 2026 Efraim Flashner <[email protected]>
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages llvm-meta)
21 #:use-module (guix utils)
22 #:use-module (srfi srfi-1)
23 #:export (clang-compiler-cpu-architectures))
24
25(define (clang-compiler-cpu-architectures version)
26 "Return package properties for Clang VERSION."
27 `((compiler-cpu-architectures
28 ;; These lists were obtained by running:
29 ;;
30 ;; guix shell clang -- llc -march=x86-64 -mattr=help
31 ;;
32 ;; and then filtering against clang/test/Misc/target-invalid-cpu-note.c
33 ("powerpc64le"
34 ,@(cond
35 ((version>=? version "19.0")
36 '("power8" "power9" "power10" "power11" "powerpc64le"))
37 ((version>=? version "11.0")
38 '("power8" "power9" "power10" "powerpc64le"))
39 (else '())))
40 ("x86_64"
41 ,@(let* ((clang-23-cpu-architectures
42 '("nocona" "core2" "penryn" "bonnell" "atom" "silvermont"
43 "slm" "goldmont" "goldmont-plus" "tremont" "nehalem"
44 "corei7" "westmere" "sandybridge" "corei7-avx" "ivybridge"
45 "core-avx-i" "haswell" "core-avx2" "broadwell" "skylake"
46 "skylake-avx512" "skx" "cascadelake" "cooperlake"
47 "cannonlake" "icelake-client" "rocketlake" "icelake-server"
48 "tigerlake" "sapphirerapids" "alderlake" "raptorlake"
49 "arrowlake" "arrowlake-s" "lunarlake" "gracemont"
50 "pantherlake" "meteorlake" "wildcatlake" "novalake"
51 "sierraforest" "grandridge" "graniterapids"
52 "graniterapids-d" "emeraldrapids" "clearwaterforest"
53 "diamondrapids" "knl" "knm"
54
55 "k8" "athlon64" "athlon-fx" "opteron" "k8-sse3"
56 "athlon64-sse3" "opteron-sse3" "amdfam10" "barcelona"
57 "btver1" "btver2" "bdver1" "bdver2" "bdver3" "bdver4"
58 "znver1" "znver2" "znver3" "znver4" "znver5" "znver6"
59
60 "c86-4g-m4" "c86-4g-m6" "c86-4g-m7" "c86-4g-m8"
61
62 "x86-64" "x86-64-v2" "x86-64-v3" "x86-64-v4"))
63 (clang-22-cpu-architectures
64 (fold delete clang-23-cpu-architectures
65 '("znver6" "c86-4g-m4" "c86-4g-m6" "c86-4g-m7"
66 "c86-4g-m8")))
67 (clang-20-cpu-architectures
68 (fold delete clang-22-cpu-architectures
69 '("wildcatlake" "novalake")))
70 (clang-19-cpu-architectures
71 (delete "diamondrapids" clang-20-cpu-architectures))
72 (clang-18-cpu-architectures
73 (delete "znver5" clang-19-cpu-architectures))
74 (clang-17-cpu-architectures
75 (fold delete clang-18-cpu-architectures
76 '("arrowlake" "arrowlake-s" "lunarlake" "gracemont"
77 "pantherlake" "clearwaterforest")))
78 (clang-16-cpu-architectures
79 (delete "graniterapids-d" clang-17-cpu-architectures))
80 (clang-13-cpu-architectures
81 (fold delete clang-16-cpu-architectures
82 '("raptorlake" "meteorlake" "sierraforest" "grandridge"
83 "graniterapids" "emeraldrapids" "znver4")))
84 (clang-9-cpu-architectures
85 (fold delete clang-13-cpu-architectures
86 '("rocketlake" "tigerlake" "sapphirerapids" "alderlake"
87 "znver3" "x86-64-v2" "x86-64-v3" "x86-64-v4"))))
88 (cond
89 ((version>=? version "23.0")
90 clang-23-cpu-architectures)
91 ((version>=? version "22.0")
92 clang-22-cpu-architectures)
93 ((version>=? version "20.0")
94 clang-20-cpu-architectures)
95 ((version>=? version "19.0")
96 clang-19-cpu-architectures)
97 ((version>=? version "18.0")
98 clang-18-cpu-architectures)
99 ((version>=? version "17.0")
100 clang-17-cpu-architectures)
101 ((version>=? version "16.0")
102 clang-16-cpu-architectures)
103 ((version>=? version "13.0")
104 clang-13-cpu-architectures)
105 ((version>=? version "9.0")
106 clang-9-cpu-architectures)
107 (else '())))))))