Cross compile

  • View
    369

  • Download
    0

Embed Size (px)

Transcript

  1. 1. v1.2 Crifan Li HTML17zipHTML8HTMLsPDF3HTMLsPDF1029CHM4CHM11TXT5TXT12RTF6RTF13WEBHELP 7WEBHELP 14HTML http://www.crifan.com/files/doc/docbook/cross_compile/release/html/cross_compile.html bug http://www.crifan.com/bbs/categories/cross_compile/ 1.22013-09-03crl1. 2. 3. 4. 1http://www.crifan.com/files/doc/docbook/cross_compile/release/html/cross_compile.html http://www.crifan.com/files/doc/docbook/cross_compile/release/htmls/index.html 3 http://www.crifan.com/files/doc/docbook/cross_compile/release/pdf/cross_compile.pdf 4 http://www.crifan.com/files/doc/docbook/cross_compile/release/chm/cross_compile.chm 5 http://www.crifan.com/files/doc/docbook/cross_compile/release/txt/cross_compile.txt 6 http://www.crifan.com/files/doc/docbook/cross_compile/release/rtf/cross_compile.rtf 7 http://www.crifan.com/files/doc/docbook/cross_compile/release/webhelp/index.html 8 http://www.crifan.com/files/doc/docbook/cross_compile/release/html/cross_compile.html.7z 9 http://www.crifan.com/files/doc/docbook/cross_compile/release/htmls/index.html.7z 10 http://www.crifan.com/files/doc/docbook/cross_compile/release/pdf/cross_compile.pdf.7z 11 http://www.crifan.com/files/doc/docbook/cross_compile/release/chm/cross_compile.chm.7z 12 http://www.crifan.com/files/doc/docbook/cross_compile/release/txt/cross_compile.txt.7z 13 http://www.crifan.com/files/doc/docbook/cross_compile/release/rtf/cross_compile.rtf.7z 14 http://www.crifan.com/files/doc/docbook/cross_compile/release/webhelp/cross_compile.webhelp.7z 2
  2. 2. : Crifan Liv1.2 2013-09-03 2013 Crifan, http://crifan.com 15- 2.5 (CC BY-NC 2.5)15http://www.crifan.com/files/doc/docbook/soft_dev_basic/release/html/soft_dev_basic.html#cc_by_nc
  3. 3. ......................................................................................................................................... v 1. ...................................................................................................................... v 2. .......................................................................................................................... v 1. ........................................................................................................................ 1 1.1. .......................................................................................................... 1 1.2. ...................................................................................................... 1 2. .................................................................................................................... 4 2.1. ............................................................................................................. 4 2.2. ...................................................................................................... 5 3. .................................................................................................................... 6 3.1. ...................................................................................... 6 3.1.1. ........................................................................................ 6 3.1.2. crosstool-ng ........................................................... 7 3.1.2.1. arch ................................................................. 7 3.1.2.1.1. crosstool-ngarch ............................................................ 8 3.1.2.2. vendor ............................................................ 8 3.1.2.2.1. crosstool-ngvendor ........................................................ 9 3.1.2.3. kernel .............................................................. 9 3.1.2.3.1. crosstool-ngkernel ........................................................ 10 3.1.2.4. system .......................................................... 11 3.1.2.4.1. systemgnu ....................................................................... 11 3.1.2.4.1.1. crosstool-ngsystemgnu ............................... 11 3.1.2.4.2. systemeabi ....................................................................... 12 3.1.2.4.2.1. crosstool-ngsystemeabi .............................. 12 3.1.2.4.3. systemuclibc .................................................................... 13 3.1.2.4.3.1. crosstool-ngsystemuclibc ............................ 13 3.2. ................................................................................................. 14 3.2.1. ............................... 14 3.2.2. ..................... 15 3.2.2.1. ........................................................ 15 3.2.2.2. ........................................................ 15 3.3. ....................................................................................... 16 3.3.1. crosstool-NG ............................................................................................... 16 3.3.2. Buildroot ...................................................................................................... 16 3.3.3. crosstool ...................................................................................................... 16 3.3.4. Embedded Linux Development Kit (ELDK) ................................................... 16 3.3.5. OpenEmbeddedBitBake ............................................................................ 17 3.3.6. Crossdev ...................................................................................................... 17 3.3.7. OSELAS.Toolchain() ...................................................................................... 17 3.4. ...................................... 17 3.4.1. ............................................................................. 18 3.4.2. ............................................................................. 19 3.4.3. ...................................................................... 20 3.4.4. ...................................................................... 21 4. ..................................................................................................... 22 4.1. ........................................................................................... 22 ................................................................................................................................ 23iii
  4. 4. 1.1. 3.1. 3.2. 3.3. 3.4. 3.5.x86ARM ................................................................................. 1 arch ........................................................................................... 8 vendor ...................................................................................... 8 kernel ...................................................................................... 10 system .................................................................................... 14 TQ2440 ............................................................ 15iv
  5. 5. 1. 2. v
  6. 6. 1 1Toolchain,cross toolchain,cross compiler21.1. PCx86CPU x86CPU cross 1.1. x86ARM CPUarm x86UbuntuLinuxWin7 x86 armCPU x86ARM cross compilecrosscompile, cross compiling1.2. 1 2http://www.crifan.com/summary_cross_compile_cross_compiler_cross_toolchain/ http://www.crifan.com/summary_about_toolchain_cross_compiler/1
  7. 7. 200MHzARMCPU 32MRAM1GNand Flash Linux LinuxARMCPUARMCPU CPU LinuxBusyBoxmake Busybox BuildrootBusyboxBusyBox UbuntuQEMUarmBusyBox3BusyBox make PCx86 BusyBox BusyBox CPUGHz Linux ARMLinuxARM helloworld x86PCx86CPU ARMCPULinux ARM UbootLinux 3http://www.crifan.com/ubuntu_download_config_cross_compile_busybox_for_qemu_arm/2
  8. 8. 3
  9. 9. 2 1 Toolchain,cross toolchain,cross compiler12.1. tool 1. gcc 2. ld gccld gccldbinutilsld ld asobjcopystripar GNUbinutilsbinary utils binutils 2GNU Binutils 1 2http://www.crifan.com/summary_about_toolchain_cross_compiler/ http://www.gnu.org/software/binutils/4
  10. 10. 3GNU Binutils chain gccbinutils objcopy gccbinutils 2.2. gccld gccldas gcc gcc gccarm-linux-gcc arm-linux-gccarm-linux-ldarm-linux-as 3http://www.crifan.com/files/doc/docbook/binutils_intro/release/html/binutils_intro.html5
  11. 11. 3 13.1. arm-xscale-linux-gnueabi-gcc arm-liunx-gnu-gcc arm-xscale-linux-gnueabiarm-liunx-gnu crosstool-ng Buildroot crosstool-ngcrosstool-ng crosstoolxscaleTuples vendor string(CT_TARGET_VENDOR)23.1.1. crosstool-ng 1.18.0crosstool-ngxscale3ct-ng list-samples CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build $ ct-ng list-samples Status Sample name [G.X] alphaev56-unknown-linux-gnu [G.X] alphaev67-unknown-linux-gnu [G.X] arm-bare_newlib_cortex_m3_nommu-eabi [G.X] arm-cortex_a15-linux-gnueabi 1 2 3http://www.crifan.com/embedded_development_cross_compiler_and_toolchain/ http://www.crifan.com/crosstool_tuple_vendor_string_ct_target_vendor/ http://www.crifan.com/reuse_latest_version_crosstool_ng_to_config_and_compile_for_xscale/6
  12. 12. [G..] arm-cortex_a8-linux-gnueabi [G..] arm-davinci-linux-gnueabi [G..] armeb-unknown-eabi [G.X] armeb-unknown-linux-gnueabi [G.X] armeb-unknown-linux-uclibcgnueabi [G..] arm-unknown-eabi [G..] arm-unknown-linux-gnueabi [G.X] arm-unknown-linux-uclibcgnueabi [G.X] armv6-rpi-linux-gnueabi [G.X] avr32-unknown-none [G..] bfin-unknown-linux-uclibc [G..] i586-geode-linux-uclibc [G.X] i586-mingw32msvc,i686-none-linux-gnu [G.X] i686-nptl-linux-gnu [G.X] i686-unknown-mingw32 [G.X] m68k-unknown-elf [G.X] m68k-unknown-uclinux-uclibc [G.X] mips64el-n32-linux-uclibc [G.X] mips64el-n64-linux-uclibc [G.X] mips-ar2315-linux-gnu [G..] mipsel-sde-elf [G..] mipsel-unknown-linux-gnu [G.X] mips-malta-linux-gnu [G..] mips-unknown-elf [G.X] mips-unknown-linux-uclibc [G..] powerpc-405-linux-gnu [G.X] powerpc64-unknown-linux-gnu [G..] powerpc-860-linux-gnu [G.X] powerpc-e300c3-linux-gnu [G.X] powerpc-e500v2-linux-gnuspe [G..] powerpc-unknown_nofpu-linux-gnu [G..] powerpc-unknown-linux-gnu [G..] powerpc-unknown-linux-uclibc [G.X] s390