Closed jessebraham closed 2 years ago
I've disabled lto
for the dev
profile and this seems to have resolved the linker error. Not sure why it won't work for dev
but will for release
.
I think this is related to https://github.com/rust-lang/compiler-builtins/issues/347. Doesn't look like there is a solution yet, just some work arounds & theories.
Just following up on this, seems although this hasn't been fixed yet its been tracked down to https://github.com/rust-lang/cargo/issues/10118#issuecomment-1006000210. This is why it works in release, because there are no overflow checks etc.
So I think this is almost certainly LTO's fault, but I think because we are using a GCC linker. I guess it is discarding some important symbols... like panic :D. I've only just come to this conclusion because I'm messing around with LTO on the STD port, and running into the same issues.
I am hoping that with LLD support tracked in https://github.com/espressif/llvm-project/issues/11, these issues will go away. Closing for that reason.
Using
rustc-1.56.0.1
installed from the rust-build repository. Building for the ESP8266 indev
mode seems to result in the following error:Curiously, building in
release
seems to resolve the issue. This can be reproduced by executing the following:The
Cargo.toml
manifest for this repository contains the following configuration for build profiles, not sure iflto
is the culprit or if it's something else: