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

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