Blame SOURCES/valgrind-3.15.0-some-stack-protector.patch

5a43b8
commit b73fb7a614e1b5d60af23fb0752b5cead995e02e
5a43b8
Author: Mark Wielaard <mark@klomp.org>
5a43b8
Date:   Sun Apr 14 00:30:05 2019 +0200
5a43b8
5a43b8
    Remove no-stack-protector, add stack-protector-strong to some.
5a43b8
5a43b8
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
5a43b8
index 56cc5ef..1b7842b 100644
5a43b8
--- a/auxprogs/Makefile.am
5a43b8
+++ b/auxprogs/Makefile.am
5a43b8
@@ -30,7 +30,7 @@ bin_PROGRAMS = valgrind-listener valgrind-di-server
5a43b8
 
5a43b8
 valgrind_listener_SOURCES = valgrind-listener.c
5a43b8
 valgrind_listener_CPPFLAGS  = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
5a43b8
-valgrind_listener_CFLAGS    = $(AM_CFLAGS_PRI)
5a43b8
+valgrind_listener_CFLAGS    = $(AM_CFLAGS_PRI) -fstack-protector-strong
5a43b8
 valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 valgrind_listener_LDFLAGS   = $(AM_CFLAGS_PRI)
5a43b8
 if VGCONF_PLATVARIANT_IS_ANDROID
5a43b8
@@ -49,7 +49,7 @@ endif
5a43b8
 
5a43b8
 valgrind_di_server_SOURCES   = valgrind-di-server.c
5a43b8
 valgrind_di_server_CPPFLAGS  = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
5a43b8
-valgrind_di_server_CFLAGS    = $(AM_CFLAGS_PRI)
5a43b8
+valgrind_di_server_CFLAGS    = $(AM_CFLAGS_PRI) -fstack-protector-strong
5a43b8
 valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 valgrind_di_server_LDFLAGS   = $(AM_CFLAGS_PRI)
5a43b8
 if VGCONF_PLATVARIANT_IS_ANDROID
5a43b8
@@ -84,7 +84,7 @@ endif
5a43b8
 
5a43b8
 getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES   = getoff.c
5a43b8
 getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS  = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
5a43b8
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS    = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
5a43b8
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS    = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fstack-protector-strong
5a43b8
 getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS   = $(AM_CFLAGS_PRI) @LIB_UBSAN@
5a43b8
 if HAVE_DLINFO_RTLD_DI_TLS_MODID
5a43b8
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
5a43b8
index f8447a1..f572741 100644
5a43b8
--- a/cachegrind/Makefile.am
5a43b8
+++ b/cachegrind/Makefile.am
5a43b8
@@ -25,7 +25,7 @@ bin_PROGRAMS = cg_merge
5a43b8
 
5a43b8
 cg_merge_SOURCES = cg_merge.c
5a43b8
 cg_merge_CPPFLAGS  = $(AM_CPPFLAGS_PRI)
5a43b8
-cg_merge_CFLAGS    = $(AM_CFLAGS_PRI)
5a43b8
+cg_merge_CFLAGS    = $(AM_CFLAGS_PRI) -fstack-protector-strong
5a43b8
 cg_merge_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 cg_merge_LDFLAGS   = $(AM_CFLAGS_PRI)
5a43b8
 # If there is no secondary platform, and the platforms include x86-darwin,
5a43b8
diff --git a/configure.ac b/configure.ac
5a43b8
index f8c798b..ccc8f52 100755
5a43b8
--- a/configure.ac
5a43b8
+++ b/configure.ac
5a43b8
@@ -2188,24 +2188,24 @@ AC_LANG(C)
5a43b8
 AC_SUBST(FLAG_FALIGNED_NEW)
5a43b8
 
5a43b8
 # does this compiler support -fno-stack-protector ?
5a43b8
-AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
5a43b8
-
5a43b8
-safe_CFLAGS=$CFLAGS
5a43b8
-CFLAGS="-fno-stack-protector -Werror"
5a43b8
-
5a43b8
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
5a43b8
-  return 0;
5a43b8
-]])], [
5a43b8
-no_stack_protector=yes
5a43b8
-FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
5a43b8
-AC_MSG_RESULT([yes])
5a43b8
-], [
5a43b8
-no_stack_protector=no
5a43b8
+#AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
5a43b8
+#
5a43b8
+#safe_CFLAGS=$CFLAGS
5a43b8
+#CFLAGS="-fno-stack-protector -Werror"
5a43b8
+#
5a43b8
+#AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
5a43b8
+#  return 0;
5a43b8
+#]])], [
5a43b8
+#no_stack_protector=yes
5a43b8
+#FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
5a43b8
+#AC_MSG_RESULT([yes])
5a43b8
+#], [
5a43b8
+#no_stack_protector=no
5a43b8
 FLAG_FNO_STACK_PROTECTOR=""
5a43b8
-AC_MSG_RESULT([no])
5a43b8
-])
5a43b8
-CFLAGS=$safe_CFLAGS
5a43b8
-
5a43b8
+#AC_MSG_RESULT([no])
5a43b8
+#])
5a43b8
+#CFLAGS=$safe_CFLAGS
5a43b8
+#
5a43b8
 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
5a43b8
 
5a43b8
 # does this compiler support -finline-functions ?
5a43b8
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
5a43b8
index 94030fd..3c73210 100644
5a43b8
--- a/coregrind/Makefile.am
5a43b8
+++ b/coregrind/Makefile.am
5a43b8
@@ -55,7 +55,7 @@ AR = ${LTO_AR}
5a43b8
 RANLIB = ${LTO_RANLIB}
5a43b8
 
5a43b8
 valgrind_CPPFLAGS  = $(AM_CPPFLAGS_PRI)
5a43b8
-valgrind_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
5a43b8
+valgrind_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
5a43b8
 valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 valgrind_LDFLAGS   = $(AM_CFLAGS_PRI) @LIB_UBSAN@
5a43b8
 # If there is no secondary platform, and the platforms include x86-darwin,
5a43b8
@@ -94,7 +94,7 @@ vgdb_SOURCES += vgdb-invoker-solaris.c
5a43b8
 endif
5a43b8
 
5a43b8
 vgdb_CPPFLAGS  = $(AM_CPPFLAGS_PRI)
5a43b8
-vgdb_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
5a43b8
+vgdb_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
5a43b8
 vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
5a43b8
 vgdb_LDFLAGS   = $(AM_CFLAGS_PRI) @LIB_UBSAN@
5a43b8
 if VGCONF_PLATVARIANT_IS_ANDROID