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)?

Bruno




Reply via email to