Error Cross compiling for ARM linux gnueabihf target


#1

Hi,

I am using Nanomsg for IPC APIs in a Rust program. Native compilation works without any errors, whereas when I cross compile for armv7-unknown-linux-gnueabihf triple, I get error as shown in the image saying

linking with arm-linux-gnueabihf-gcc failed
And on the shared library - file format not recognised.

I have the std crates for arm and armv7 targets installed via rustup.

Please let me know how to proceed further

Thank you and regards,
Sanjay Bharadwaj


#2

You need to have cross compiled nanomsg(and its dependencies) in the paths rustc is aware of


#3

Hi,

Yes I do have a SYSROOT which already contains cross compiled Nanomsg and the ENV_PREFIX is already is set to this SYSROOT path.

Thanks


#4

Not entirely sure here but could you see that path in any of the -L suffixes in error log that you posted?


#6

No actually the SYSROOT path is not present anywhere in the error log. How do I check that?


#7

I finally managed to run the application on ARM processor. I had to recompile the whole external library and its dependencies, but this time using ‘arm-linux-gnueabihf-gcc’ compiler by changing the compiler in CMakeLists.txt file.

But I am wondering if there is an option to include the paths for the rustc to search the libraries.

Thank you