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

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