about summary refs log tree commit diff
path: root/pkgs/applications/science/math/palp
diff options
context:
space:
mode:
authorTimo Kaufmann <eisfreak7@gmail.com>2018-06-27 09:42:26 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-06-27 09:42:26 +0200
commit08a59bb10df18f6f47170c4987defced4c4d1187 (patch)
tree002d80532244e4179cbecdd215610295c5545072 /pkgs/applications/science/math/palp
parentf9cb1a98c86212b9596698f2971a1be6effe49f4 (diff)
downloadnixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar.gz
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar.bz2
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar.lz
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar.xz
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.tar.zst
nixlib-08a59bb10df18f6f47170c4987defced4c4d1187.zip
palp: fix runtime error introduced by #28029 (#42633)
After #28029 it is necessary to add "strictoverflow" to the disabled
hardening flags. That probably has something to do with the `-O3` option
in palps makefile.

This commit also adds a test to check for this regression (as it only
occured at runtime).
Diffstat (limited to 'pkgs/applications/science/math/palp')
-rw-r--r--pkgs/applications/science/math/palp/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/applications/science/math/palp/default.nix b/pkgs/applications/science/math/palp/default.nix
index 3484c369db3b..5f5c000a87c8 100644
--- a/pkgs/applications/science/math/palp/default.nix
+++ b/pkgs/applications/science/math/palp/default.nix
@@ -14,13 +14,28 @@ stdenv.mkDerivation rec {
     sha256 = "1s7s2lc5f0ig1yy7ygsh3sddm3sbq4mxwybqsj8lp9wjdxs7qfrs";
   };
 
-  hardeningDisable = [ "format" ];
+  hardeningDisable = [
+    "format"
+    "strictoverflow" # causes runtime failure (tested in checkPhase)
+  ];
 
   preBuild = ''
       echo Building PALP optimized for ${dim} dimensions
       sed -i "s/^#define[^a-zA-Z]*POLY_Dmax.*/#define POLY_Dmax ${dim}/" Global.h
   '';
 
+  # palp has no tests of its own. This test is an adapted sage test that failed
+  # when #28029 was merged.
+  doCheck = true;
+  checkPhase = ''
+    ./nef.x -f -N << EOF | grep -q 'np='
+      3 6
+      1  0  0 -1  0  0
+      0  1  0  0 -1  0
+      0  0  1  0  0 -1
+    EOF
+  '';
+
   installPhase = ''
     mkdir -p "$out/bin"
     for file in poly class cws nef mori; do