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

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