Error Cross compiling for ARM linux gnueabihf target

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

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

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

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

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

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