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.
This commit is contained in:
Mark H Weaver 2014-12-31 04:17:45 -05:00
parent 76e639a00f
commit 24aaf2f257
4 changed files with 36 additions and 3 deletions

View File

@ -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 \

View File

@ -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)

View File

@ -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

View File

@ -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" \