[SCM] Debian packaging for libntl - Number Theory Library branch, master, updated. 725690a74333b49e1096467192cc414183237986

Bernhard R. Link brlink at debian.org
Fri Feb 3 21:15:30 UTC 2012


The following commit has been merged in the master branch:
commit 7f47300bb630f1c47c9abb471bb1629db55465b2
Merge: 46158a632f43edb2de2a2a0d3316f830b6801fa3 657ad2a8f5e44518df3907208157303dae478898
Author: Bernhard R. Link <brlink at debian.org>
Date:   Fri Feb 3 16:40:45 2012 +0100

    import sage patch to virtual patched branch and apply

diff --combined debian/.git-dpm
index 837d844,0000000..9b5ecdc
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,8 @@@
 +# see git-dpm(1) from git-dpm package
- bb874fb2c2b38bfb5781d935e9e0905125771e94
- 167bf8e15c7475babc0782c2fe8b3af5bcf1ddbd
++657ad2a8f5e44518df3907208157303dae478898
++657ad2a8f5e44518df3907208157303dae478898
 +234ecb0054229e0458d9bfaa3c8672e84ff8f477
 +234ecb0054229e0458d9bfaa3c8672e84ff8f477
 +libntl_5.5.2.orig.tar.gz
 +b45e3858f7f351afeb7fbb831b256befc4892b06
 +707247
diff --combined debian/patches/0001-gcc-4.5-mips.patch
index 031692b,0000000..e196c05
mode 100644,000000..100644
--- a/debian/patches/0001-gcc-4.5-mips.patch
+++ b/debian/patches/0001-gcc-4.5-mips.patch
@@@ -1,48 -1,0 +1,48 @@@
- From bb874fb2c2b38bfb5781d935e9e0905125771e94 Mon Sep 17 00:00:00 2001
++From 167bf8e15c7475babc0782c2fe8b3af5bcf1ddbd Mon Sep 17 00:00:00 2001
 +From: Aurelien Jarno <aurel32 at debian.org>
 +Date: Sun, 17 Apr 2011 23:41:31 +0200
 +Subject: gcc-4.5-mips
 +
 +Bug-Debian: 623162
 +
 +Since GCC 4.4 it's not possible anymore to use the 'h' constraints for
 +MIPS inline assembly code when doing a multiplication. That's why sprng
 +fails to build from source on mips and mipsel.
 +
 +That said GCC supports 32x32 => 64 multiplication on 32-bit architecture
 +for a lot of time, so there is no need to use assembly code for that.
 +The patch below fixes the problem by using standard multiplication
 +instead of assembly code. I have also included the code for MIPS64 using
 +128-bit hints for reference (the second hunk), though it is not used in
 +Debian.
 +---
 + include/NTL/SPMM_ASM.h |    9 +++++----
 + 1 files changed, 5 insertions(+), 4 deletions(-)
 +
 +diff --git a/include/NTL/SPMM_ASM.h b/include/NTL/SPMM_ASM.h
 +index dc0bfb9..9ff7942 100644
 +--- a/include/NTL/SPMM_ASM.h
 ++++ b/include/NTL/SPMM_ASM.h
 +@@ -147,8 +147,8 @@ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 + 
 + static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 + {
 +-   unsigned long hi, lo;
 +-   __asm__ ("multu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
 ++   unsigned long hi;
 ++   hi = ((unsigned long long) a * b) >> 32;
 +    return hi;
 + } 
 + 
 +@@ -159,8 +159,9 @@ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 + 
 + static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 + {
 +-   unsigned long hi, lo;
 +-   __asm__ ("dmultu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
 ++   typedef unsigned int uint128_t __attribute__((mode(TI)));
 ++   unsigned long hi;
 ++   hi = ((uint128_t) a * b) >> 64;
 +    return hi;
 + }
 + 
diff --combined debian/patches/0002-a-callback-for-sage.patch
index 0000000,0000000..8f9beb3
new file mode 100644
--- /dev/null
+++ b/debian/patches/0002-a-callback-for-sage.patch
@@@ -1,0 -1,0 +1,77 @@@
++From 657ad2a8f5e44518df3907208157303dae478898 Mon Sep 17 00:00:00 2001
++From: Felix Salfelder <salfelder at em.cs.uni-frankfurt.de>
++Date: Thu, 26 Jan 2012 21:34:21 +0100
++Subject: a callback for sage
++
++(from sage-4.7.tar/spkg/ntl/dist/debian)
++
++ We add a SetErrorCallbackFunction(). This sets a global callback function _function_,
++ which gets called with parameter _context_ and an error message string whenever Error()
++ gets called.
++
++ Note that if the custom error handler *returns*, then NTL will dump the error message
++ back to stderr and abort() as it habitually does.
++
++ -- David Harvey (2008-04-12)
++---
++ include/NTL/tools.h |    6 ++++++
++ src/tools.c         |   27 +++++++++++++++++++++++++++
++ 2 files changed, 33 insertions(+), 0 deletions(-)
++
++diff --git a/include/NTL/tools.h b/include/NTL/tools.h
++index 3f32fe7..c4708e8 100644
++--- a/include/NTL/tools.h
+++++ b/include/NTL/tools.h
++@@ -252,6 +252,12 @@ long CharToIntVal(long c);
++ char IntValToChar(long a);
++ 
++ 
+++/*
+++  This function is not present in vanilla NTL 5.4.2.
+++  See tools.c for documentation.
+++ */
+++void SetErrorCallbackFunction(void (*func)(const char *s, void *context), void *context);
+++
++ 
++ void Error(const char *s);
++ 
++diff --git a/src/tools.c b/src/tools.c
++index c617ae1..86af374 100644
++--- a/src/tools.c
+++++ b/src/tools.c
++@@ -18,8 +18,35 @@ NTL_START_IMPL
++ void (*ErrorCallback)() = 0;
++ 
++ 
+++/*
+++   The following code differs from vanilla NTL 5.4.2.
+++
+++   We add a SetErrorCallbackFunction(). This sets a global callback function _function_,
+++   which gets called with parameter _context_ and an error message string whenever Error()
+++   gets called.
+++
+++   Note that if the custom error handler *returns*, then NTL will dump the error message
+++   back to stderr and abort() as it habitually does.
+++
+++   -- David Harvey (2008-04-12)
+++*/
+++
+++void (*ErrorCallbackFunction)(const char*, void*) = NULL;
+++void *ErrorCallbackContext = NULL;
+++
+++
+++void SetErrorCallbackFunction(void (*function)(const char*, void*), void *context)
+++{
+++   ErrorCallbackFunction = function;
+++   ErrorCallbackContext = context;
+++}
+++
+++
++ void Error(const char *s)
++ {
+++   if (ErrorCallbackFunction != NULL)
+++      ErrorCallbackFunction(s, ErrorCallbackContext);
+++
++    cerr << s << "\n";
++    _ntl_abort();
++ }
diff --combined debian/patches/series
index b99e247,0000000..6b8ab4e
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,5 -1,0 +1,2 @@@
 +0001-gcc-4.5-mips.patch
- 
- # this patch is for sage.
- sage_error_callback.patch
- 
++0002-a-callback-for-sage.patch

-- 
Debian packaging for libntl - Number Theory Library



More information about the debian-science-commits mailing list