Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 735154 - dev-lang/rust USE=system-llvm should be enabled by default
Summary: dev-lang/rust USE=system-llvm should be enabled by default
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Georgy Yakovlev
Depends on:
Reported: 2020-08-02 06:43 UTC by Michał Górny
Modified: 2021-02-23 15:54 UTC (History)
7 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-08-02 06:43:49 UTC
Given we're strongly against bundling libraries, not to mention the resulting build time, I don't really get why we default to using bundled LLVM.
Comment 1 Georgy Yakovlev gentoo-dev 2020-08-02 21:33:06 UTC
It's not only disabled by default, it's also stable-masked.

There are multiple reasons:

1) Internal copy is often a bit older than system one. Currently it's llvm9. And this is what's tested.
2) Patching of rust often required to support new versions of LLVM. It can be quite problematic.
3) Rust's llvm copy contains number of codegen fixes / backports from llvm trunk.
4) with system-llvm users loose a bit of functionality. For example:

> rustc --print target-cpus
> Available CPUs for this target:
>     native  - Select the CPU of the current host (currently pwr9).
>     440                                             
>     450                                             
>     601
>     ...

^ this and some other tight llvm integration only possible and works if using internal llvm.
on [system-llvm] rust this command will refuse to print CPUs.

5) It simply fails sometimes at codegen. It used to fail more often, we haven't encountered it for quite some time, thanks for upstream testing and local patching.

6) Build-wise, only sometimes LLD, but only for wasm. We don't install full llvm suite.

7) Tests sometimes fail with system-llvm. Testsuite is not enabled for users yet, needs more work filtering out meaningful tests and disabling what's useless for end-user.

Last 6 month there has been way less bug reports related to system-llvm, but I still think it's should not be the default. Yeah, bundling sucks, but in this case we loose functionality and maybe stability if we use system version. It's not like they bundle exact copy and results are exactly the same.
Comment 2 Luca Barbato gentoo-dev 2020-08-03 09:12:43 UTC
The rust llvm tends to have a number of fixes applied, we could try harder to have upstream to take fixes (like the one about the target list) and/or decide to carry them ourselves in our normal llvm.