tcsh: import an Arch patch (merging the two patches into a single one) for fixing gcc5 optimisation
This commit is contained in:
parent
b300a8937e
commit
b3bcb59bd5
28
pkgs/shells/tcsh/avoid-gcc5-wrong-optimisation.patch
Normal file
28
pkgs/shells/tcsh/avoid-gcc5-wrong-optimisation.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From: christos <christos>
|
||||
Date: Thu, 28 May 2015 11:47:03 +0000
|
||||
Subject: [PATCH] avoid gcc-5 optimization malloc + memset = calloc (Fridolin
|
||||
Pokorny)
|
||||
|
||||
---
|
||||
tc.alloc.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tc.alloc.c b/tc.alloc.c
|
||||
index b9aec63..c1cb330 100644
|
||||
--- a/tc.alloc.c
|
||||
+++ b/tc.alloc.c
|
||||
@@ -348,10 +348,13 @@ calloc(size_t i, size_t j)
|
||||
{
|
||||
#ifndef lint
|
||||
char *cp;
|
||||
+ volatile size_t k;
|
||||
|
||||
i *= j;
|
||||
cp = xmalloc(i);
|
||||
- memset(cp, 0, i);
|
||||
+ /* Stop gcc 5.x from optimizing malloc+memset = calloc */
|
||||
+ k = i;
|
||||
+ memset(cp, 0, k);
|
||||
|
||||
return ((memalign_t) cp);
|
||||
#else
|
@ -6,10 +6,15 @@ stdenv.mkDerivation rec {
|
||||
version = "6.19.00";
|
||||
|
||||
src = fetchurl {
|
||||
urls = [ "ftp://ftp.funet.fi/pub/unix/shells/tcsh/${name}.tar.gz"
|
||||
"http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${name}.tar.gz" ];
|
||||
urls = [
|
||||
"http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${name}.tar.gz"
|
||||
"ftp://ftp.astron.com/pub/tcsh/${name}.tar.gz"
|
||||
"ftp://ftp.funet.fi/pub/unix/shells/tcsh/${name}.tar.gz"
|
||||
];
|
||||
sha256 = "0jaw51382pqyb6d1kgfg8ir0wd3p5qr2bmg8svcmjhlyp3h73qhj";
|
||||
};
|
||||
|
||||
patches = [ ./avoid-gcc5-wrong-optimisation.patch ];
|
||||
|
||||
buildInputs = [ ncurses ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user