Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759064 - dev-lang/rust rustc breaks if llvm (and clang) is rebuilt with toggled USE=debug
Summary: dev-lang/rust rustc breaks if llvm (and clang) is rebuilt with toggled USE=debug
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
Depends on:
Reported: 2020-12-08 15:58 UTC by flippynelle
Modified: 2020-12-14 00:47 UTC (History)
3 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 flippynelle 2020-12-08 15:58:50 UTC
emerge doesn't rebuild rust (1.48.0) when/after llvm (and clang) is rebuilt with a different USE=debug flag (ie. from "-debug" to "debug")
therefore running "rustc" binary yields error:

rustc: symbol lookup error: /usr/lib/rust/lib/ undefined symbol: _ZN4llvm24DisableABIBreakingChecksE, version LLVM_11

Reproducible: Always

Steps to Reproduce:
I recommend using FEATURES=binpkg-multi-instance so that you can quickly emerge --usepkg=y between the different USE versions for llvm(and clang)

1. emerge llvm and clang with USE=-debug (ie. DISabled "debug" use flag)
(clang needs to be emerged too otherwise emerging llvm won't be allowed if the "debug" use flag differs between llvm and clang, apparently)

sys-devel/llvm-11.0.0 USE="libffi ncurses -debug -doc -exegesis -gold -libedit -test -xar -xml -z3" 

sys-devel/clang-11.0.0 USE="static-analyzer -debug -default-compiler-rt -default-libcxx -default-lld -doc -test -xml"

2. emerge rust
dev-lang/rust-1.48.0 USE="clippy nightly parallel-compiler rls rustfmt system-bootstrap system-llvm -debug (-doc) -libressl (-miri) -test -wasm" 

3. run "rustc -Vv"
to see that it does work:
# rustc -vV
rustc 1.48.0-nightly
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0

4. now re-emerge llvm and clang with "USE=debug" (ie. enabled "debug" use flag) but don't also (manually) re-emerge rust!

5. now you can run "rustc -vV" to see it's broken:
# rustc -vV
rustc: symbol lookup error: /usr/lib/rust/lib/ undefined symbol: _ZN4llvm24DisableABIBreakingChecksE, version LLVM_11

6. you can try to see if emerge wants to re-emerge rust, by running:
emerge --verbose --tree --deep --with-bdeps=y --changed-use --newuse --ask --complete-graph=y --changed-deps=y --update --usepkg=y --binpkg-respect-use=y --binpkg-changed-deps=y --nospinner --backtrack=300 @world

nothing happens.

7. now you can try to recompile rust (somehow) to make it work with the new llvm.
or, you can re-emerge llvm and clang with the USE=-debug from step 1 and then step5 will work like step3 again :)

Maybe rust-bin needs to be emerged? don't know...

Exception: no cargo executable found at `/bin/cargo`
 * ERROR: dev-lang/rust-1.48.0::localrepo failed (compile phase):
 *   (no error message)

Actual Results:  
oh.. uhm..

Expected Results:  
maybe: emerge will want to somehow also re-emerge rust when llvm gets emerged with different USE=debug setting
Comment 1 Ionen Wolkens gentoo-dev 2020-12-08 16:27:29 UTC
If required sounds like would need bug #680496, but rust's system-bootstrap situation may complicate things even if that was implemented.
Comment 2 flippynelle 2020-12-14 00:47:12 UTC
I seem to have forgotten to emphasize the obvious, rust is built with USE=system-llvm
seems important.
I haven't tried with USE=-system-llvm

But if you want me to try, let me know.