Hi Simon,
Sam James wrote:
> $ gcc lld.c -Wl,--version-script=lld.map -fuse-ld=lld
> ld.lld: error: version script assignment of 'VERS_1' to symbol 'sym' failed:
> symbol not defined
> ld.lld: error: version script assignment of 'VERS_2' to symbol 'sym' failed:
> symbol not defined
> collect2: error: ld returned 1 exit status
>
> bfd accepts it (and doesn't warn), mold warns, while lld errors
> out. It's an intentional (albeit IMO unfortunate) decision in lld. We
> can either define `sym` in AC_LANG_PROGRAM or we can pass
> -Wl,--undefined-version if supported by the linker.
Before we think about how to modify the configure test, we need to
think about how the packages, that make use of the gl_LD_VERSION_SCRIPT,
shall behave with lld >= 16.
- Are these packages supposed to use -Wl,--version-script only
with symbol maps that contain only defined symbols?
- If no: Are these packages supposed to use -Wl,--undefined-version
by themselves? Or should Gnulib define a variable that contains
'-Wl,--undefined-version' when the linker needs this in order to
accept undefined symbols?
Then update doc/ld-version-script.texi and m4/ld-version-script.m4 ...
Bruno