]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: more guile 2.0 support removal
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 4 Dec 2025 17:25:13 +0000 (12:25 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 9 Dec 2025 16:21:59 +0000 (11:21 -0500)
Commit f14bbacae00d ("gdb/guile: remove support for Guile < 2.2")
removed some code supporting Guile 2.0.  This patch removes more bits
related to Guile 2.0, and adds a NEWS entry.

 * Remove Guile 2.0 mention from the doc.

 * Remove HAVE_GUILE_MANUAL_FINALIZATION, assume it is always true.

 * Remove guile-2.0 from the versions automatically tried by configure.

 * Remove check for scm_new_smob (HAVE_SCM_NEW_SMOB), assume it is
   always true.

 * Remove hack to fill ac_cv_guild_program_name when the .pc file
   wouldn't specify it.

Tested by rebuilding against guile-3.0 and guile-2.2.

Change-Id: I2e89bcd4a4429262f4c3a1c74b275768e60f0cb0
Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
gdb/NEWS
gdb/acinclude.m4
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/doc/guile.texi
gdb/guile/guile-internal.h
gdb/guile/guile.c
gdb/guile/scm-safe-call.c

index 01c998f4ea03bd30137f5e7955ca913867c1295b..82192ce60b8196ccc2353ac50758bd1fa8c75fcf 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -6,6 +6,8 @@
 * Support for .gdb_index sections with version less than 7 has been
   removed.
 
+* Support for Guile 2.0 has been removed.
+
 * GDB now accepts --no-escape-args as an alternative to --args on the
   command line.  GDB will not escape special shell characters within
   arguments after --no-escape-args.
index f2cd187beda3636ac8f5f0e840ed35b15044076e..547dd14d62f53c7f897bdcfc973d37e3854fae16 100644 (file)
@@ -267,17 +267,7 @@ dnl similar to Guile's 'GUILE_PROGS' macro.)
 AC_DEFUN([GDB_GUILE_PROGRAM_NAMES], [
   AC_CACHE_CHECK([for the absolute file name of the 'guild' command],
     [ac_cv_guild_program_name],
-    [ac_cv_guild_program_name="`$1 --variable guild $2`"
-
-     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
-     # the 'guild' and 'bindir' variables.  In that case, try to guess
-     # what the program name is, at the risk of getting it wrong if
-     # Guile was configured with '--program-suffix' or similar.
-     if test "x$ac_cv_guild_program_name" = "x"; then
-       guile_exec_prefix="`$1 --variable exec_prefix $2`"
-       ac_cv_guild_program_name="$guile_exec_prefix/bin/guild"
-     fi
-  ])
+    [ac_cv_guild_program_name="`$1 --variable guild $2`"])
 
   if ! "$ac_cv_guild_program_name" --version >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
     AC_MSG_ERROR(['$ac_cv_guild_program_name' appears to be unusable])
index 2a2dcb809dd32112b0209f09ca5dccc0c017ce70..9e2bba42e287018d29d88e526768c654cbb1b6fc 100644 (file)
 /* Define if Guile interpreter is being linked in. */
 #undef HAVE_GUILE
 
-/* Define if Guile supports manual finalization. */
-#undef HAVE_GUILE_MANUAL_FINALIZATION
-
 /* Define if you have the iconv() function and it works. */
 #undef HAVE_ICONV
 
 /* Define to 1 if you have the `sbrk' function. */
 #undef HAVE_SBRK
 
-/* Define to 1 if you have the `scm_new_smob' function. */
-#undef HAVE_SCM_NEW_SMOB
-
 /* Define to 1 if you have the `setlocale' function. */
 #undef HAVE_SETLOCALE
 
index 26fc9af067921a801930f2ae09bc212d9b92c690..cc446c6e4c89746a0ba594b00075184d7ad1de7d 100755 (executable)
@@ -28818,7 +28818,7 @@ fi
 
 
 
-try_guile_versions="guile-3.0 guile-2.2 guile-2.0"
+try_guile_versions="guile-3.0 guile-2.2"
 have_libguile=no
 case "${with_guile}" in
 no)
@@ -28886,14 +28886,6 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled"
-if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = xyes; then :
-
-$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h
-
-
-fi
-
     CPPFLAGS=$save_CPPFLAGS
     LIBS=$save_LIBS
     if test "${found_usable_guile}" = no; then
@@ -28970,14 +28962,6 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled"
-if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = xyes; then :
-
-$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h
-
-
-fi
-
     CPPFLAGS=$save_CPPFLAGS
     LIBS=$save_LIBS
     if test "${found_usable_guile}" = no; then
@@ -29051,14 +29035,6 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled"
-if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = xyes; then :
-
-$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h
-
-
-fi
-
     CPPFLAGS=$save_CPPFLAGS
     LIBS=$save_LIBS
     if test "${found_usable_guile}" = no; then
@@ -29078,7 +29054,7 @@ $as_echo "${found_usable_guile}" >&6; }
   fi
   ;;
 "" | */*)
-  # Disallow --with=guile="" and --with-guile=foo/bar.
+  # Disallow --with-guile="" and --with-guile=foo/bar.
   as_fn_error $? "invalid value for --with-guile" "$LINENO" 5
   ;;
 *)
@@ -29142,14 +29118,6 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled"
-if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = xyes; then :
-
-$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h
-
-
-fi
-
     CPPFLAGS=$save_CPPFLAGS
     LIBS=$save_LIBS
     if test "${found_usable_guile}" = no; then
@@ -29177,16 +29145,6 @@ if ${ac_cv_guild_program_name+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_guild_program_name="`"${with_guile}" --variable guild "${guile_version}"`"
-
-     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
-     # the 'guild' and 'bindir' variables.  In that case, try to guess
-     # what the program name is, at the risk of getting it wrong if
-     # Guile was configured with '--program-suffix' or similar.
-     if test "x$ac_cv_guild_program_name" = "x"; then
-       guile_exec_prefix="`"${with_guile}" --variable exec_prefix "${guile_version}"`"
-       ac_cv_guild_program_name="$guile_exec_prefix/bin/guild"
-     fi
-
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guild_program_name" >&5
 $as_echo "$ac_cv_guild_program_name" >&6; }
@@ -29207,16 +29165,6 @@ if ${ac_cv_guild_program_name+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_guild_program_name="`"${pkg_config_prog_path}" --variable guild "${guile_version}"`"
-
-     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
-     # the 'guild' and 'bindir' variables.  In that case, try to guess
-     # what the program name is, at the risk of getting it wrong if
-     # Guile was configured with '--program-suffix' or similar.
-     if test "x$ac_cv_guild_program_name" = "x"; then
-       guile_exec_prefix="`"${pkg_config_prog_path}" --variable exec_prefix "${guile_version}"`"
-       ac_cv_guild_program_name="$guile_exec_prefix/bin/guild"
-     fi
-
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guild_program_name" >&5
 $as_echo "$ac_cv_guild_program_name" >&6; }
@@ -29272,24 +29220,6 @@ $as_echo "#define HAVE_GUILE 1" >>confdefs.h
   CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_GUILE_SRCS)"
   CONFIG_INSTALL="$CONFIG_INSTALL install-guile"
   ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_GUILE_CFLAGS)"
-
-    save_LIBS="$LIBS"
-  save_CPPFLAGS="$CPPFLAGS"
-  LIBS="$GUILE_LIBS"
-  CPPFLAGS="$GUILE_CPPFLAGS"
-  for ac_func in scm_new_smob
-do :
-  ac_fn_c_check_func "$LINENO" "scm_new_smob" "ac_cv_func_scm_new_smob"
-if test "x$ac_cv_func_scm_new_smob" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SCM_NEW_SMOB 1
-_ACEOF
-
-fi
-done
-
-  LIBS="$save_LIBS"
-  CPPFLAGS="$save_CPPFLAGS"
 else
   # Even if Guile support is not compiled in, we need to have these files
   # included.
index e1bbfdf6ef4060e3f46c6f24d7a5efd56d57e7ae..1b9939b0754602a01a13eb5edf0ce98d33e52332 100644 (file)
@@ -1144,11 +1144,6 @@ AC_DEFUN([AC_TRY_LIBGUILE],
                    GUILE_CPPFLAGS=$new_CPPFLAGS
                    GUILE_LIBS=$new_LIBS],
                   [found_usable_guile=no])
-    dnl scm_set_automatic_finalization_enabled added in Guile 2.2.
-    AC_CHECK_FUNC(scm_set_automatic_finalization_enabled,
-      AC_DEFINE(HAVE_GUILE_MANUAL_FINALIZATION, 1,
-               [Define if Guile supports manual finalization.])
-    )
     CPPFLAGS=$save_CPPFLAGS
     LIBS=$save_LIBS
     if test "${found_usable_guile}" = no; then
@@ -1170,7 +1165,7 @@ dnl        fall back to "no".
 dnl guile-version [guile-version-choice-2 ...] -
 dnl        A space-separated list of guile package versions to try.
 dnl        These are passed to pkg-config as-is.
-dnl        E.g., guile-2.0 or guile-2.2-uninstalled
+dnl        E.g., guile-3.0 or guile-2.2-uninstalled
 dnl        This requires making sure PKG_CONFIG_PATH is set appropriately.
 dnl /path/to/pkg-config -
 dnl        Use this pkg-config program.
@@ -1192,7 +1187,7 @@ AC_MSG_RESULT([$with_guile])
 dnl We check guile with pkg-config.
 AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
 
-try_guile_versions="guile-3.0 guile-2.2 guile-2.0"
+try_guile_versions="guile-3.0 guile-2.2"
 have_libguile=no
 case "${with_guile}" in
 no)
@@ -1219,7 +1214,7 @@ yes)
   fi
   ;;
 "" | */*)
