[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/09: transformations: Add support for zig.
From: |
guix-commits |
Subject: |
08/09: transformations: Add support for zig. |
Date: |
Sun, 3 Dec 2023 03:09:44 -0500 (EST) |
efraim pushed a commit to branch master
in repository guix.
commit 2cc6e09a03c34da832b360fe4e848a9339d9360b
Author: Ekaitz Zarraga <ekaitz@elenq.tech>
AuthorDate: Sat Nov 18 17:51:09 2023 +0100
transformations: Add support for zig.
* guix/transformations.scm (tuning-compiler): Add support for zig.
Change-Id: I40bd28071c97c0dd0a907c704072b52b26d2de28
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
guix/transformations.scm | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/guix/transformations.scm b/guix/transformations.scm
index 9cba6bedab..132ccd957a 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2023 Sarthak Shah <shahsarthakw@gmail.com>
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2023 Ekaitz Zarraga <ekaitz@elenq.tech>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -439,7 +440,8 @@ the equal sign."
actual compiler."
(define wrapper
#~(begin
- (use-modules (ice-9 match))
+ (use-modules (ice-9 match)
+ (ice-9 string-fun))
(define psabi #$(gcc-architecture->micro-architecture-level
micro-architecture))
@@ -486,11 +488,20 @@ actual compiler."
(apply
execl next
(append (cons next arguments)
- (if (and (search-next "go")
- (string=? next (search-next "go")))
- '()
- (list (string-append "-march="
- #$micro-architecture)))))))))))
+ (cond
+ ((and (search-next "go")
+ (string=? next (search-next "go")))
+ '())
+ ((and (search-next "zig")
+ (string=? next (search-next "zig")))
+ `(,(string-append
+ ;; https://issues.guix.gnu.org/67075#3
+ "-Dcpu="
+ (string-replace-substring
+ #$micro-architecture "-" "_"))))
+ (else
+ (list (string-append "-march="
+
#$micro-architecture))))))))))))
(define program
(program-file (string-append "tuning-compiler-wrapper-"
micro-architecture)
@@ -508,7 +519,7 @@ actual compiler."
(symlink #$program
(string-append bin "/" program)))
'("cc" "gcc" "clang" "g++" "c++" "clang++"
- "go")))))))
+ "go" "zig")))))))
(define (build-system-with-tuning-compiler bs micro-architecture)
"Return a variant of BS, a build system, that ensures that the compiler that
- branch master updated (06ebc45e15 -> 8267a3a206), guix-commits, 2023/12/03
- 01/09: gnu: ldc: Enable building on more architectures., guix-commits, 2023/12/03
- 02/09: gnu: python-lit: Update to 17.0.6., guix-commits, 2023/12/03
- 07/09: gnu: zig: Add tuning information., guix-commits, 2023/12/03
- 04/09: gnu: zig: Build with baseline cpu by default., guix-commits, 2023/12/03
- 05/09: gnu: ncdu-2: Remove redundant make-flag., guix-commits, 2023/12/03
- 08/09: transformations: Add support for zig.,
guix-commits <=
- 09/09: gnu: ncdu-2: Mark as tunable., guix-commits, 2023/12/03
- 03/09: gnu: ldc: Update to 1.35.0., guix-commits, 2023/12/03
- 06/09: gnu: llvm: Export clang-properties., guix-commits, 2023/12/03