You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using rustc-1.56.0.1 installed from the rust-build repository. Building for the ESP8266 in dev mode seems to result in the following error:
error: linking with `xtensa-lx106-elf-gcc` failed: exit status: 1
|
= note: "xtensa-lx106-elf-gcc" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/examples/blinky-e0818fc35520ce14.panic_halt-43f7212d7c513c73.panic_halt.f3fb034b-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/deps" "-L" "/Users/jesse/Work/esp8266-hal/target/debug/deps" "-L" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/build/esp8266-hal-2d03f26e6b6aa8d6/out" "-L" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/build/xtensa-lx-9a48fc8303ca0ffa/out" "-L" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/build/xtensa-lx-rt-02f5e2b7b68604e9/out" "-L" "/Users/jesse/.rustup/toolchains/esp/lib/rustlib/xtensa-esp8266-none-elf/lib" "-Wl,--start-group" "-Wl,--end-group" "-Wl,-Bstatic" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/deps/libcompiler_builtins-8b73f41dc98a2660.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/Users/jesse/.rustup/toolchains/esp/lib/rustlib/xtensa-esp8266-none-elf/lib" "-o" "/Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/examples/blinky-e0818fc35520ce14" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-nostartfiles" "-Wl,-Tlink.x"
= note: /Users/jesse/.xtensa/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /Users/jesse/Work/esp8266-hal/target/xtensa-esp8266-none-elf/debug/deps/libcompiler_builtins-8b73f41dc98a2660.rlib(compiler_builtins-8b73f41dc98a2660.compiler_builtins.77efb3e9-cgu.3.rcgu.o):(.literal._ZN17compiler_builtins3int19specialized_div_rem23u32_normalization_shift17h93377cdcc12e9cdcE+0x8): undefined reference to `core::panicking::panic'
collect2: error: ld returned 1 exit status
= help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `esp8266-hal` due to previous 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 if lto is the culprit or if it's something else:
Just following up on this, seems although this hasn't been fixed yet its been tracked down to rust-lang/cargo#10118 (comment). 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 espressif/llvm-project#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:The text was updated successfully, but these errors were encountered: