diff options
author | Mark H Weaver <mhw@netris.org> | 2015-01-07 15:55:23 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-01-07 16:27:55 -0500 |
commit | 3f00ff8b43bfef244e211d1c9bb71132926c1580 (patch) | |
tree | 9f8a21681509305477d46e9951ae59e57f1023fc /gnu | |
parent | f7d2b496b9a3f613aff50fef1e56d9f3aab99c7b (diff) | |
download | gnu-guix-3f00ff8b43bfef244e211d1c9bb71132926c1580.tar gnu-guix-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 'gnu')
-rw-r--r-- | gnu/packages/bootstrap.scm | 1 | ||||
-rw-r--r-- | gnu/packages/cross-base.scm | 7 | ||||
-rw-r--r-- | gnu/packages/gcc.scm | 15 |
3 files changed, 20 insertions, 3 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index f1110d9cf0..e1b50a1e4f 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -162,6 +162,7 @@ successful, or false to signal an error." "Return the name of Glibc's dynamic linker for SYSTEM." (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2") + ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3") ((string=? system "mips64el-linux") "/lib/ld.so.1") ;; XXX: This one is used bare-bones, without a libc, so add a case diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index a9ae5ee333..794d925841 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -322,6 +323,12 @@ XBINUTILS and the cross tool chain." ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware. (cross-gcc "xtensa-elf")) +(define-public xgcc-armhf + (let ((triplet "arm-linux-gnueabihf")) + (cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet)))) + ;; (define-public xgcc-armel ;; (let ((triplet "armel-linux-gnueabi")) ;; (cross-gcc triplet diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 0e507576fd..276b986331 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -46,8 +46,17 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; Triplets recognized by glibc as denoting the N64 ABI; see ;; ports/sysdeps/mips/preconfigure. '("--with-abi=64")) + + ((string-match "^arm.*-gnueabihf$" target) + '("--with-arch=armv7-a" + "--with-float=hard" + "--with-mode=thumb" + + ;; See <https://wiki.debian.org/ArmHardFloatPort/VfpComparison#FPU> + "--with-fpu=vfpv3-d16")) + (else - ;; TODO: Add `armel.*gnueabi', `hf', etc. + ;; TODO: Add `arm.*-gnueabi', etc. '()))) (define-public gcc-4.7 @@ -184,14 +193,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC (for-each (lambda (x) (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) line))) '(1 2 3)) ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" suffix |