-
Notifications
You must be signed in to change notification settings - Fork 11
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
Can not cross compile for target aarch64-linux-gnu-gcc due to linking error "error adding symbols: file in wrong format" #43
Comments
Now I can cross compile.
However this of course stops linking to c++ library. |
I also have not been able to cross compile before, thus the existence of the c-stubs for compilation in CI. I never dug in very much as to why to be honest. I wonder if the library produced assumes 32 bit? I don't recall what rpi I used to use for this development. Can you run |
Have you tried enabling the feature for statically linking to c++ std lib? |
Jup can file this rlib file. Output of file command
is the following.
|
Yes, i did. If I only use the feature with statically linking to c++ std lib.
Then I get the following error message:
If I use both feature with c-stubs and linking to c++ library statically
then it compiles. My question is here, does it still link to the stubs or then to c++ library instead ? |
It'll only link to the C stubs. The rpi library depends on the C++ standard library, C stubs does not |
What is the problem
I want to cross compile on fedora 37 amd 64 bit for a rasberry pi 4, arm 64 bit.
I can cross compile a hello world program for this target. However as soon as I use this crate in the project, the cross compiling fails with an linking error /aarch64-unknown-linux-gnu/debug/deps/librpi_led_matrix_sys-d20828d1ca08a5b2.rlib: error adding symbols: file in wrong format.
Rust set up
rustc version
rust toolchain
How to reproduce it
I cross compile via this command
For this code
Error output
Verbose output of compiling
My cross compiling set up for the target aarch64-linux-gnu-gcc
I develop on fedora 37.
Both approaches yield the same error.
The text was updated successfully, but these errors were encountered: