diff mbox series

Revert "Pass GUILE down to subdirectories"

Message ID 20240123001928.787780-1-tom@tromey.com
State New
Headers show
Series Revert "Pass GUILE down to subdirectories" | expand

Commit Message

Tom Tromey Jan. 23, 2024, 12:19 a.m. UTC
This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.

This patch caused problems for some users when building gdb, because
it would cause 'guild' to be invoked with the wrong versin of guile.
On the whole it seems simpler to just back this out.

	* Makefile.in: Rebuild.
	* Makefile.tpl (BASE_EXPORTS): Remove GUILE.
	(GUILE): Remove.
	* Makefile.def (flags_to_pass): Remove GUILE.
---
 Makefile.def | 1 -
 Makefile.in  | 8 ++------
 Makefile.tpl | 7 ++-----
 3 files changed, 4 insertions(+), 12 deletions(-)

Comments

Andrew Burgess Feb. 7, 2024, 4:09 p.m. UTC | #1
Tom Tromey <tom@tromey.com> writes:

> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>
> This patch caused problems for some users when building gdb, because
> it would cause 'guild' to be invoked with the wrong versin of guile.
> On the whole it seems simpler to just back this out.
>
> 	* Makefile.in: Rebuild.
> 	* Makefile.tpl (BASE_EXPORTS): Remove GUILE.
> 	(GUILE): Remove.
> 	* Makefile.def (flags_to_pass): Remove GUILE.

Is it going to be possible to merge this with GCC in stage 4?  Would be
super useful if we could as this is still causing problems.

Thanks,
Andrew



> ---
>  Makefile.def | 1 -
>  Makefile.in  | 8 ++------
>  Makefile.tpl | 7 ++-----
>  3 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/Makefile.def b/Makefile.def
> index 19954e7d731..c8c80af3657 100644
> --- a/Makefile.def
> +++ b/Makefile.def
> @@ -312,7 +312,6 @@ flags_to_pass = { flag= GNATBIND ; };
>  flags_to_pass = { flag= GNATMAKE ; };
>  flags_to_pass = { flag= GDC ; };
>  flags_to_pass = { flag= GDCFLAGS ; };
> -flags_to_pass = { flag= GUILE ; };
>  
>  // Target tools
>  flags_to_pass = { flag= AR_FOR_TARGET ; };
> diff --git a/Makefile.in b/Makefile.in
> index edb0c8a9a42..245dd610b53 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -3,7 +3,7 @@
>  #
>  # Makefile for directory with subdirs to build.
>  #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
> -#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023
> +#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>  #   Free Software Foundation
>  #
>  # This file is free software; you can redistribute it and/or modify
> @@ -143,8 +143,7 @@ BASE_EXPORTS = \
>  	M4="$(M4)"; export M4; \
>  	SED="$(SED)"; export SED; \
>  	AWK="$(AWK)"; export AWK; \
> -	MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \
> -	GUILE="$(GUILE)"; export GUILE;
> +	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
>  
>  # This is the list of variables to export in the environment when
>  # configuring subdirectories for the build system.
> @@ -452,8 +451,6 @@ GM2FLAGS = $(CFLAGS)
>  
>  PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
>  
> -GUILE = guile
> -
>  # Pass additional PGO and LTO compiler options to the PGO build.
>  BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
>  override CFLAGS += $(BUILD_CFLAGS)
> @@ -886,7 +883,6 @@ BASE_FLAGS_TO_PASS = \
>  	"GNATMAKE=$(GNATMAKE)" \
>  	"GDC=$(GDC)" \
>  	"GDCFLAGS=$(GDCFLAGS)" \
> -	"GUILE=$(GUILE)" \
>  	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
>  	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
>  	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
> diff --git a/Makefile.tpl b/Makefile.tpl
> index adbcbdd1d57..6e22adecd2f 100644
> --- a/Makefile.tpl
> +++ b/Makefile.tpl
> @@ -6,7 +6,7 @@ in
>  #
>  # Makefile for directory with subdirs to build.
>  #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
> -#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023
> +#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>  #   Free Software Foundation
>  #
>  # This file is free software; you can redistribute it and/or modify
> @@ -146,8 +146,7 @@ BASE_EXPORTS = \
>  	M4="$(M4)"; export M4; \
>  	SED="$(SED)"; export SED; \
>  	AWK="$(AWK)"; export AWK; \
> -	MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \
> -	GUILE="$(GUILE)"; export GUILE;
> +	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
>  
>  # This is the list of variables to export in the environment when
>  # configuring subdirectories for the build system.
> @@ -455,8 +454,6 @@ GM2FLAGS = $(CFLAGS)
>  
>  PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
>  
> -GUILE = guile
> -
>  # Pass additional PGO and LTO compiler options to the PGO build.
>  BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
>  override CFLAGS += $(BUILD_CFLAGS)
> -- 
> 2.43.0
Christian Biesinger Feb. 7, 2024, 4:27 p.m. UTC | #2
On Mon, Jan 22, 2024 at 7:21 PM Tom Tromey <tom@tromey.com> wrote:

> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>
> This patch caused problems for some users when building gdb, because
> it would cause 'guild' to be invoked with the wrong versin of guile.
>

Is "guild" here a typo? (I don't see a "guild" binary when installing
guile-3.0)

Christian
Andrew Burgess Feb. 8, 2024, 4:10 p.m. UTC | #3
Christian Biesinger <cbiesinger@google.com> writes:

> On Mon, Jan 22, 2024 at 7:21 PM Tom Tromey <tom@tromey.com> wrote:
>
>> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>>
>> This patch caused problems for some users when building gdb, because
>> it would cause 'guild' to be invoked with the wrong versin of guile.
>>
>
> Is "guild" here a typo? (I don't see a "guild" binary when installing
> guile-3.0)

guild is the guile compiler.  There's certainly a guild binary with
3.02 and 3.0.9, as well as every 2.x I've checked.  What version exactly
are you using?

Thanks,
Andrew
Christian Biesinger Feb. 8, 2024, 4:18 p.m. UTC | #4
On Thu, Feb 8, 2024 at 11:10 AM Andrew Burgess <aburgess@redhat.com> wrote:
>
> Christian Biesinger <cbiesinger@google.com> writes:
>
> > On Mon, Jan 22, 2024 at 7:21 PM Tom Tromey <tom@tromey.com> wrote:
> >
> >> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
> >>
> >> This patch caused problems for some users when building gdb, because
> >> it would cause 'guild' to be invoked with the wrong versin of guile.
> >>
> >
> > Is "guild" here a typo? (I don't see a "guild" binary when installing
> > guile-3.0)
>
> guild is the guile compiler.  There's certainly a guild binary with
> 3.02 and 3.0.9, as well as every 2.x I've checked.  What version exactly
> are you using?

Oh, that was my mistake, I installed guile-3.0 which does not contain
guild but guile-3.0-dev does contain it. (Debian)

Christian
Tom Tromey Feb. 10, 2024, 9:54 p.m. UTC | #5
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> Tom Tromey <tom@tromey.com> writes:
>> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>> 
>> This patch caused problems for some users when building gdb, because
>> it would cause 'guild' to be invoked with the wrong versin of guile.
>> On the whole it seems simpler to just back this out.
>> 
>> * Makefile.in: Rebuild.
>> * Makefile.tpl (BASE_EXPORTS): Remove GUILE.
>> (GUILE): Remove.
>> * Makefile.def (flags_to_pass): Remove GUILE.

Andrew> Is it going to be possible to merge this with GCC in stage 4?  Would be
Andrew> super useful if we could as this is still causing problems.

We can always check it in to gdb now and then to gcc at some later date.
If that sounds ok to you, I'll go ahead & do it.

thanks,
Tom
Andrew Burgess March 6, 2024, 10:17 a.m. UTC | #6
Tom Tromey <tom@tromey.com> writes:

> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>
> This patch caused problems for some users when building gdb, because
> it would cause 'guild' to be invoked with the wrong versin of guile.
> On the whole it seems simpler to just back this out.

Tom,

After once again forgetting to add GUILE=guile2.2 to my GDB build I was
thinking about this issue again.

Given that GDB has a --with-guile=... configure option, and that our
configure scripts try to identify a matching version of guild and a
shared library to link GDB against, I wondered why we don't just force
the use of a matching version of guile.

I guess I'm suggesting that for building GDB's guile components we
should respect either the --with-guile=... configure option, or what the
configure script auto-detected, and should not be picking up any build
time GUILE=... flag -- setting GUILE=... isn't going to change the
version of guild used, nor is it going to change the shared library that
GDB links against, so just changing the guile version seems like a
recipe for incompatibility problems.

