opt/tcsh/tcsh-6.19.00.patch

115 lines
3.0 KiB
Diff

commit 624d3aebb6e6afadb4f35e894d11b5ebe290cd87
Author: christos <christos>
Date: Thu May 28 11:47:03 2015 +0000
avoid gcc-5 optimization malloc + memset = calloc (Fridolin Pokorny)
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;
+ 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
commit 05e7406049bd2686dee0ee8d819dcd38eb131f6f
Author: christos <christos>
Date: Tue Jul 7 12:24:54 2015 +0000
make k volatile to prevent gcc-5 memset() optimization (Fridolin Pokorny)
diff --git a/tc.alloc.c b/tc.alloc.c
index c1cb330..f68a8c5 100644
--- a/tc.alloc.c
+++ b/tc.alloc.c
@@ -348,7 +348,7 @@ calloc(size_t i, size_t j)
{
#ifndef lint
char *cp;
- size_t k;
+ volatile size_t k;
i *= j;
cp = xmalloc(i);
commit c43b072b89f19e9b41d45bdf3946593ae9bc6e5e
Author: christos <christos>
Date: Mon Aug 24 07:08:42 2015 +0000
restrict BSDWAIT to __GLIBC__ because other linux libraries (muslc) don't
have the macros.
diff --git a/sh.proc.c b/sh.proc.c
index 76eca3b..ad07250 100644
--- a/sh.proc.c
+++ b/sh.proc.c
@@ -47,7 +47,7 @@ RCSID("$tcsh$")
# define HZ 16
#endif /* aiws */
-#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
+#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__GLIBC__)
# if !defined(__ANDROID__)
# define BSDWAIT
# endif
commit eab72f9797ec4faaf1fb4de491c357f194b84dd6
Author: christos <christos>
Date: Thu Apr 14 11:09:09 2016 +0000
GLIBC is getting rid of union wait.
diff --git a/sh.proc.c b/sh.proc.c
index ad07250..5c68409 100644
--- a/sh.proc.c
+++ b/sh.proc.c
@@ -47,11 +47,11 @@ RCSID("$tcsh$")
# define HZ 16
#endif /* aiws */
-#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__GLIBC__)
-# if !defined(__ANDROID__)
+#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__)
+# if !defined(__ANDROID__) && !defined(__GLIBC__)
# define BSDWAIT
# endif
-#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
+#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || gnu-linux */
#ifndef WTERMSIG
# define WTERMSIG(w) (((union wait *) &(w))->w_termsig)
# ifndef BSDWAIT
diff -Nru tcsh-6.19.00.orig/config/linux tcsh-6.19.00/config/linux
--- tcsh-6.19.00.orig/config/linux 2016-09-22 17:51:43.086924218 +0200
+++ tcsh-6.19.00/config/linux 2016-09-22 17:54:16.123662001 +0200
@@ -86,11 +86,11 @@
*/
#define __STRICT_ANSI__
-#ifndef _BSD_SOURCE
-# define _BSD_SOURCE
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
#endif
-#ifndef _SVID_SOURCE
-# define _SVID_SOURCE
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
#endif
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE