我不确定为什么gcc具有如此复杂的构建过程。我基于clang / LLVM的ELLCC( http://ellcc.org )跨工具链项目的构建如下:
I'm not sure why gcc has such a complicated build process. My clang/LLVM based ELLCC (http://ellcc.org) cross tool chain project builds like this:
- 编译编译器(使用gcc或网站上提供的ELLCC编译器的预构建版本。)
- 使用编译器为所有目标构建C ++和C库。
- 为所有目标构建binutils和gdb(对于所有目标:请勿创建目标特定的实用工具, ld,gdb,objdump等都支持此功能)。
- (可选)使用新构建的编译器为所有目标交叉构建。
- Compile the compiler (using either gcc or a pre-built version of the ELLCC compiler available from the web site.).
- Use the compiler to build the C++ and C libraries for all targets.
- Build binutils and gdb for all targets (for all targets: don't make target specific utilitities except for the assemblers. ld, gdb, objdump, etc. all support this)
- (optional) Use your newly built compiler to cross build itself for all the targets.
BTW,ELLCC当前支持适用于Linux和裸机执行环境的ARM,Microblaze,Mips,PowerPC和x86目标。
BTW, ELLCC currently supports ARM, Microblaze, Mips, PowerPC, and x86 targets for Linux and bare metal execution environments.