我正在尝试学习如何将GCC移植到新架构.大多数教程说,我只需要创建一个名为三个文件my_processor.c
my_processor.h
和my_processor.md
; 但是当运行./configure --target=my_processor
机器无法识别时.
在如何为gcc编写自己的代码生成器后端中给出答案?,我添加了我的配置config.sub
和./configure
工作.
不幸的是,当我使用时make
,终端返回错误说
checking if mkdir takes one argument... no
*** Configuration my_processor-unknown-none not supported
Makefile:4230: recipe for target 'configure-gcc' failed
make[1]: *** [configure-gcc] Error 1
make[1]: Leaving directory 'objdir'
Makefile:905: recipe for target 'all' failed
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)
问题似乎是由于配置错误gcc/config.gcc
,可能是因为我在错误的地方添加了我的架构(有多个案例$ {target},所以不确定选择哪个)或因为我遗漏了一些东西.
我发现的唯一信息显示在https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gccint/Back-End.html中,但它不够完整.
那么,我该怎么做才能避免这个错误呢?
如何将gcc移植到新架构?我对以下架构特别感兴趣:
但是如何移植到任何架构的指导将在某种程度上解决我的问题.