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

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