Below is a patch that forces GDB to compile our guile scripts using a
suitable version of guile.  This could be applied irrespective of
whether you revert b7e5a29602143b53267efcd9c8d5ecc78cd5a62f or not.

What do you think?

Thanks,
Andrew

---

commit 6d326010217a2c94ad27d4063f90f689f7c11615
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Tue Mar 5 12:35:05 2024 +0000

    gdb/data-directory: set GUILE for compiling GDB's guile scripts
    
    After this commit:
    
      commit d006ec41c448d9f4a84df50391e87cbf0aa8c152
      Date:   Thu Dec 28 14:08:39 2023 -0700
    
          Pass GUILE down to subdirectories
    
    I have had issues with GDB's guile support.  Commit d006ec41c448 sets
    the GUILE variable in the top-level Makefile to the default value
    'guile'.
    
    The problem this causes for me is that 'guile' on my system is
    2.0.14.  I also have guile2.2 available on my system, and this is
    version 2.2.6.
    
    When GDB configures it selects looks for a suitable guile version to
    use, and it looks in the order:
    
      guile-3.0
      guile-2.2
      guile-2.0
    
    This means that on my system GDB chooses to use the guile2.2 library
    to link against, and uses guild2.2 as the compiler to pre-compile
    GDB's guile scripts.
    
    However, guild (and guile2.2) check for the GUILE environment
    variable, and use the value of this variable as the version of guile
    interpreter which is used when compiling things.
    
    What this means is that after commit d006ec41c448, I am now using the
    guild2.2 binary (version 2.2.6), but this is then invoking the guile
    binary (version 2.0.14).  The compiled scripts are then loaded by GDB,
    which is linking against libguile-2.2.so.1, this results in the
    following error:
    
      $ ./gdb/gdb --data-directory ./gdb/data-directory
      Exception caught while booting Guile.
      Error in function "load-thunk-from-memory":
      not an ELF file
      ./gdb/gdb: warning: Could not complete Guile gdb module initialization from:
      /tmp/binutils-gdb/build/gdb/data-directory/guile/gdb/boot.scm.
      Limited Guile support is available.
      Suggest passing --data-directory=/path/to/gdb/data-directory.
      GDB Version: 15.1
    
      (gdb)
    
    We could fix this by reverting some parts of d006ec41c448,
    specifically, the part which sets 'guile' as the default value of
    GUILE in the top-level Makefile.  However, I wonder if there's a
    better solution.
    
    GDB already has a configure flag `--with-guile=...` if this isn't
    provided then GDB looks for a sensible default.
    
    I think that when compiling GDB's guile files we should use a
    consistent set of tools, i.e. a matching version of guild and guile,
    both of which correspond to the shared library GDB will link against.
    
    I propose that this should be done by setting the GUILE environment
    variable in gdb/data-directory/Makefile.in based on the version of
    guile that GDB's configure script selected.
    
    This does mean that doing:
    
      make all-gdb GUILE=....
    
    will no longer work, GDB will ignore this setting, however, if we
    really want to compile GDB's guile scripts using a different guile
    version then surely we should also be linking to a corresponding
    shared library, and (maybe) using the corresponding guild version too?
    This can be achieved by configuring GDB using `--with-guile=....`.
    
    After this commit I no longer have issues compiling GDB with guile
    support.

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 915082056dd..6e4b96f0acf 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -284,7 +284,29 @@ AC_DEFUN([GDB_GUILE_PROGRAM_NAMES], [
   fi
 
   GUILD="$ac_cv_guild_program_name"
+
+  AC_CACHE_CHECK([for the absolute file name of the 'guile' command],
+    [ac_cv_guile_program_name],
+    [ac_cv_guile_program_name="`$1 --variable guile $2`"
+
+     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
+     # the 'guile' 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_guile_program_name" = "x"; then
+       guile_exec_prefix="`$1 --variable exec_prefix $2`"
+       ac_cv_guile_program_name="$guile_exec_prefix/bin/guile"
+     fi
+  ])
+
+  if ! "$ac_cv_guile_program_name" --version >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+    AC_MSG_ERROR(['$ac_cv_guile_program_name' appears to be unusable])
+  fi
+
+  GUILE="$ac_cv_guile_program_name"
+
   AC_SUBST([GUILD])
+  AC_SUBST([GUILE])
 ])
 
 dnl GDB_GUILD_TARGET_FLAG
