【问题标题】:GCC - How to add support to a new architecture?GCC - 如何添加对新架构的支持?
【发布时间】:2017-12-07 20:21:32
【问题描述】:

我正在尝试学习如何将 GCC 移植到新架构。大多数教程说我只需要创建三个名为my_processor.cmy_processor.hmy_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


【解决方案1】:

Krister Walfridsson's blog 详细描述了创建新后端所需的所有步骤。 first in the series 是关于要更改或创建的 8 种文件。还建议遵循 Moxie 后端的逻辑,这可能比 risc-v 更容易开始。

【讨论】:

    猜你喜欢
    • 2018-03-12
    • 1970-01-01
    • 2014-01-02
    • 1970-01-01
    • 1970-01-01
    • 2018-08-28
    • 1970-01-01
    • 1970-01-01
    • 2014-08-25
    相关资源
    最近更新 更多