diff options
author | Guillaume Le Vaillant <glv@posteo.net> | 2024-01-10 13:27:11 +0100 |
---|---|---|
committer | Guillaume Le Vaillant <glv@posteo.net> | 2024-01-10 14:04:40 +0100 |
commit | 749c3e016a4297d2794cbebac0e07297d19b4ffd (patch) | |
tree | 59b0c93bcaa9ad6d53fd73d2627231e5f0cf9320 /guix/utils.scm | |
parent | ea832b44b79fb06bac88679029773006fea15827 (diff) | |
parent | 537768018ee03a6a9a5562022a16b47ac287d131 (diff) |
Merge branch 'master' into lisp-team
Change-Id: I6c2ce53e782a00861c3adf01c2505099daef7728
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 8e71f97e1c..e4e9d922e7 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -7,7 +7,7 @@ ;;; Copyright © 2015 David Thompson <davet@gnu.org> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2018, 2020 Marius Bakke <marius@gnu.org> -;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2020, 2021, 2024 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com> ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com> @@ -97,6 +97,7 @@ target-x86-32? target-x86-64? target-x86? + target-x32? target-arm32? target-aarch64? target-arm? @@ -634,6 +635,8 @@ returned by `config.guess'." (else triplet)))) (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet) "armhf-linux") + ;; Otherwise it will show up as x86_64-linux... which isn't wrong. + ((string-match "x86_64-linux-gnux32" triplet) "x86_64-linux-gnux32") ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) => (lambda (m) @@ -710,6 +713,13 @@ a character other than '@'." architecture (x86_64)?" (string-prefix? "x86_64-" target)) +(define* (target-x32? #:optional (target (or (%current-target-system) + (%current-system)))) + "Is the architecture of TARGET a variant of Intel/AMD's 64-bit +architecture (x86_64) using 32-bit data types?" + (and (target-x86-64? target) + (string-suffix? "gnux32" target))) + (define* (target-x86? #:optional (target (or (%current-target-system) (%current-system)))) (or (target-x86-32? target) (target-x86-64? target))) |