EmbarkStudios / crash-handling

Collection of crates to deal with crashes
Apache License 2.0
138 stars 13 forks source link

Can't build crash-context on arm-unknown-linux-gnueabihf #5

Closed msirringhaus closed 2 years ago

msirringhaus commented 2 years ago

I'm unable to build crash-context on arm-unknown-linux-gnueabihf, either locally (using a raspberry pi) or using github actions: https://github.com/msirringhaus/minidump_writer_linux/actions/runs/1992494641

Unfortunately, the error is only

error: could not compile crash-context

even when running --verbose. Is this supposed to work?

msirringhaus commented 2 years ago

These are working fine:

https://github.com/msirringhaus/minidump_writer_linux/actions/runs/1992598643

Jake-Shadle commented 2 years ago

Hmm, I will install cross locally and try and figure out what the actual error is, as you say the error output from GHA is useless.

msirringhaus commented 2 years ago

I get the same unhelpful error message locally, too.

Jake-Shadle commented 2 years ago

I can't even get cross working locally at all because I use podman and using main switched to GHCR which doesn't have proper image tags. :stuck_out_tongue:

Jake-Shadle commented 2 years ago

Ahh nvm

[target.arm-unknown-linux-gnueabihf]
image = "ghcr.io/cross-rs/arm-unknown-linux-gnueabihf@sha256:2c7f685d79baa15a6437c9ccb76381ad2f597eec62e1a27f9c11fea5ce2adbf6"
Jake-Shadle commented 2 years ago

I suspected it was the global_asm! and sure enough I had missed replacing a preprocessor define with its constant during the port. It gives a not great error when building the package directly, but at least show the line that was problematic, but appears to just entirely give up when being compiled as a dependency, even for crates in the same workspace.

Jake-Shadle commented 2 years ago

I've bumped and published crash-context to 0.0.2.

msirringhaus commented 2 years ago

Just to confirm: This seems to indeed fix it: https://github.com/msirringhaus/minidump_writer_linux/actions/runs/1993088807 Building locally works now, too.

dkc6gh commented 3 months ago

@Jake-Shadle @msirringhaus I am still having the same issue for ARM v7 cross compilatoin. Somehow inserting "nop" into arm.rs source seems to fix the problem for me. Could someone look into this again?

// Return 0
"mov   r0, #0",
"nop",
"bx    lr",
Jake-Shadle commented 3 months ago

Can you please add what target triple doesn't compile and what the compile error actually is? armv7-unknown-linux-gnueabihf compiles just fine.

dkc6gh commented 3 months ago

Can you please add what target triple doesn't compile and what the compile error actually is? armv7-unknown-linux-gnueabihf compiles just fine.

Here is the mysterious error message:

error: :23:1: invalid instruction, any one of the following would fix this: bx lr ^

error: could not compile crash-context (lib)

Jake-Shadle commented 3 months ago

Ok well I'm not seeing that, either you are using a different target triple or you're on an older version of rustc?

dkc6gh commented 3 months ago

Ok well I'm not seeing that, either you are using a different target triple or you're on an older version of rustc?

The error only occurs when using the 'release' flag. Building without the flag is successful.

Jake-Shadle commented 3 months ago

https://github.com/EmbarkStudios/crash-handling/pull/89