From ea63b1ce0ea1fd783a0fe215175a4cd1ee95b217 Mon Sep 17 00:00:00 2001 From: Fridolin Pokorny Date: May 28 2015 10:50:17 +0000 Subject: Add tcsh-6.19.00-gcc5-calloc.patch for gcc5 build --- diff --git a/tcsh-6.19.00-gcc5-calloc.patch b/tcsh-6.19.00-gcc5-calloc.patch new file mode 100644 index 0000000..3e404f8 --- /dev/null +++ b/tcsh-6.19.00-gcc5-calloc.patch @@ -0,0 +1,18 @@ +diff --git a/tc.alloc.c b/tc.alloc.c +index b87f9e9..06e0405 100644 +--- a/tc.alloc.c ++++ b/tc.alloc.c +@@ -348,10 +348,12 @@ calloc(size_t i, size_t j) + { + #ifndef lint + char *cp; ++ volatile size_t k; + + i *= j; + cp = xmalloc(i); +- memset(cp, 0, i); ++ k = i; ++ memset(cp, 0, k); + + return ((memalign_t) cp); + #else diff --git a/tcsh.spec b/tcsh.spec index 15f6ea1..6fc97b8 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -1,7 +1,7 @@ Summary: An enhanced version of csh, the C shell Name: tcsh Version: 6.19.00 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: System Environment/Shells Source: ftp://ftp.astron.com/pub/tcsh/%{name}-%{version}.tar.gz @@ -18,6 +18,8 @@ Patch11: tcsh-6.14.00-order.patch Patch35: tcsh-6.18.01-elf-interpreter.patch Patch36: tcsh-6.18.01-introduce-tcsh_posix_status.patch Patch38: tcsh-6.18.01-skip-tty-tests.patch +# Proposed upstream - http://mx.gw.com/pipermail/tcsh-bugs/2015-May/000944.html +Patch39: tcsh-6.19.00-gcc5-calloc.patch Provides: csh = %{version} Provides: /bin/tcsh, /bin/csh @@ -121,6 +123,10 @@ fi %changelog +* Thu May 28 2015 Fridolin Pokorny - 6.19.00-02 +- Add tcsh-6.19.00-gcc5-calloc.patch to avoid crashes and infinite loops due to + gcc-5 malloc+memset optimization. + * Wed May 27 2015 Fridolin Pokorny - 6.19.00-01 - Update to tcsh-6.19.00 - Drop tcsh-6.14.00-tinfo.patch, not used anymore