On Wed, Nov 19, 2025 at 6:38 PM Bruno Haible via Gnulib discussion
list <[email protected]> wrote:
>
> Simon Josefsson wrote:
> > I think both 'yes' and 'no' is reasonable, and possibly even a third
> > mode: it will depend on the linker.
>
> Looking at the packages that use this module:
>   - crypto modules of yours (libidn, libidn2, libtasn1, gnutls, gsasl,
>     shishi, OATH, gss),
>   - guile,
>   - libu2f-host,
>
> I attempted to build two of these packages with CFLAGS="-fuse-ld=lld -O2 -g"
> and gl_cv_sys_ld_version_script=yes.
>
> Results:
>   * libtasn1 builds successfully, and the resulting shared library has
>     @@ symbols (as shown by "nm -D"). So, gl_cv_sys_ld_version_script=yes
>     is the appropriate configure test outcome for this package.
>   * guile 3.0.10 gets a build failure:
>       CCLD     libguile-3.0.la
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_options' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_language' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_result' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_output' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_output_length' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_maybe_valid_type_p' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_read' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_eval' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_print' failed: symbol not defined
>     ld.lld: error: version script assignment of 'GUILE_2.0' to symbol 
> 'gdb_binding' failed: symbol not defined
>     collect2: error: ld returned 1 exit status
>     make[3]: *** [Makefile:2866: libguile-3.0.la] Error 1
>     Therefore, gl_cv_sys_ld_version_script=no is the appropriate outcome for
>     this package.
>
> > Maybe the simplest is to
> > fix the ld-version-script.m4 test to actually define 'syms' so the test
> > works better?
>
> That would break the guile configuration. So, it's not simple as that. guile
> apparently needs '-Wl,--undefined-version' if gl_cv_sys_ld_version_script=yes.
>
> Which linkers support '--undefined-version' (ld, gold, mold, lld)?

The Gold linker was deprecated in February 2025.  A better choice
would be ld.bfd nowadays.  Also see
<https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html>.

Jeff

Reply via email to