[3/3] algol68: link libga68 dynamically by default

Message ID 20260805063729.3492311-3-twoerner@gmail.com
State New
Headers
Series [1/3] libga68: honour a preset A68FLAGS |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed

Commit Message

Trevor Woerner Aug. 5, 2026, 6:37 a.m. UTC
  The ga68 driver defaults to linking the Algol 68 runtime statically, so
every program carries its own copy of libga68 and a distribution that
packages the shared library finds nothing uses it. It is also the odd
one out: gfortran, gcobol and gcc itself all link their runtimes
dynamically by default and offer -static-lib<foo> for the other choice.

Default to dynamic. -static-libga68 continues to select static linking
for anyone who wants it.

Assisted by: Codex (Claude Opus 5)

gcc/algol68/ChangeLog:

	* a68spec.cc (libga68_link): Default to LIBGA68_DYNAMIC.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 gcc/algol68/a68spec.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jose E. Marchesi Aug. 5, 2026, 2:29 p.m. UTC | #1
Hello.

> The ga68 driver defaults to linking the Algol 68 runtime statically, so
> every program carries its own copy of libga68 and a distribution that
> packages the shared library finds nothing uses it. It is also the odd
> one out: gfortran, gcobol and gcc itself all link their runtimes
> dynamically by default and offer -static-lib<foo> for the other choice.
>
> Default to dynamic. -static-libga68 continues to select static linking
> for anyone who wants it.

Thanks for the patch.

We are not ready yet to turn on dynamic linking with libga68.  There are
some big changes coming in the compiler-runtime interface.  Hopefully we
will be able to switch to dynamic linking by default in GCC 17, but not
quite yet.

>
> Assisted by: Codex (Claude Opus 5)
>
> gcc/algol68/ChangeLog:
>
> 	* a68spec.cc (libga68_link): Default to LIBGA68_DYNAMIC.
>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
>  gcc/algol68/a68spec.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/algol68/a68spec.cc b/gcc/algol68/a68spec.cc
> index bc11abde76e9..d92da22131de 100644
> --- a/gcc/algol68/a68spec.cc
> +++ b/gcc/algol68/a68spec.cc
> @@ -32,7 +32,7 @@ enum libga68_link_mode
>    LIBGA68_DYNAMIC
>  };
>  
> -static enum libga68_link_mode libga68_link = LIBGA68_STATIC;
> +static enum libga68_link_mode libga68_link = LIBGA68_DYNAMIC;
>  
>  /* This bit is set if we saw a `-xfoo' language specification.  */
>  #define LANGSPEC (1 << 1)
  

Patch

diff --git a/gcc/algol68/a68spec.cc b/gcc/algol68/a68spec.cc
index bc11abde76e9..d92da22131de 100644
--- a/gcc/algol68/a68spec.cc
+++ b/gcc/algol68/a68spec.cc
@@ -32,7 +32,7 @@  enum libga68_link_mode
   LIBGA68_DYNAMIC
 };
 
-static enum libga68_link_mode libga68_link = LIBGA68_STATIC;
+static enum libga68_link_mode libga68_link = LIBGA68_DYNAMIC;
 
 /* This bit is set if we saw a `-xfoo' language specification.  */
 #define LANGSPEC (1 << 1)