I have some basic knowledge about compiling C but need to get a couple of generic cross-compilation questions answered. In my case, I am trying to cross-compile a program on my Fedora Linux box that is going to be run on an ARM single board computer.
-
My first question is about headers. I have downloaded the arm Linux tools package and it contains headers files such as stdio.h in an include directory. Am I supposed to use this “target” include directory as opposed to my system include directories when I am cross-compiling? Or is it OK to point to my system’s include dirs such as /usr/include? (These header files seem to be different when I diff them.)
-
What happens if a header file does not exist. In my case, I am also planning to utilize the cURL library on the ARM board. Can I simply point to the include directory present in the curl source package that I downloaded without worrying about the target architecture? If yes, does this mean my first question is irrelevant?
-
Let’s say I want to statically link to a library. Does this static library need to be compiled for the target ARM platform before this happens? Or can I use the static libraries installed on my system directly (hoping that the cross compilation process takes care of business)?
-
If I decide to dynamically link to a library, the only requirement would be that the target system has this library compiled for ARM and installed in one of the LD_LIBRARY_PATH directories on the ARM board, am I correct?
Thanks for the help.
fakerootcan be helpful for dirty build systems.