When ld is mold:
$ ld --version
mold 2.40.4 (compatible with GNU ld)
then the soft-deprecated ctypes.util.find_library fails to find libraries.
With GNU ld, find_library(c) does something like:
$ ld -t -o /dev/null -lc
/usr/lib64/libc.so
/lib64/libc.so.6
/usr/lib64/libc_nonshared.a
/lib64/ld-linux-x86-64.so.2
/usr/lib64/libc_nonshared.a
/lib64/ld-linux-x86-64.so.2
/usr/bin/ld.bfd: warning: cannot find entry symbol _start; not setting start address
But, mold does not support -t, and even the equivalent --trace doesn't work the same:
$ mold --trace -o /dev/null -lc
mold: fatal: -m option is missing
This matches find_library's documented behaviour:
If no library can be found, return None.
[...]
Soft deprecated since version 3.15: This function is kept for use in cases where it works, but not expected to be updated for additional platforms and configurations.
so we should skip the test.
Note that switching to --trace ... might break other lds. Fixing one unsupported configuration is not worth possibly breaking other unknown ones.
Linked PRs
When
ldismold:then the soft-deprecated
ctypes.util.find_libraryfails to find libraries.With GNU
ld,find_library(c)does something like:But,
molddoes not support-t, and even the equivalent--tracedoesn't work the same:This matches
find_library's documented behaviour:so we should skip the test.
Note that switching to
--trace ...might break otherlds. Fixing one unsupported configuration is not worth possibly breaking other unknown ones.Linked PRs