-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.WG-embeddedWorking group: Embedded systemsWorking group: Embedded systems
Description
When compiling the compiler_builtins
crate for any of the thumb
targets in release mode and with debuginfo enabled. Without debuginfo the build succeeds (we are testing this by building rust-std for the thumb
targets). This doesn't affect the ARM Linux targets.
STR
$ cp -r $(rustc --print sysroot)/lib/rustlib/src/rust/src/ src && cd $_
$ cd libcompiler_builtins
$ cat >>Cargo.toml <<'EOF'
[profile.release]
debug = true
EOF
$ cargo build --target thumbv7m-none-eabi --release
LLVM ERROR: Unexpected anonymous function when writing summary
Metadata
$ rustc -V
rustc 1.28.0-nightly (e3bf634e0 2018-06-28)
Needs bisecting
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.WG-embeddedWorking group: Embedded systemsWorking group: Embedded systems
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Mark-Simulacrum commentedon Jun 30, 2018
e1151c9 - #49479 - cc @nagisa @nox
nikic commentedon Jun 30, 2018
Could this be hitting the case where linking is performed without thinlto, but bitcode is still being written through thinlto buffers? It might be worth trying to apply these changes and see if it fixes the issue: https://github.com/rust-lang/rust/pull/51007/files#diff-a3c60982b42eac1d2e3fd67f4d562ae8R550
nagisa commentedon Jun 30, 2018
Yeah, the error message definitely sounds related to thinlto. At least "summary" is a thinlto concept.
That being said, it doesn’t seem like thinlto is disabled anywhere in the original report, so…
agalakhov commentedon Jul 21, 2018
I just tried it with "-Z thinlto=no", and it does NOT help.
aribeironovaes commentedon Sep 1, 2018
Hi @japaric ,
Did you figure our how to fix this issue?
I'm trying to run cortex-m-quickstart on a STM32L475 and I'm getting Stuck on the LLVM ERROR: Unexpected anonymous function when writing summary error if debug = true.
Can you let me know if you could successfully run the sample on this version of Cortex M4?
Thanks lot in advance,
Angelo Ribeiro.
maximevince commentedon Nov 1, 2018
Same problem here! Any solution or workaround known?
nikic commentedon Nov 1, 2018
Running with
-C lto=thin
worked for me, so I think my general guess in #51947 (comment) was right -- unfortunately the linked patch has landed in the meantime and has not fixed the issue. rustc is being run with--crate-type lib --emit=dep-info,link
here, I'll have to check what exactly that means for bitcode emission.nikic commentedon Nov 1, 2018
Here is a reproducer without the compiler_builtins/thumb dependency:
Compiled with
--crate-type=rlib -O
this produces the anon function error.Run name-anon-globals after LTO passes as well
Rollup merge of rust-lang#55609 - nikic:fix-51947, r=nagisa