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).
This commit is contained in:
Timo Kaufmann 2018-06-27 09:42:26 +02:00 committed by xeji
parent f9cb1a98c8
commit 08a59bb10d

View File

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