-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross compilation x86_64-unknown-linux-gnu (Debian 9) -> arm-unknown-linux-gnueabihf (RPi Zero W) produces crashing binary #74517
Comments
I have reproduced this bug with rustc 1.44.1. It only occurs with cross compilation (running |
This seems to be an issue that affects all compilers from at least 1.43 onward. The binary from rustc 1.45 is also bad. (See next comment from me) |
Yes, |
Reading into cargo-bisect-rustc, I have realized that my current workflow will probably not work well with bisect, as I am using a VM to run Debian and using ssh from the host machine to load the binaries onto a Pi. @Kixunil I recommend adding the |
Heh, I also run VMs (Qubes), but I might get it to work if I fiddle with it enough. However, my time is not very abundant these days, so I'd appreciate if someone can do it instead. Is there some bot command to add such a tag? I don't have the rights to do it using GitHub interface and didn't find any documentation on it. |
Sorry, I could not add tags either, so I assumed that you had the ability to. Shows my experience. Also, |
This comment has been minimized.
This comment has been minimized.
I have started backtracking to see what version broke. 1.35 still has the bug and 1.30 as well. Interestingly, the debug version of 1.30 does not give a segmentation fault. Instead, it is an illegal instruction error. Time to go to 1.25 and 1.20. |
1.20.0 has the same bugs in both release and debug (segfault). This seems to be a rather old bug. |
Maybe it never worked and nobody noticed? Might be worth trying on other Pis as well, unfortunately, I don't have one laying around right now. BTW, found the docs now: https://github.com/rust-lang/triagebot/wiki/Labeling |
Yeah, that hypothesis sounds more likely. Later models of Pi have different architectures. So in terms of Rust toolchains, that would be the Final note: Did rust support the |
You are probably using armv7 linker assuming Debian and Ubuntu packages are the same:
Notice @rustbot modify labels: -E-needs-bisection |
@mati865 yes, I have |
@Kixunil I don't know since I don't use Debian/Ubuntu as my daily driver. |
Triage: Is this still a problem? Googling a bit it seems as if plenty of people are compiling Rust for RPi Zero W nowadays. |
@Enselic oh, this is old, Debian had three releases since then. :D Could try with bookworm later. |
I tried to cross-compile a basic hello world program (just
cargo new
) on x86_64 Debian 9 (installed using Rustup) with arm GCC linker for RPi Zero W. The compilation finished "successfully", but the produced binary crashes right after start.Command used for compiling:
RUSTFLAGS="-v -g -C linker=arm-linux-gnueabihf-gcc" cargo build --target arm-unknown-linux-gnueabihf
, also tried with--release
, same issueSame thing happens when linker is set using
.cargo/config
:I expected the code to produce
Hello, world!
when run or RPiInstead, I got
Segmentation fault
with the following backtrace (gdb) when running the produced binary:Meta
rustc --version --verbose
:The same issue is present on
1.43.0
stable.Since it's Segfault,
RUST_BACKTRACE
has no effect.CC @jooray
The text was updated successfully, but these errors were encountered: