我們自己可以編譯製作一個交叉編譯工具鏈(Cross-compile Toolchain)來用,但為了方便、穩定起見,我們大多數時候會去選擇成熟的第三方工具鏈。
codesourcery的交叉工具鏈是很常見的一種,以ARM為例,我們可以從http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite處下載到最新的版本:
Target OS |
Download |
EABI |
Sourcery G++ Lite 2010.09-51 All versions... |
uClinux |
Sourcery G++ Lite 2010.09-58 All versions... |
GNU/Linux |
Sourcery G++ Lite 2010.09-50 All versions... |
SymbianOS |
Symbian ADT Sourcery G++ Lite 4.4-172 All versions... |
可以看到有4個OS平台版本可供選擇,那麼該選擇哪一個下載呢?
在codesourcery的一個頁面上我們找到了答案:
This table applies to the target system on which your applications will run, not to the host system on which you run Sourcery G++.
Target Platform |
Description |
EABI/ELF |
RTOS systems or bare metal systems where no operating system is present. These configurations should not be used to build Linux kernels or applications. |
uClinux |
Systems running uClinux, i.e. Linux on CPUs without an MMU. Use Sourcery G++ to build both the uClinux kernel and applications. |
GNU/Linux |
Systems running full Linux, i.e., Linux on CPUs with an MMU. Use Sourcery G++ to build both the Linux kernel and applications. |
Microsoft Windows |
Systems running Microsoft Windows 2000, or later. |
也就是說,如果打算用來編譯linux kernel或者基於linux的應用程式,則應該選擇GNU/Linux;EABI/ELF適用於沒有作業系統(或者RTOS)的裸機;uClinux適用於沒有MMU的Linux。
這下明白了?