A dedicated method for cross-compiling open source software
I’m new to this type of industry. I just cross-compiled the Linux kernel
. But I have few questions to ask that I must know.
I’m using this command when we’re compiling the Linux kernel because my target platform is ARM
.
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Can I cross-compile any similar open source
software, or does the software support cross-compilation
depend on the software version?
The Linux kernel source code contains arch folders
for independent architectures, but gcc,
gLibc
, binutils
are not, why?
But these can be cross-compiled
. Can anyone tell me why this behavior happened?
Is there any standard way to cross-compile
different types of software as required? If anyone is proficient in this kind of business, please guide me.
Thank you.
Solution
In Linux there is a general way to cross-compile software, if there is configure
Script.
Extract the source code of the package you want to install.
See if there is a configuration script inside.
If so, run
./configure –help
Find the option that compiles the support.
I generally cross-compile using the following command
./configure –host=arm-none-linux-eabi –prefix=/path/to/where/you/want/to/install
Package-based may require additional options.
For example, –with-out= libtiff, etc.
If there are no configuration scripts, adjust to the make file.