【发布时间】:2017-10-09 19:33:23
【问题描述】:
我正在尝试将 binutils 和 GCC 重新编译为 m68k 架构的交叉编译器。我正在遵循这些说明:
http://darkdust.net/writings/megadrive/crosscompiler
但是,该过程在某一方面不断失败。我尝试过使用 binutils 2.16.1 和 gcc 3.4.6、binutils 2.15 和 gcc 3.4.2 以及 binutils 2.15 和 gcc 3.4.6。
在制作和安装 binutils 后,在 gcc 上运行“make”时,最后一次尝试失败。它给出了以下错误:
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 库应该没有问题。知道如何继续前进吗?我只需要汇编程序,所以我不介意目标文件的格式是什么。谢谢!
【问题讨论】:
-
不要尝试用新版本构建旧版本的 GCC。要么进行引导构建,要么获取更新的版本。
-
谢谢,一个问题解决了!您能否检查我的编辑并告诉我您是否知道如何继续?
-
很抱歉打扰您,但我遇到了一个新错误。你能检查我的新编辑吗?非常感谢。
-
@aspirino67 您的目标是哪个硬件?有一个 68000 的 gcc 6.2 端口可用(Amiga,但可能适用于其他机器)。还要检查 vbcc。
标签: c gcc cross-compiling 68000