valgrind/valgrind-3.16.0-some-stack-protector.patch
Mark Wielaard 9a3001b693 3.22.0-1
Resolves: #RHEL-15926
Routine Rebase of valgrind for 8.10

- Upstream 3.22.0 final
- BuildRequires elfutils-debuginfod for testing
- Remove all upstreamed patches
- Adjust valgrind-3.16.0-some-stack-protector.patch
- Adjust valgrind-3.16.0-some-Wl-z-now.patch
- Add cachegrind.h to valgrind-devel package
- Use %%patch -Pn instead of deprecated %%patchn
2023-11-07 17:49:41 +01:00

106 lines
3.7 KiB
Diff

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