summaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-01-07 15:55:23 -0500
committerMark H Weaver <mhw@netris.org>2015-01-07 16:27:55 -0500
commit3f00ff8b43bfef244e211d1c9bb71132926c1580 (patch)
tree9f8a21681509305477d46e9951ae59e57f1023fc /guix/utils.scm
parentf7d2b496b9a3f613aff50fef1e56d9f3aab99c7b (diff)
downloadpatches-3f00ff8b43bfef244e211d1c9bb71132926c1580.tar
patches-3f00ff8b43bfef244e211d1c9bb71132926c1580.tar.gz
gnu: Add toolchain support for 'armhf-linux'.
Based on preliminary work by John Darrington <john@darrington.wattle.id.au>. * gnu/packages/cross-base.scm (xgcc-armhf): New variable. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add armhf case. (gcc-4.7)[pre-configure]: Add gcc/config/*/linux-eabi.h to the list of files in which to patch GLIBC_DYNAMIC_LINKER. * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add armhf case. * guix/utils.scm (gnu-triplet->nix-system, nix-system->gnu-triplet): Add armhf cases.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r--guix/utils.scm26
1 files changed, 16 insertions, 10 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index 7ac586b0aa..1c619c3ef9 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2013, 2014, 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
;;;
@@ -481,14 +481,18 @@ previous value of the keyword argument."
#:optional (system (%current-system)) (vendor "unknown"))
"Return a guess of the GNU triplet corresponding to Nix system
identifier SYSTEM."
- (let* ((dash (string-index system #\-))
- (arch (substring system 0 dash))
- (os (substring system (+ 1 dash))))
- (string-append arch
- "-" vendor "-"
- (if (string=? os "linux")
- "linux-gnu"
- os))))
+ (match system
+ ("armhf-linux"
+ (string-append "arm-" vendor "-linux-gnueabihf"))
+ (_
+ (let* ((dash (string-index system #\-))
+ (arch (substring system 0 dash))
+ (os (substring system (+ 1 dash))))
+ (string-append arch
+ "-" vendor "-"
+ (if (string=? os "linux")
+ "linux-gnu"
+ os))))))
(define (gnu-triplet->nix-system triplet)
"Return the Nix system type corresponding to TRIPLET, a GNU triplet as
@@ -498,7 +502,9 @@ returned by `config.guess'."
(lambda (m)
(string-append "i686-" (match:substring m 1))))
(else triplet))))
- (cond ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet)
+ (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet)
+ "armhf-linux")
+ ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet)
=>
(lambda (m)
;; Nix omits `-gnu' for GNU/Linux.