diff --git a/gdb/configure b/gdb/configure
index d0fd1760b88..6a780810bc8 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -721,6 +721,7 @@ HAVE_GUILE_TRUE
 GUILE_LIBS
 GUILE_CPPFLAGS
 GUILD_TARGET_FLAG
+GUILE
 GUILD
 pkg_config_prog_path
 HAVE_PYTHON_FALSE
@@ -11499,7 +11500,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11502 "configure"
+#line 11503 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11605,7 +11606,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11608 "configure"
+#line 11609 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -28780,6 +28781,34 @@ $as_echo "$ac_cv_guild_program_name" >&6; }
 
   GUILD="$ac_cv_guild_program_name"
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the absolute file name of the 'guile' command" >&5
+$as_echo_n "checking for the absolute file name of the 'guile' command... " >&6; }
+if ${ac_cv_guile_program_name+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_guile_program_name="`"${with_guile}" --variable guile "${guile_version}"`"
+
+     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
+     # the 'guile' 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_guile_program_name" = "x"; then
+       guile_exec_prefix="`"${with_guile}" --variable exec_prefix "${guile_version}"`"
+       ac_cv_guile_program_name="$guile_exec_prefix/bin/guile"
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guile_program_name" >&5
+$as_echo "$ac_cv_guile_program_name" >&6; }
+
+  if ! "$ac_cv_guile_program_name" --version >&5 2>&5; then
+    as_fn_error $? "'$ac_cv_guile_program_name' appears to be unusable" "$LINENO" 5
+  fi
+
+  GUILE="$ac_cv_guile_program_name"
+
+
+
 
     ;;
   *)
@@ -28810,6 +28839,34 @@ $as_echo "$ac_cv_guild_program_name" >&6; }
 
   GUILD="$ac_cv_guild_program_name"
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the absolute file name of the 'guile' command" >&5
+$as_echo_n "checking for the absolute file name of the 'guile' command... " >&6; }
+if ${ac_cv_guile_program_name+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_guile_program_name="`"${pkg_config_prog_path}" --variable guile "${guile_version}"`"
+
+     # In Guile up to 2.0.11 included, guile-2.0.pc would not define
+     # the 'guile' 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_guile_program_name" = "x"; then
+       guile_exec_prefix="`"${pkg_config_prog_path}" --variable exec_prefix "${guile_version}"`"
+       ac_cv_guile_program_name="$guile_exec_prefix/bin/guile"
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guile_program_name" >&5
+$as_echo "$ac_cv_guile_program_name" >&6; }
+
+  if ! "$ac_cv_guile_program_name" --version >&5 2>&5; then
+    as_fn_error $? "'$ac_cv_guile_program_name' appears to be unusable" "$LINENO" 5
+  fi
+
+  GUILE="$ac_cv_guile_program_name"
+
+
+
 
     ;;
   esac
diff --git a/gdb/configure.ac b/gdb/configure.ac
index aa91bfb3a17..b18187c6d7e 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1104,6 +1104,7 @@ dnl        pkg-config --exists $version
 dnl        pkg-config --cflags $version
 dnl        pkg-config --libs $version
 dnl        pkg-config --variable guild $version
+dnl        pkg-config --variable guile $version
 dnl        The script will be called with $version having each value in
 dnl        $try_guile_versions until --exists indicates success.
 
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 2a40be4ade0..c1aded24ca8 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -147,6 +147,7 @@ GUILE_COMPILED_FILES = \
 
 GUILD = @GUILD@
 GUILD_TARGET_FLAG = @GUILD_TARGET_FLAG@
+GUILE = @GUILE@
 
 # Flags passed to 'guild compile'.
 # Note: We can't use -Wunbound-variable because all the variables
Tom Tromey March 8, 2024, 6:03 p.m. UTC | #7
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> After once again forgetting to add GUILE=guile2.2 to my GDB build I was
Andrew> thinking about this issue again.

Andrew> Given that GDB has a --with-guile=... configure option, and that our
Andrew> configure scripts try to identify a matching version of guild and a
Andrew> shared library to link GDB against, I wondered why we don't just force
Andrew> the use of a matching version of guile.

Andrew> I guess I'm suggesting that for building GDB's guile components we
Andrew> should respect either the --with-guile=... configure option, or what the
Andrew> configure script auto-detected, and should not be picking up any build
Andrew> time GUILE=... flag -- setting GUILE=... isn't going to change the
Andrew> version of guild used, nor is it going to change the shared library that
Andrew> GDB links against, so just changing the guile version seems like a
Andrew> recipe for incompatibility problems.

