节点文献

交叉编译系统的研究与实现

Research and Implementation of Cross-compiler System

【作者】 苏斐琦

【导师】 郑扣根;

【作者基本信息】 浙江大学 , 计算机应用技术, 2003, 硕士

【摘要】 伴随着以计算机技术、通讯技术为主的信息技术的飞速发展和互联网的广泛应用,3C(Computer、Communication、Consumer)合一将成为必然趋势。信息家电,手持设备,移动设备等嵌入式产品的迅速发展,使得嵌入式软件开发再度成为一个研究热点。 由于嵌入式设备的性能局限,往往不能通过本机编译得到所需软件的可执行程序。因此,以Linux为主机操作系统,搭配一个交叉编译系统,为嵌入式设备生成可执行程序已成为现在日益流行的编译嵌入式软件的解决方案。而开放源码的编译器GCC,经过多年的发展,已能支持几乎所有知名厂商的处理器,是嵌入式软件开发中理想的交叉编译器。 但现有GCC支持的平台并不能满足层出不穷的嵌入式产品的开发需要,仍有许多平台得不到支持。本论文以交叉编译系统ZLTCG的开发为背景,详细介绍了交叉编译系统GCC的体系结构,对其高度可移植性所依赖的中间表示和机器描述技术进行深入研究,并在此基础上完成了GCC在目标机MIPSX上的移植工作。本文根据新目标机的特点,利用了指令拆分,延时槽调度,窥孔优化等技术,既实现了对新目标机的支持,又吸收了原有系统高度优化和可移植的优点。 论文首先概述了编译系统的发展背景和原理,重点介绍了编译器系统的系统结构、自举与移植。然后介绍了交叉编译系统ZLTCG的开发背景和体系结构。第二章详细分析了编译器GCC,重点说明了GCC的设计思想,系统结构及其中间语言和机器描述文件机制。第三章介绍了交叉编译系统的移植过程,重点解释了移植的思路和方法,移植的准备工作,移植的具体步骤,实现难点及相关的一些技术细节,并给出了移植成功后的测试结果。其中移植的准备工作中详细说明了目标机MIPSX的系统结构和应用二进制接口的定义,而移植的具体步骤中详细阐述了对编译器后端的移植过程。最后是一点总结和展望。

【Abstract】 With the rapid development of information technology including computer technology and communication technology,and with the Internet widely used,the combination of computer,communication and consumer is inevitable. For the rapid development of the embedded,handheld and wireless devices,the embedded software is becoming a hot spot of the information industry.Since the resource limitation of embedded equipements,developers usually can’t compile software on them. It seems to be a popular solution for embedded equipements to compile software on another system,which use Linux as an operating system with a cross-compiler built on. And GCC,one of the open source compiler,which had been developed many years,can support nearly all famous processor and become an appropriate cross-compiler for the development of embedded software.However,GCC can’t support all embedded equipements,there are still many platforms need cross-compilers. With the background of developing a renovated cross-compiler named ZLTCG supporting processor MIPSX,this thesis analyzes the architecture of GCC cross-compiler system,deeply studies the intermediate representation and machine description which the portability of GCC are based on,and realizes porting of GCC cross-compiler system to a target processor MIPSX. This thesis makes use of instruction split,delay-slot scheduling and peephole optimization in porting. The new cross-compiler system,ZLTCG,not only supports the new target but also absorbs the old system’s advantages on code optimization and portability.At First,this thesis describes the developing history and theories of compiler,especially on its architecture,bootstrapping and porting. Then it introduces the developing background and architecture of the cross-compiler system,ZLTCG. In chapter 2,it analyses GCC in details,especially on its designatioin,architecture,intermediate language and machine description files. In chapter 3,it explains the implementation of ZLTCG,describes its ways and means,the preparation and the porting,resolves some difficult problems and explaines some technologies in detail,offers the test result. In the preparation part,it defines the architecture of MIPSX and its application binary interface. In the porting part,it describe the porting of compiler’s backend. Last,it gives some conclusions and foresight.

  • 【网络出版投稿人】 浙江大学
  • 【网络出版年期】2003年 01期
  • 【分类号】TP314
  • 【被引频次】16
  • 【下载频次】673
节点文献中: