On 3/19/25 6:41 PM, Nate Eldredge wrote:
> I have dev-lang/rust-1.85.0-r1 installed.  It fails to build trivial
> programs:
> 
> nate@trapezoid /tmp $ rustc t.rs  
> error: linker `clang-19` not found
>   |
>   = note: No such file or directory (os error 2)
> 
> error: aborting due to 1 previous error
> > It appears that although
> rust is installed with LLVM_SLOT=19, its dependency on clang is
> being satisfied by clang-20.  clang-19 is no longer on the system
> after a recent `emerge -vauDN @world ; emerge -a --depclean`
> installed clang-20 and removed clang-19 as apparently not needed.
> Below is the output of `emerge -pve dev-lang/rust`.
> 
> I'm using profile default/linux/arm64/23.0/llvm/systemd (dev).  The
> USE flags I've set for dev-lang/rust are `rustfmt profiler system-
> llvm clippy system-bootstrap`.
> 
> Is this a bug in the ebuild, that rust should explicitly depend on
> clang-19 when installed with LLVM_SLOT=19 ?  Or have I messed
> something up locally?  I don't think I've done anything except the
> usual `emerge -vauDN @world ; emerge -a --depclean`.
> 
> Happy to provide other details.  I was not sure what is the best way
> to show dependencies and what's installed.

Rust doesn't depend on clang at all. The current ebuild does embed $CC
at the time you compile rust, as the default value for

```
rustc -C linker=$CC
```

But for the llvm profile that should be "clang" and not "clang-19". So
you probably changed this to a non-default value and then it broke. The
ebuild is buggy either way, yes...


At no point is it expected that rust explicitly depends on any specific
compile. The solution is to make sure the default linker isn't specific
to that version in the first place.

You can also pass -C linker=clang if you like. Portage will already do
this for rust software packaged in ::gentoo.



-- 
Eli Schwartz

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to