上周左右我一直在尝试编译任何 GCC 4 系列编译器以在 GCC 版本 3.4.5 附带的 MinGW 5.1.6 / MSYS 1.0.11(来自 Sourceforge.org 的自动安装程序)中运行. 最终目标是安装 GCC 4.5,但我无法构建任何 4.xx 编译器。
我已将其范围缩小为导致某些异常行为的构建指令序列。编译器执行:
build/genmodes.exe > tmp-modes.c
/bin/sh ../../gcc-4.2.4/gcc/../move-if-change tmp-modes.c insn-modes.c
echo timestamp > s-modes
gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute
-fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.2.4/gcc -I../../gcc-4.2.4/gcc/.
-I../../gcc-4.2.4/gcc/../include -I./../intl -I../../gcc-4.2.4/gcc/../libcpp/include
-I../../gcc-4.2.4/gcc/../libdecnumber -I../libdecnumber insn-modes.c -o insn-modes.o
cc1.exe: out of memory allocating 2239725803 bytes
make[3]: *** [insn-modes.o] Error 1
make[3]: Leaving directory `/home/root/gcc-4.2.4-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/root/gcc-4.2.4-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/root/gcc-4.2.4-build'
make: *** [all] Error 2
主要问题似乎是对 genmodes.exe 的调用。它构建了一个大小约为 2GB 的 C 文件 (insn-modes.c),据我所知,其中大部分填充了空格(尽管偶尔会出现 C 代码行)。GCC 3.4.5 扼杀了它,这就是构建结束的方式。在我尝试过的所有版本中都表现出类似的行为,除了 4.5,由于其他原因而失败,我希望通过使用编译器的中间版本来解决。
所以,三个问题:
- 有没有其他人经历过这个?
- 是什么原因造成的?
- 什么,如果存在任何解决方法?
我正在尝试在 64 位 Windows 7 机器上执行此操作。
谢谢。
更新:我已将两个可疑文件的压缩副本上传到此位置。 事实证明 min-insn-modes.c 也比它应该的大。这两个文件(总共超过 3GB)压缩到 121KB。