GCC移植到新的架构 [英] Porting GCC to new architectures

查看:386
本文介绍了GCC移植到新的架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何去了解GCC移植到一个新的架构?我在下面的结构特别感兴趣:

How do I go about porting gcc to a new architecture? I am specifically interested in the following architectures:


  • ARM(TI OMAPs)

  • TI MSP430

  • 86

但对如何移植到任何体系结构将在一定程度上解决了我的问题的指导。

but guidance on how to port to any architecture would go some way to solving my problem.

推荐答案

学习港海湾合作委员会将是一个显著不平凡的任务。至于什么样的期待一个粗略的指南,你需要知道:

Learning to port gcc is going to be a significantly non-trivial task. As a rough guide of what to expect, you will need to know:


  • 内而外的目标架构。从字面上看,否则你怎么回事怎么会知道到C转换呢?

  • C标准,所以C89,C99等。

  • 编译器是如何工作的。有在这整本书。

为了启动这一进程,您通常会用C到组装翻译起始于您的主机的架构,这样,你可以编译目标架构的东西(但你的主机上)。这样,你会得到的地方,你可以编译一个编译器为您的主机上的目标架构的阶段。在这个阶段,你生产的目标,然后可以自行编译一个编译器,所以你现在有目标的gcc。

In order to start the process, you would typically start with the C-to-assembly translation on your host architecture, such that you could compile something for the target architecture (but on your host). You would then get to the stage where you can compile a compiler for your target architecture on your host. At this stage, you produce a compiler on the target which can then self-compile, so you now have gcc on the target.

一旦这个工作已经完成,其实是移植GCC是简单地从目标主机建立海湾合作委员会的情况。如果这一切你感兴趣的, Linux的从头是一个很好的引导做的一切,你会需要做的(如GCC会,除其他事项外,是prerequisite用于移植的内核)。

Once this work has been done, actually porting gcc is simply a case of building gcc from the host on the target. If that's all you're interested in, Linux from scratch is a very good guide for doing everything you'll need to do (as gcc would, amongst other things, be a prerequisite for porting the kernel).

这篇关于GCC移植到新的架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