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

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