diff --git a/gnu-system.am b/gnu-system.am index 03b4134019..840b76437f 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -372,6 +372,7 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch \ + gnu/packages/patches/gmp-arm-asm-nothumb.patch \ gnu/packages/patches/gnunet-fix-scheduler.patch \ gnu/packages/patches/gnunet-fix-tests.patch \ gnu/packages/patches/gobject-introspection-cc.patch \ 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 @@ (define-public gcc-final (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 +;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,7 @@ (define-module (gnu packages multiprecision) #: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 @@ (define-public gmp 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 @@ (define-public gmp '(;; 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 +# 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" \ +