guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/08: gnu: gmp: Apply fixes for armhf.


From: Mark H. Weaver
Subject: 06/08: gnu: gmp: Apply fixes for armhf.
Date: Fri, 02 Jan 2015 22:13:37 +0000

mhw pushed a commit to branch wip-armhf
in repository guix.

commit c5381e0d5189d327c8814cc7a75b766d2b6e9d4f
Author: Mark H Weaver <address@hidden>
Date:   Wed Dec 31 04:17:45 2014 -0500

    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.
---
 gnu-system.am                                  |    1 +
 gnu/packages/commencement.scm                  |    2 +-
 gnu/packages/multiprecision.scm                |   15 +++++++++++++--
 gnu/packages/patches/gmp-arm-asm-nothumb.patch |   21 +++++++++++++++++++++
 4 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 405c01f..031aeef 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -367,6 +367,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 e6d03b1..8fa90fe 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 
\"address@hidden"~%"
     (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 377d922..ddbfc79 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 <address@hidden>
+;;; Copyright © 2014 Mark H Weaver <address@hidden>
 ;;;
 ;;; 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 0000000..666cf58
--- /dev/null
+++ b/gnu/packages/patches/gmp-arm-asm-nothumb.patch
@@ -0,0 +1,21 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <address@hidden>
+# 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"                                 \
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]