[singular] 01/03: Re-import spkg-install from Sage 7.3; fixes a segfault on GCC 6

Ximin Luo infinity0 at debian.org
Sat Oct 8 02:47:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master3-sage
in repository singular.

commit 1974a84d3febb54a27a0fa0be895a5519785bab4
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sat Oct 8 04:27:20 2016 +0200

    Re-import spkg-install from Sage 7.3; fixes a segfault on GCC 6
---
 debian/spkg-install                        | 19 +++++++++++++------
 debian/{spkg-install => spkg-install.orig} | 18 +++++++++++++-----
 2 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/debian/spkg-install b/debian/spkg-install
index fd98e66..093876d 100755
--- a/debian/spkg-install
+++ b/debian/spkg-install
@@ -88,6 +88,8 @@ fi
 # parallel sometimes fails (Trac #17774)
 export MAKE="$MAKE -j1"
 
+# Workaround for GCC6: https://trac.sagemath.org/ticket/20926
+export CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-strict-overflow"
 
 choose_patches()
 {
@@ -106,8 +108,11 @@ choose_patches()
 
 apply_patches()
 {
+    # cd down to the root of src/
+    cd ..
+
     # Apply all patches
-    for patch in "$PATCHES"/*.patch; do
+    for patch in ../patches/*.patch; do
         [ -r "$patch" ] || continue  # Skip non-existing or non-readable patches
         echo "Applying $patch"
         patch -p1 <"$patch"
@@ -123,7 +128,10 @@ remove_old_version()
     rm -f "$SAGE_LOCAL"/bin/Singular*
     rm -f "$SAGE_LOCAL/include/factory.h"
     rm -f "$SAGE_LOCAL/include/factoryconf.h"
+    rm -rf "$SAGE_LOCAL/include/factory"
     rm -rf "$SAGE_LOCAL/include/singular"
+    rm -rf "$SAGE_LOCAL"/include/omalloc*
+    rm -f "$SAGE_LOCAL"/lib/*omalloc*
 }
 
 config()
@@ -245,11 +253,10 @@ build_factory()
                 --bindir="$SAGE_LOCAL"/bin \
                 --libdir="$SAGE_LOCAL"/lib \
                 --enable-gmp \
-                --with-gmp="$SAGE_LOCAL" \
+                --with-gmp \
                 --enable-NTL \
-                --with-NTL="$SAGE_LOCAL" \
-                --with-flint="$SAGE_LOCAL" \
-                --with-gmp="$SAGE_LOCAL" \
+                --with-NTL \
+                --with-flint \
                 $ENABLE_DEBUGOUTPUT
 
     if [ $? -ne 0 ]; then
@@ -316,7 +323,7 @@ install_docs()
 # Actually run all the functions defined above
 for i in config \
   build_singular build_libsingular build_factory build_libfac \
-  create_singular_script; do
+  create_singular_script ; do
     echo "### Singular spkg-install: $i ###"
     cd "$SRC" && $i
     if [ $? -ne 0 ]; then
diff --git a/debian/spkg-install b/debian/spkg-install.orig
similarity index 94%
copy from debian/spkg-install
copy to debian/spkg-install.orig
index fd98e66..7f74498 100755
--- a/debian/spkg-install
+++ b/debian/spkg-install.orig
@@ -4,7 +4,7 @@
 ## Singular
 ###########################################
 
-SRC=`pwd`
+SRC=`pwd`/src/latest
 SHARED=`pwd`/src/shared
 PATCHES=`pwd`/patches
 
@@ -88,6 +88,8 @@ fi
 # parallel sometimes fails (Trac #17774)
 export MAKE="$MAKE -j1"
 
+# Workaround for GCC6: https://trac.sagemath.org/ticket/20926
+export CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-strict-overflow"
 
 choose_patches()
 {
@@ -106,8 +108,11 @@ choose_patches()
 
 apply_patches()
 {
+    # cd down to the root of src/
+    cd ..
+
     # Apply all patches
-    for patch in "$PATCHES"/*.patch; do
+    for patch in ../patches/*.patch; do
         [ -r "$patch" ] || continue  # Skip non-existing or non-readable patches
         echo "Applying $patch"
         patch -p1 <"$patch"
@@ -123,7 +128,10 @@ remove_old_version()
     rm -f "$SAGE_LOCAL"/bin/Singular*
     rm -f "$SAGE_LOCAL/include/factory.h"
     rm -f "$SAGE_LOCAL/include/factoryconf.h"
+    rm -rf "$SAGE_LOCAL/include/factory"
     rm -rf "$SAGE_LOCAL/include/singular"
+    rm -rf "$SAGE_LOCAL"/include/omalloc*
+    rm -f "$SAGE_LOCAL"/lib/*omalloc*
 }
 
 config()
@@ -145,7 +153,7 @@ config()
                 --with-apint=gmp \
                 --with-malloc=system \
                 --with-NTL \
-                --with-flint \
+                --with-flint="$SAGE_LOCAL" \
                 --without-MP \
                 --without-lex \
                 --without-Boost \
@@ -314,9 +322,9 @@ install_docs()
 
 
 # Actually run all the functions defined above
-for i in config \
+for i in choose_patches apply_patches remove_old_version config \
   build_singular build_libsingular build_factory build_libfac \
-  create_singular_script; do
+  create_singular_script install_docs ; do
     echo "### Singular spkg-install: $i ###"
     cd "$SRC" && $i
     if [ $? -ne 0 ]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/singular.git



More information about the debian-science-commits mailing list