diff --git a/0002-set-entry-point-when-text-segment-is-missing.patch b/0001-set-entry-point-when-text-segment-is-missing.patch similarity index 100% rename from 0002-set-entry-point-when-text-segment-is-missing.patch rename to 0001-set-entry-point-when-text-segment-is-missing.patch diff --git a/0003-Add-support-for-readline-8.2.patch b/0002-Add-support-for-readline-8.2.patch similarity index 100% rename from 0003-Add-support-for-readline-8.2.patch rename to 0002-Add-support-for-readline-8.2.patch diff --git a/0003-gdb-build-Handle-deprecation-of-scm_install_gmp_memo.patch b/0003-gdb-build-Handle-deprecation-of-scm_install_gmp_memo.patch new file mode 100644 index 0000000000000000000000000000000000000000..d5bd3e088b9de2bc560f1ed1078bbf7eff5324a2 --- /dev/null +++ b/0003-gdb-build-Handle-deprecation-of-scm_install_gmp_memo.patch @@ -0,0 +1,72 @@ +From 57f8fe908bec51c40ec686294460ec979b140843 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= +Date: Fri, 8 Jul 2022 16:01:16 +0200 +Subject: [PATCH] [gdb/build] Handle deprecation of + scm_install_gmp_memory_functions + +When building gdb with guile 3.0.8, we run into: +... +gdb/guile/guile.c: In function \ + 'void gdbscm_initialize(const extension_language_defn*)': +gdb/guile/guile.c:680:5: error: 'scm_install_gmp_memory_functions' is \ + deprecated [-Werror=deprecated-declarations] + 680 | scm_install_gmp_memory_functions = 0; + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from /usr/include/guile/3.0/libguile.h:128, + from gdb/guile/guile-internal.h:30, + from gdb/guile/guile.c:36: +/usr/include/guile/3.0/libguile/deprecated.h:164:20: note: declared here + 164 | SCM_DEPRECATED int scm_install_gmp_memory_functions; + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +cc1plus: all warnings being treated as errors +make[1]: *** [Makefile:1896: guile/guile.o] Error 1 +... + +The variable has been deprecated because it no longer has any effect. + +Fix this by disabling the specific deprecation warning. + +Also handle upcoming guile versions > 3.0, in which the variable will be +removed, by limiting the usage of the variable to guile versions <= 3.0. + +This does not break anything. The variable was merely used to address a +problem present in guile versions <= v3.0.5. + +Note that we don't limit the usage of the variable to guile versions <= 3.0.5, +because we want to support f.i. building against 3.0.6 and then using a shared +lib with 3.0.5. + +Tested on x86_64-linux. + +Co-Authored-By: Tom de Vries + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28994 +--- + gdb/guile/guile.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c +index 14b191ded62..e5565b627d9 100644 +--- a/gdb/guile/guile.c ++++ b/gdb/guile/guile.c +@@ -677,7 +677,17 @@ gdbscm_initialize (const struct extension_language_defn *extlang) + "double free or corruption (out)" error. + Work around the libguile bug by disabling the installation of the + libgmp memory functions by guile initialization. */ ++ ++ /* The scm_install_gmp_memory_functions variable should be removed after ++ version 3.0, so limit usage to 3.0 and before. */ ++#if SCM_MAJOR_VERSION < 3 || (SCM_MAJOR_VERSION == 3 && SCM_MINOR_VERSION == 0) ++ /* This variable is deprecated in Guile 3.0.8 and later but remains ++ available in the whole 3.0 series. */ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + scm_install_gmp_memory_functions = 0; ++#pragma GCC diagnostic pop ++#endif + + /* scm_with_guile is the most portable way to initialize Guile. Plus + we need to initialize the Guile support while in Guile mode (e.g., +-- +2.33.0 + diff --git a/gdb.spec b/gdb.spec index d49d85876ba4eb4fd371afdb22f4eef49eecbfbd..6c315b01ba5165d665cc4d617911f6118224f0c1 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,6 +1,6 @@ Name: gdb Version: 12.1 -Release: 2 +Release: 3 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-1.3 Source: https://ftp.gnu.org/gnu/gdb/gdb-%{version}.tar.xz @@ -86,8 +86,9 @@ Patch73: gdb-rhbz1553104-s390x-arch12-test.patch Patch76: gdb-sw22395-constify-target_desc.patch # Fedra patch end -Patch83: 0002-set-entry-point-when-text-segment-is-missing.patch -Patch84: 0003-Add-support-for-readline-8.2.patch +Patch77: 0001-set-entry-point-when-text-segment-is-missing.patch +Patch78: 0002-Add-support-for-readline-8.2.patch +Patch79: 0003-gdb-build-Handle-deprecation-of-scm_install_gmp_memo.patch %global gdb_src gdb-%{version} %global gdb_build build-%{_target_platform} @@ -363,6 +364,10 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %{_infodir}/ctf-spec.info.gz %changelog +* Mon Feb 13 2023 Wenyu Liu - 12.1-3 +- Handle deprecation of scm_install_gmp_memory_functions. +- Rectify the spec file. + * Mon Feb 6 2023 Wenyu Liu - 12.1-2 - Add support for readline 8.2