From 50ea6a91547f008b7b995a3b2b4cf48b4b77077f Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 21 Jul 2020 00:13:51 -0600 Subject: [PATCH] - Fix broken configure tests compromised by LTO - Add BuildRequires: autoconf --- gdb-config.patch | 24 ++++++++++++++++++++++++ gdb-ltofix.patch | 12 ++++++++++++ gdb.spec | 28 +++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 gdb-config.patch create mode 100644 gdb-ltofix.patch diff --git a/gdb-config.patch b/gdb-config.patch new file mode 100644 index 0000000..982037b --- /dev/null +++ b/gdb-config.patch @@ -0,0 +1,24 @@ +diff -Nrup a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4 +--- a/gnulib/import/m4/alloca.m4 2019-11-18 18:49:20.000000000 -0700 ++++ b/gnulib/import/m4/alloca.m4 2020-01-11 01:07:36.200483085 -0700 +@@ -89,7 +89,7 @@ AC_CACHE_CHECK([stack direction for C al + [ac_cv_c_stack_direction], + [AC_RUN_IFELSE([AC_LANG_SOURCE( + [AC_INCLUDES_DEFAULT +-int ++__attribute__ (noinline,noclone)) int + find_stack_direction (int *addr, int depth) + { + int dir, dummy = 0; +diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 +--- a/libiberty/aclocal.m4 2019-11-18 18:49:21.000000000 -0700 ++++ b/libiberty/aclocal.m4 2020-01-11 01:08:23.142342127 -0700 +@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then + fi + + AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, +-[AC_TRY_RUN([find_stack_direction () ++[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction () + { + static char *addr = 0; + auto char dummy; diff --git a/gdb-ltofix.patch b/gdb-ltofix.patch new file mode 100644 index 0000000..e30f6f8 --- /dev/null +++ b/gdb-ltofix.patch @@ -0,0 +1,12 @@ +diff -Nrup a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c +--- a/gdb/gdbserver/ax.c 2019-11-18 18:49:19.000000000 -0700 ++++ b/gdb/gdbserver/ax.c 2019-12-19 21:30:19.512505411 -0700 +@@ -25,7 +25,7 @@ + static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2); + + #ifdef IN_PROCESS_AGENT +-int debug_agent = 0; ++bool debug_agent = 0; + #endif + + static void diff --git a/gdb.spec b/gdb.spec index 5582eca..f40f1a9 100644 --- a/gdb.spec +++ b/gdb.spec @@ -34,7 +34,7 @@ Version: 9.2 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL # Do not provide URL for snapshots as the file lasts there only for 2 days. @@ -154,6 +154,8 @@ Recommends: %{librpmname} BuildRequires: %{?scl_prefix}gcc-c++ %endif +BuildRequires: autoconf + # GDB patches have the format `gdb--bz-.patch'. # They should be created using patch level 1: diff -up ./gdb (or gdb-6.3/gdb). @@ -196,6 +198,14 @@ Patch1142: v1.5-libipt-static.patch ##=fedoratest Patch1119: gdb-testsuite-readline63-sigint-revert.patch +# Fix broken configure tests compromised by LTO +#push=Should be pushed upstream. +Patch2000: gdb-config.patch + +# Fix type mismatch issue exposed by LTO +#push=Should be pushed upstream. +Patch2001: gdb-ltofix.patch + # Include the auto-generated file containing the "Patch:" directives. # See README.local-patches for more details. Patch9998: _gdb.spec.Patch.include @@ -483,6 +493,18 @@ done %patch1119 -p1 %endif +%patch2000 -p1 +%patch2001 -p1 + +# The above patches twiddle a .m4 file for configure, so update the affected +# configure files +pushd libiberty +autoconf -f +popd +pushd intl +autoconf -f +popd + find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. @@ -1164,6 +1186,10 @@ fi %endif %changelog +* Mon Jul 20 2020 Jeff Law - 9.2-3 +- Fix broken configure tests compromised by LTO +- Add BuildRequires: autoconf + * Wed Jun 17 2020 Keith Seitz - 9.2-2 - Backport debuginfod support.