For faster navigation, this Iframe is preloading the Wikiwand page for LCC (编译器).

LCC (编译器)

LCC
开发者大卫·汉森与克里斯·弗雷泽
首次发布1994年,​30年前​(1994
编程语言C
操作系统跨平台
类型编译器
许可协议LCC授权[1]
网站drh.github.io/lcc/

LCC(意指“本地C编译器”或“小型C编译器”)是一种为ANSI C编程语言而设的小型可重定向编译器英语Retargeting。虽然其原始码以免费方式供个人使用,[2]但据一般定义而言,它并非一款开源自由软件,皆因LCC派生的产品可能为非卖品(即使不是派生自LCC的组件或会供出售)。[1]该编译器由克里斯·弗雷泽(Chris Fraser)及大卫·汉森英语David Hanson (computer scientist)开发。

LCC

LCC旨在易于理解,而其文件亦存档完好(well-documented);其设计于克里斯·弗雷泽及大卫·汉森的著作《A Retargetable C Compiler: Design and Implementation》中有述及。该书包含LCC3.6版本绝大部分的原始码,而该等代码是以noweb英语Noweb写成的一款文学程序(literate program)。截至2011年7月,LCC的最新版本为4.2,但书中大部分内容仍适用于该版本。编译器于该书出版的主要变化点在于代码生成器(code-generator)的接口,该接口另述于一份独立的文件中。[3]

LCC的原始码约有2万行,较不少大型编译器甚短得多。[4]

LCC可为AlphaSPARCMIPSx86等处理器架构生成代码;另亦有一款能生成微软通用中间语言的LCC后端。[5]

包含LCC的项目

Quake 3

id Software推出的id Tech 3引擎依赖于经修改的LCC版本,以将各游戏模块或第三方模块(mods)的原始码编译成基于自身虚拟机字节码[6]这意味着除系统调用和引擎提供的有限文件系统作用域外,这些模块对系统而言并不知情,皆因此举旨在减低可能因恶意模块编者引起的威胁。另一考虑是基于引擎而编写的游戏和模块均可移植而毋须重新编译;只需将虚拟机移植至新平台,以确保模块能够运行。

lcc-win

lcc-win32是一款为Microsoft Windows而设的集成开发环境套装,当中包含一款LCC的分叉。市场上亦同时存在一款名为“lcc-win64”的amd64 对应版本,于2012年4月15日推出。[7]

Pelles C

Pelles C的编译器是LCC的一款重度修改版本,支持C11C17、amd64,并提供内联展开等额外优化技术。[8]

迈斯沃克

在32位Windows机器中,若没有为迈斯沃克MATLAB及相关产品安装其他编译器,则会以LCC作为默认的编译器。[9]

授权

LCC可供个人免费使用,并可重新分发(前提是需于所有分发媒体和产品文档中鸣谢该软件)。LCC授权在多种情况下依赖于示例。LCC不能转售图利,但可包含于其他用以图利的软件当中,鉴于LCC自身是以免费方式分发。用家可透过联络艾迪生韦斯利获取按用户或无限使用的许可,特别是对于C++等语言的编译器而言,C编译器或成为其工作的一大部分。[1]

参见

参考资料

  1. ^ 1.0 1.1 1.2 LCC License. [2011-07-05]. (原始内容存档于2019-04-08) (英语). 
  2. ^ Official Github Repository. [2022-04-01]. (原始内容存档于2022-05-11) (英语). 
  3. ^ Fraser, Christopher W.; Hanson, David R. The lcc 4.x Code-Generation Interface (PDF). Microsoft Research. July 2001 [2011-07-05]. Technical Report MSR-TR-2001-64. (原始内容 (PDF)存档于2008-10-12) (英语). 
  4. ^ Sao-Jie Chen, Guang-Huei Lin, Pao-Ann Hsiung, Yu-Hen Hu. "Hardware software co-design of a multimedia SOC platform". Section 5.6.1: LCC Compiler Infrastructure.
  5. ^ Hanson, David R. Lcc.NET: Targeting the .NET Common Intermediate Language from Standard C (PDF). Microsoft Research. March 2004 [2012-07-22] (美国英语). 
  6. ^ John Carmack's .plan file, 24 July, 1999. (原始内容存档于2008-05-12). 
  7. ^ LCC-Win: A free compiler system for Windows Operating Systems by Jacob Navia. lcc-win32.services.net. [2022-04-01]. (原始内容存档于2021-11-26) (英语). 
  8. ^ smorgasbordet - Pelles C. www.smorgasbordet.com. [2022-04-01]. (原始内容存档于2022-05-06) (英语). 
  9. ^ Build MEX-Files. [2013-11-06]. (原始内容存档于2012-09-14) (英语). 

参考书目

{{bottomLinkPreText}} {{bottomLinkText}}
LCC (编译器)
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?