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

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