diff options
author | Mark H Weaver <mhw@netris.org> | 2014-12-31 04:17:45 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-01-07 12:34:19 -0500 |
commit | 24aaf2f257e6b611d3759ffc53c29828efce1917 (patch) | |
tree | aaf7c0355f43ad403b88037cfe30e348fe66b5e4 /gnu | |
parent | 76e639a00fecb194e2fefc267e2e97c5845434b2 (diff) | |
download | patches-24aaf2f257e6b611d3759ffc53c29828efce1917.tar patches-24aaf2f257e6b611d3759ffc53c29828efce1917.tar.gz |
gnu: gmp: Apply fixes for armhf.
* gnu/packages/patches/gmp-arm-asm-nothumb.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/multiprecision.scm (gmp): Add patch. Include --build triplet
in configure args when building natively.
* gnu/packages/commencement.scm (gcc-final): Use bootstrap guile to
build gmp-source.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/commencement.scm | 2 | ||||
-rw-r--r-- | gnu/packages/multiprecision.scm | 15 | ||||
-rw-r--r-- | gnu/packages/patches/gmp-arm-asm-nothumb.patch | 21 |
3 files changed, 35 insertions, 3 deletions
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e6d03b184f..8fa90fed3f 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -531,7 +531,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (native-inputs `(("texinfo" ,texinfo-boot0) ,@(package-native-inputs gcc-boot0))) - (inputs `(("gmp-source" ,(package-source gmp)) + (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp))) ("mpfr-source" ,(package-source mpfr)) ("mpc-source" ,(package-source mpc)) ("binutils" ,binutils-final) diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index 377d922a09..ddbfc79965 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,7 @@ #:use-module (gnu packages m4) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu)) (define-public gmp @@ -35,7 +37,8 @@ version ".tar.xz")) (sha256 (base32 - "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli")))) + "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli")) + (patches (list (search-patch "gmp-arm-asm-nothumb.patch"))))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4))) (outputs '("out" "debug")) @@ -43,7 +46,15 @@ '(;; Build a "fat binary", with routines for several ;; sub-architectures. "--enable-fat" - "--enable-cxx"))) + "--enable-cxx" + + ;; FIXME: gmp-6.0.0a's config.guess fails on + ;; multi-core armhf systems. + ,@(if (%current-target-system) + '() + (let ((triplet + (nix-system->gnu-triplet (%current-system)))) + (list (string-append "--build=" triplet))))))) (synopsis "Multiple-precision arithmetic library") (description "GMP is a library for arbitrary precision arithmetic, operating on diff --git a/gnu/packages/patches/gmp-arm-asm-nothumb.patch b/gnu/packages/patches/gmp-arm-asm-nothumb.patch new file mode 100644 index 0000000000..666cf58cf6 --- /dev/null +++ b/gnu/packages/patches/gmp-arm-asm-nothumb.patch @@ -0,0 +1,21 @@ + +# HG changeset patch +# User Torbjorn Granlund <tege@gmplib.org> +# Date 1396602422 -7200 +# Node ID 676e2d0f0e4dd301a7066079d2c9326c25c34a40 +# Parent 0194a75b56b21a9196626430af86c5bd9110c42d +Conditionalise ARM asm on !__thumb__. + +diff -r 0194a75b56b2 -r 676e2d0f0e4d mpn/generic/div_qr_1n_pi1.c +--- a/mpn/generic/div_qr_1n_pi1.c Thu Apr 03 23:58:51 2014 +0200 ++++ b/mpn/generic/div_qr_1n_pi1.c Fri Apr 04 11:07:02 2014 +0200 +@@ -130,7 +130,7 @@ + "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC) + #endif + +-#if defined (__arm__) && W_TYPE_SIZE == 32 ++#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32 + #define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \ + __asm__ ( "adds %2, %5, %6\n\t" \ + "adcs %1, %3, %4\n\t" \ + |