Reputation: 545
I need to port a few Intel based Linux applications to the ARM platform. Can anybody tell me what are the best cross compiling tools for this project?
Thanks.
Upvotes: 1
Views: 2562
Reputation: 30492
On the Ubuntu Linux host you may use just a default ARM toolchain:
sudo apt-get install gcc-arm-linux-gnueabi
To build your linux applications you just have to use the same tools, but prefixed with:
arm-linux-gnueabi-
For example, to build a simple helloworld.c:
arm-linux-gnueabi-gcc -o helloworld helloworld.c
You can also set some ARM-related flags to optimize your build or to specify your target platform. Here some examples of important ARM GCC flags, depending on the target ARM CPU:
ARM 11: -mtune=arm1136j-s -mfpu=vfp -mfp=vfp -march=armv6 -mfloat-abi=softfp
Cortex A8: -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8
Cortex A9: -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
Note, that your target ARM CPU may require another options, for example if it doesn't support NEON instructions. GCC compilers from CodeSourcery may also need another options set - just read the docs from CodeSourcery for a particular GCC version.
Upvotes: 4