-  # Disallow --with=guile="" and --with-guile=foo/bar.
+  # Disallow --with-guile="" and --with-guile=foo/bar.
   AC_MSG_ERROR([invalid value for --with-guile])
   ;;
 *)
@@ -1258,15 +1253,6 @@ if test "${have_libguile}" != no; then
   CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_GUILE_SRCS)"
   CONFIG_INSTALL="$CONFIG_INSTALL install-guile"
   ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_GUILE_CFLAGS)"
-
-  dnl The 'scm_new_smob' function appeared in Guile 2.0.6.
-  save_LIBS="$LIBS"
-  save_CPPFLAGS="$CPPFLAGS"
-  LIBS="$GUILE_LIBS"
-  CPPFLAGS="$GUILE_CPPFLAGS"
-  AC_CHECK_FUNCS([scm_new_smob])
-  LIBS="$save_LIBS"
-  CPPFLAGS="$save_CPPFLAGS"
 else
   # Even if Guile support is not compiled in, we need to have these files
   # included.
index fcedef0f42e89922053fb929d6d54d2d6a6fa0c1..83ea3e09c30798644fcf542ff8293d04deb33310 100644 (file)
@@ -38,7 +38,7 @@ Guile support in @value{GDBN} follows the Python support in @value{GDBN}
 reasonably closely, so concepts there should carry over.
 However, some things are done differently where it makes sense.
 
