【发布时间】:2017-12-07 20:21:32
【问题描述】:
我正在尝试学习如何将 GCC 移植到新架构。大多数教程说我只需要创建三个名为my_processor.cmy_processor.h和my_processor.md的文件;但是,当运行 ./configure --target=my_processor 机器时无法识别。
按照How to write your own code generator backend for 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
问题似乎是由于gcc/config.gcc 中的错误配置,可能是因为我在错误的位置添加了我的架构(有多个案例 ${target},所以不确定选择哪个)或者因为我遗漏了一些东西.
我找到的唯一信息出现在https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gccint/Back-End.html,但还不够完整。
那么,我该如何避免这个错误呢?
【问题讨论】:
-
是的,您需要编辑更多的配置文件。您可以检查最近添加的后端的时间,以查看他们编辑了哪些文件。
-
gcc.gnu.org/ml/gcc-cvs/2017-02 参见 r245224 ... r245231 了解 RISCV 端口的介绍。
标签: gcc cross-compiling porting