From 08a59bb10df18f6f47170c4987defced4c4d1187 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Wed, 27 Jun 2018 09:42:26 +0200 Subject: 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). --- pkgs/applications/science/math/palp/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'pkgs/applications') 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 -- cgit 1.4.1