Andrew> Below is a patch that forces GDB to compile our guile scripts using a
Andrew> suitable version of guile.  This could be applied irrespective of
Andrew> whether you revert b7e5a29602143b53267efcd9c8d5ecc78cd5a62f or not.

Andrew> What do you think?

I have no issue with this.  If it helps you, you should do it.

FWIW I was waiting for a response from you before reverting this change.
https://sourceware.org/pipermail/gdb-patches/2024-February/206507.html


Overall I think that we really should revert my change.

cgen isn't run commonly enough to warrant the change breaking literally
anything else.  And, part of this is on cgen for not coming with any
kind of script for running it ... actually looking under the hood has
really soured me on cgen entirely.

The guild #! prologue also seems like an obvious bug to me.  However
it's perhaps too late to fix this in any useful way.

Tom
Andrew Burgess March 11, 2024, 10:27 a.m. UTC | #8
Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> Tom Tromey <tom@tromey.com> writes:
>>> This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f.
>>> 
>>> This patch caused problems for some users when building gdb, because
>>> it would cause 'guild' to be invoked with the wrong versin of guile.
>>> On the whole it seems simpler to just back this out.
>>> 
>>> * Makefile.in: Rebuild.
>>> * Makefile.tpl (BASE_EXPORTS): Remove GUILE.
>>> (GUILE): Remove.
>>> * Makefile.def (flags_to_pass): Remove GUILE.
>
> Andrew> Is it going to be possible to merge this with GCC in stage 4?  Would be
> Andrew> super useful if we could as this is still causing problems.
>
> We can always check it in to gdb now and then to gcc at some later date.
> If that sounds ok to you, I'll go ahead & do it.

Thanks, that would be great, and would certainly fix the build problems
I see.

Sorry for the late reply.

Thanks,
Andrew
Tom Tromey March 22, 2024, 5:25 p.m. UTC | #9
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> Thanks, that would be great, and would certainly fix the build problems
Andrew> I see.

I'm going to check it in to binutils-gdb in a minute.

For those reading on gcc-patches, please consider this a ping of the
patch.

thanks,
Tom
diff mbox series

Patch

diff --git a/Makefile.def b/Makefile.def
index 19954e7d731..c8c80af3657 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -312,7 +312,6 @@  flags_to_pass = { flag= GNATBIND ; };
 flags_to_pass = { flag= GNATMAKE ; };
 flags_to_pass = { flag= GDC ; };
 flags_to_pass = { flag= GDCFLAGS ; };
-flags_to_pass = { flag= GUILE ; };
 
 // Target tools
 flags_to_pass = { flag= AR_FOR_TARGET ; };
diff --git a/Makefile.in b/Makefile.in
index edb0c8a9a42..245dd610b53 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,7 @@ 
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
@@ -143,8 +143,7 @@  BASE_EXPORTS = \
 	M4="$(M4)"; export M4; \
 	SED="$(SED)"; export SED; \
 	AWK="$(AWK)"; export AWK; \
-	MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \
-	GUILE="$(GUILE)"; export GUILE;
+	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
 
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the build system.
@@ -452,8 +451,6 @@  GM2FLAGS = $(CFLAGS)
 
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 
-GUILE = guile
-
 # Pass additional PGO and LTO compiler options to the PGO build.
 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
 override CFLAGS += $(BUILD_CFLAGS)
@@ -886,7 +883,6 @@  BASE_FLAGS_TO_PASS = \
 	"GNATMAKE=$(GNATMAKE)" \
 	"GDC=$(GDC)" \
 	"GDCFLAGS=$(GDCFLAGS)" \
-	"GUILE=$(GUILE)" \
 	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
 	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
 	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
diff --git a/Makefile.tpl b/Makefile.tpl
index adbcbdd1d57..6e22adecd2f 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -6,7 +6,7 @@  in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
@@ -146,8 +146,7 @@  BASE_EXPORTS = \
 	M4="$(M4)"; export M4; \
 	SED="$(SED)"; export SED; \
 	AWK="$(AWK)"; export AWK; \
-	MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \
-	GUILE="$(GUILE)"; export GUILE;
+	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
 
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the build system.
@@ -455,8 +454,6 @@  GM2FLAGS = $(CFLAGS)
 
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 
-GUILE = guile
-
 # Pass additional PGO and LTO compiler options to the PGO build.
 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
 override CFLAGS += $(BUILD_CFLAGS)