With recent lld, the --version-script check in net/jose's meson.build fails, causing it to erroneously use a -export-symbols-regex flag: cc: error: unknown argument: '-export-symbols-regex=^jose_.*' Fix this by removing the faulty check from meson.build.
Created attachment 249426 [details] net/jose: fix build with lld 18
The patch seems to work adequately for me, but it feels like there should be a better way to deal with the linker flag issue in meson. I've opened https://github.com/latchset/jose/issues/152 upstream, but in the meantime, I don't have any objection to the proposed patch.
(In reply to Howard Holm from comment #2) Yeah, the correct way to check for --version-script support in a linker would be to have a small test with one correct .c file and one correct .map file, the latter with only valid symbols from from the .c file. As it is, the meson test failed because it tries "-Wl,--version-script=...", which works neither on lld nor on BFD ld: $ cc version-test.c -o foo -Wl,--version-script=... -fuse-ld=lld ld.lld: error: cannot find version script ... cc: error: linker command failed with exit code 1 (use -v to see invocation) $ cc version-test.c -o foo -Wl,--version-script=... -fuse-ld=bfd /usr/local/bin/ld.bfd: cannot open linker script file ...: No such file or directory cc: error: linker command failed with exit code 1 (use -v to see invocation)
Created attachment 249437 [details] Alternative patch I don't have a build setup that uses lld 18. So it's hard for me to test alternative fixes. I'm wondering if something like the fix here https://github.com/xkbcommon/libxkbcommon/commit/ebe4157d77cbf88eb3b35d9155d56468e4709ba2 which is adding --undefined-version, solves the problem or is it a different issue than the undefined symbol problem causing the linker to fail on that test. So does this patch fix the issue?
^Triage: reporter is committer, assign accordingly.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=142d074b14d2f69452f2468d801d9f5e0d2669ef commit 142d074b14d2f69452f2468d801d9f5e0d2669ef Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-03-21 13:31:57 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-03-27 18:42:53 +0000 net/jose: fix build with lld 18 With recent lld, the --version-script check in net/jose's meson.build fails, causing it to erroneously use a -export-symbols-regex flag: cc: error: unknown argument: '-export-symbols-regex=^jose_.*' Fix this by adding --undefined-version to the meson check, so it succeeds. PR: 277905 Approved by: hdholm@alumni.iastate.edu (maintainer) MFH: 2024Q1 net/jose/files/patch-lib_meson.build (new) | 10 ++++++++++ 1 file changed, 10 insertions(+)
A commit in branch 2024Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0f0ed642ede141994fc8b610ea6ee141ccc7c16a commit 0f0ed642ede141994fc8b610ea6ee141ccc7c16a Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-03-21 13:31:57 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-03-27 18:45:35 +0000 net/jose: fix build with lld 18 With recent lld, the --version-script check in net/jose's meson.build fails, causing it to erroneously use a -export-symbols-regex flag: cc: error: unknown argument: '-export-symbols-regex=^jose_.*' Fix this by adding --undefined-version to the meson check, so it succeeds. PR: 277905 Approved by: hdholm@alumni.iastate.edu (maintainer) MFH: 2024Q1 (cherry picked from commit 142d074b14d2f69452f2468d801d9f5e0d2669ef) net/jose/files/patch-lib_meson.build (new) | 10 ++++++++++ 1 file changed, 10 insertions(+)