gcc -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H
-I. -I. -I../../gcc-3.4.2/gcc -I../../gcc-3.4.2/gcc/. -I../../gcc-
3.4.2/gcc/../include \
-DTARGET_MACHINE=\"m68k-coff\" \
-c ../../gcc-3.4.2/gcc/collect2.c -o collect2.o
In file included from /usr/include/fcntl.h:289:0,
from ../../gcc-3.4.2/gcc/system.h:214,
from ../../gcc-3.4.2/gcc/collect2.c:30:
In function ‘open’,
inlined from ‘collect_execute’ at ../../gcc-3.4.2/gcc/collect2.c:1535:20:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to
‘__open_missing_mode’ declared with attribute error: open with O_CREAT or
O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
^
Makefile:1364: recipe for target 'collect2.o' failed
make[1]: *** [collect2.o] Error 1
make[1]: Leaving directory '/home/gabriel/src/gcc-build/gcc'
Makefile:23339: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
我不指望能够解决这个错误,但是有没有人知道哪些版本的binutils和gcc可以搭配使用?我应该使用特定版本的gcc重新编译gcc吗?
感谢您提供的任何见解!
编辑:
我的linux系统安装了GCC 5.4.0,所以我刚刚下载了5.4.0的源代码,尝试重建m68k交叉编译环境。当我在gcc源码上运行“make”时,出现以下错误:
*** Configuration m68k-unkown-coff not supported
这可能是什么原因?是因为我需要一个旧版本的GCC吗?(我使用的binutils版本肯定支持m68k目标)。我正在使用的教程总是定义“--target=m68k-coff”,那应该改成“--target=m68k-unkown-coff”吗?
编辑2:
所以我尝试编译m68k-elf,但现在出现了这个错误:
checking for m68k-elf-gcc... /home/gabriel/src/gcc-build/./gcc/xgcc -B/home/gabriel/src/gcc-build/./gcc/ -B/opt/m68k/m68k-elf/bin/ -B/opt/m68k/m68k-elf/lib/ -isystem /opt/m68k/m68k-elf/include -isystem /opt/m68k/m68k-elf/sys-include
checking for suffix of object files... configure: error: in `/home/gabriel/src/gcc-build/m68k-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
在构建之前,我运行了download_prerequisites,因此MPC库不应该是问题。有什么办法可以继续吗?我只需要汇编程序,所以我不介意对象文件的格式是什么。谢谢!