Cross Compiling: Luca - Abeni@unitn - It
Cross Compiling: Luca - Abeni@unitn - It
Luca Abeni
[email protected]
The Kernel
• Memory management
Kernel
Kernel
• Device management Level
• <libname>.a vs <libname>.so
• Cross-Compiling environment
• Circular dependency?
• Building a Cross-Compiler can be tricky...
• Examples: mips-dec-ultrix,
i586-pc-linux-gnu, arm-unknown-elf, ...
• Example: ‘i586-pc-linux-gnulibc1’ vs
‘i586-pc-linux-gnu’
• The kernel (‘linux’) is separated from the OS
• The OS depends on the used system libraries
(‘gnu’ → glibc, ...)
Real-Time Operating Systems and Middleware Real-Time Kernels
Building a gcc Cross-Compiler - Step 1: binutils
• ... But there are scripts doing the dirty work for us!
• crosstool http://kegel.com/crosstool
• Download it from
www.dit.unitn.it/˜abeni/Cross/cross.tgz
cd /tmp
tar xvzf cross.tgz #use the right path instead of cross.tgz
PATH=$PATH:/tmp/Cross/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin
• gcc 4.1.0
• glibc 2.3.2
Real-Time Operating Systems and Middleware Real-Time Kernels
The Crosscompiler
• -L option
qemu-arm -L \
/tmp/Cross/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu \
/tmp/a.out