2

I successfully cross-compiled a simple hello-world.c program for Raspberry Pi Board on my Ubuntu 12.04 host machine by following the instructions given in this

http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/

The cross compilation command used was arm-linux-gnueabihf-gcc hello-world.c

I executed the a.out thus generated on the Rasperry Pi board and it displays the correct output. Next I did

ldd a.out

enter image description here

Now, I am unable to find the file libcofi_rpi.so on my host Ubuntu 12.04 machine. So I am wondering how did the hello-world program get cross compiled in the first place. If I rename the libc.so* cross compiler arm libraries on the host Ubuntu 12.04 machine, the cross compilation fails. So I know, the cross compiler is definitely looking for these libraries. How then did the cross compilation succeed without the libcofi_rpi.so library on the host Ubuntu 12.04 machine?

2 Answers 2

2

libcofi-rpi.so is a hack to speed up certain memory operations. It's loaded through a linker configuration file rather than being loaded by the binary you are running.

ldd output is a bit confusing in this situation. It doesn't distinguish between libs loaded by the binary and libs loaded through linker configuration.

1

libcofi_rpi.so is a shared lib, and linked at runtime. As long, as you do not execute the program, it is not necessary to have it available, it is enough to have the contained methods and fields defined in an included header, which is surely a part of the crosscompilation suite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.