-@value{GDBN} requires Guile version 3.0, 2.2, or 2.0.
+@value{GDBN} requires Guile version 3.0, 2.2.
 
 @cindex guile scripts directory
 Guile scripts used by @value{GDBN} should be installed in
index 60a8bf3a8db8b3bcf23827f5bf73e8a65b233abb..aeef77abbaf5c0c241bda0c0db10600267dfa5d2 100644 (file)
@@ -156,18 +156,6 @@ struct scheme_integer_constant
 #define gdbscm_is_false(scm) scm_is_eq ((scm), SCM_BOOL_F)
 #define gdbscm_is_true(scm) (!gdbscm_is_false (scm))
 
-#ifndef HAVE_SCM_NEW_SMOB
-
-/* Guile <= 2.0.5 did not provide this function, so provide it here.  */
-
-static inline SCM
-scm_new_smob (scm_t_bits tc, scm_t_bits data)
-{
-  SCM_RETURN_NEWSMOB (tc, data);
-}
-
-#endif
-
 /* Function name that is passed around in case an error needs to be reported.
    __func is in C99, but we provide a wrapper "just in case",
    and because FUNC_NAME is the canonical value used in guile sources.
index 66a74b3ca84a55197ad993c9e2f17dbc73a71ddc..bbeea9cf5d60750b41f372a4cd262499dba850dc 100644 (file)
@@ -633,9 +633,7 @@ call_initialize_gdb_module (void *data)
      performed within the desired module.  */
   scm_c_define_module (gdbscm_module_name, initialize_gdb_module, NULL);
 
-#if HAVE_GUILE_MANUAL_FINALIZATION
   scm_run_finalizers ();
-#endif
 
   return NULL;
 }
@@ -651,12 +649,10 @@ gdbscm_initialize (const struct extension_language_defn *extlang)
      Python side to define module "gdb" which imports "_gdb".  There is
      evidently no similar convention in Guile so we skip this.  */
 
-#if HAVE_GUILE_MANUAL_FINALIZATION
   /* Our SMOB free functions are not thread-safe, as GDB itself is not
      intended to be thread-safe.  Disable automatic finalization so that
      finalizers aren't run in other threads.  */
   scm_set_automatic_finalization_enabled (0);
-#endif
 
   /* Before we initialize Guile, block signals needed by gdb (especially
      SIGCHLD).  This is done so that all threads created during Guile
index 95dcf3aeee2e34ed4a5a8cfec7bfb7f5be79b336..3023eb42875785830cc4136319f9e3621799a055 100644 (file)
@@ -155,9 +155,7 @@ gdbscm_with_catch (void *data)
                   d->unwind_handler, d,
                   d->pre_unwind_handler, d);
 
-#if HAVE_GUILE_MANUAL_FINALIZATION
   scm_run_finalizers ();
-#endif
 
   return NULL;
 }