Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948500 - llvm-r2.eclass: llvm-config wrapper returns non-existent .so filename on default/linux/arm64/23.0/musl/llvm
Summary: llvm-r2.eclass: llvm-config wrapper returns non-existent .so filename on defa...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-21 12:25 UTC by Eric Joldasov
Modified: 2025-01-22 07:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
generated llvm-config script (aarch64-unknown-linux-musl-llvm-config,4.56 KB, application/x-shellscript)
2025-01-21 12:26 UTC, Eric Joldasov
Details
log of generated llvm-config (llvm-config-calls.txt,2.09 KB, text/plain)
2025-01-21 12:27 UTC, Eric Joldasov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Joldasov 2025-01-21 12:25:36 UTC
llvm-config generated by llvm_chost_setup/generate_llvm_config does not return correct filename or filepath to the LLVM shared library, which breaks my cross-compilation attempt with Zig and modified https://github.com/gentoo/gentoo/pull/39765 when using `crossdev --llvm --target aarch64-unknown-linux-musl` and `default/linux/arm64/23.0/musl/llvm` profile there.

Reproducible: Always

Steps to Reproduce:
1. Run real llvm-config --libfiles or llvm-config --libnames
2. Run same with generated ${T}/llvm-bin/llvm-config
3. Compare result (ignored /usr/..., it's because of crossdev)
Actual Results:  
real llvm-config --libfiles:
/usr/lib/llvm/19/lib/libLLVM-19+libcxx.so
generated llvm-config --libfiles:
/usr/aarch64-unknown-linux-musl/usr/lib/llvm/19/lib/libLLVM-19.so

Second path does not exist in that directory, here's part of listing:

libLLVM-19+libcxx.so -> libLLVM.so.19.1+libcxx
libLLVM.so -> libLLVM.so.19.1+libcxx
libLLVM.so.19.1+libcxx

Expected Results:  
They should return same paths or at least point to existing file.

If I symlink libLLVM-19.so manually it works fine and I get working Zig.

I suggest either of fixes:
* generated llvm-config should be consistent with real and add "+libcxx" part in the output,
* or llvm package can always install libLLVM-19.so symlink. I'm not familiar with how it works on LLVM profiles, sorry if it's unwanted, but arm64 glibc profile has it for example.

More about consistency:
* --version: both return 19.1.4+libcxx
* --libs: real returns "-lLLVM-19+libcxx", wrapper returns "-lLLVM-19", it was not a problem when building Zig
Comment 1 Eric Joldasov 2025-01-21 12:26:51 UTC
Created attachment 917260 [details]
generated llvm-config script
Comment 2 Eric Joldasov 2025-01-21 12:27:34 UTC
Created attachment 917261 [details]
log of generated llvm-config