cancel
Showing results for 
Search instead for 
Did you mean: 

CMake does not use proper linux interpreter library

binarybee
Associate III

Hello, I am doing a little bit of cross compiling but I have a problem with the linux interpreter. I am using the openstlinux-weston distro with the ld-linux-armhf.so.3 but the binaries after coming out of my cross compilation are using ld-linux.so.3. I need a little bit of hints here how to make it proper.

here's my cmake toolchain and cmake itself it's just stupid example to compile simple hello world print out. Thank everybody in advance :)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
 
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc)

1 REPLY 1
Erwan SZYMANSKI
ST Employee

Hello @binarybee​,

There is no blocker to use CMake for cross-compilation. Are you sure to have the SDK sourced before trying to execute the make command ?

I am not sure that you have to precise the CMAKE_C_COMPILER. In fact you have almost nothing to do if you well sourced the SDK. CMake will do it for you (in the case of a simple example like you. In more complete and complexe project, you will have to document yourself about CMake usage).

Let's try with a very simple example described at the following link (that is not from me) https://lappweb.in2p3.fr/~paubert/ASTERICS_HPC/2-2-100.html

Source your SDK as follow:

PC$> source <SDK_DIR>/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

Then just follow the steps described in the precedent link. You will see that the Makefile generated by CMake is perfectly usable for cross compilation. If you check your binary with file <your_bin> you will see that it has been compiled for ARM:

PC$> file hello_world

> hello_world: ELF 32-bit LSB executable, ARM <.....>

I hope that this information will help you. Come back to me if you still have troubles.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.