LoadLibClang binds eleven symbols twice, names the first candidate rather than the library it loaded when a symbol is missing, and has no name for LLVM 23's libclang #57
Labels
No labels
bug
claude:blocked
claude:done
claude:failed
claude:in-progress
claude:ready
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Crafter.Build#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two small defects in
LoadLibClang(implementations/Crafter.Build-Lint.cpp), and a gap in the list of names it tries::183-193bind again the eleven slots that:172-182bound,clang_Cursor_getBinaryOpcodethroughclang_EvalResult_dispose. The second pass writes the same pointers, so lint works. Where the library lacks one of those symbols, though, the error names it twice.loaded <candidates.front()> but it is missing ...(:196): the first name of the list it tried, not the one that opened, which the loop at:119-123does not keep. Without a pinned library the list isLibClangNames(:31-34), so wherelibclang.sodoes not open andlibclang.so.21.1does, the message nameslibclang.so. The handle of the library that did open is then dropped withoutdlclose(:195).LibClangNameshaslibclang.so.22.1,.21.1and.20.1, but notlibclang.so.23.1, the soname of LLVM 23's libclang. On Arch,readelf -d /usr/lib/libclang.sogivesLibrary soname: [libclang.so.23.1], and the Flatpak's/app/lib/libclang.solinks tolibclang.so.23.1too. A system that has LLVM 23's libclang under that name only, without the unversionedlibclang.solink, which a distribution may keep for a development package, opens none of the names, unless the Toolchain names the library itself (CRAFTER_BUILD_LIBCLANG, orlib/libclang.soof a prefix, as in the Flatpak).Read from the code; not run. Found by the pre-push review of 6.4.3.
Line numbers refer to
cb8914d(6.4.3).Proposal
Drop
:183-193. Keep the name that opened for the error, anddlclosethe handle before dropping it. Addlibclang.so.23.1, or make the versioned name from the Toolchain's clang version, so that the list does not need an edit for every LLVM release.