tcsh: import an Arch patch (merging the two patches into a single one) for fixing gcc5 optimisation

+35 -2
+28
pkgs/shells/tcsh/avoid-gcc5-wrong-optimisation.patch
··· 1 + From: christos <christos> 2 + Date: Thu, 28 May 2015 11:47:03 +0000 3 + Subject: [PATCH] avoid gcc-5 optimization malloc + memset = calloc (Fridolin 4 + Pokorny) 5 + 6 + --- 7 + tc.alloc.c | 5 ++++- 8 + 1 file changed, 4 insertions(+), 1 deletion(-) 9 + 10 + diff --git a/tc.alloc.c b/tc.alloc.c 11 + index b9aec63..c1cb330 100644 12 + --- a/tc.alloc.c 13 + +++ b/tc.alloc.c 14 + @@ -348,10 +348,13 @@ calloc(size_t i, size_t j) 15 + { 16 + #ifndef lint 17 + char *cp; 18 + + volatile size_t k; 19 + 20 + i *= j; 21 + cp = xmalloc(i); 22 + - memset(cp, 0, i); 23 + + /* Stop gcc 5.x from optimizing malloc+memset = calloc */ 24 + + k = i; 25 + + memset(cp, 0, k); 26 + 27 + return ((memalign_t) cp); 28 + #else
+7 -2
pkgs/shells/tcsh/default.nix
··· 6 6 version = "6.19.00"; 7 7 8 8 src = fetchurl { 9 - urls = [ "ftp://ftp.funet.fi/pub/unix/shells/tcsh/${name}.tar.gz" 10 - "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${name}.tar.gz" ]; 9 + urls = [ 10 + "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${name}.tar.gz" 11 + "ftp://ftp.astron.com/pub/tcsh/${name}.tar.gz" 12 + "ftp://ftp.funet.fi/pub/unix/shells/tcsh/${name}.tar.gz" 13 + ]; 11 14 sha256 = "0jaw51382pqyb6d1kgfg8ir0wd3p5qr2bmg8svcmjhlyp3h73qhj"; 12 15 }; 16 + 17 + patches = [ ./avoid-gcc5-wrong-optimisation.patch ]; 13 18 14 19 buildInputs = [ ncurses ]; 15 20