For faster navigation, this Iframe is preloading the Wikiwand page for Tiny C Compiler.

Tiny C Compiler

本条目存在以下问题,请协助改善本条目或在讨论页针对议题发表看法。 此条目包含指南或教学内容。请借由移除或重写指南段落来改善条目,或在讨论页提出讨论。 此条目使用外部链接的方式可能不符合维基百科的方针或指引,或致使内文成为链接农场。 (2014年9月27日)请协助清理过度不适当的外部链接,并将有用的链接移到参考文献中。详情请参见条目的讨论页
Tiny C Compiler
开发者Fabrice Bellard
当前版本
  • 0.9.27 (2017年12月13日;稳定版本)[1]
编辑维基数据链接
原始码库 编辑维基数据链接
编程语言C语言汇编语言
操作系统LinuxUnixWindows
类型C语言编译器
许可协议GNU宽通用公共许可证
网站http://bellard.org/tcc/

Tiny C Compiler(缩写为TCC、tCc或TinyCC)是一个用于x86(16/32位)或x86-64(64位)系统的C编译器,开发者为Fabrice Bellard。软件是设计用于低端电脑环境,或是于磁碟容量有限的空间中(1.44磁片或是硬盘)。软件可以适用于WindowsLinuxUnix操作系统,而最新版本为0.9.27(2017年12月17日)。TCC是在GNU宽通用公共许可证(LGPL)协议规范下发布。

TCC符合ANSI C(C89/C90)规范[2]亦符合新版的ISO C99标准规范,与GNU C扩展的内嵌汇编语言(即inline assembler)功能汇编语言

实现状态

特色功能

TCC与其他C语言编译器的不同处在于:

  • 容量小,软件大小约为1MB左右,可存储于1.44MB的磁碟片中使用。
  • 速度快,以TCC开发的程序可执行于x86(16/32位)与 x86-64(64位)环境中,据开发者说,执行比GCC较来得相当快速。[3]程序亦可以包含汇编语言inline assembler)于其中执行与编译。
  • 无限制,其他C语言的动态Library祗要符合ISO C99规范,皆可以给予TCC来使用与编译。
  • 安全性,TCC包含一个可选的存储器边界检查,经过检测的代码可以随意地混合于标准代码内。
  • 其他,TCC为命令行式的使用,目前并无集成性开发环境,但可以配合其他的编辑软件使用(如:UltraEdit ...等)。

用途

著名的 TCC 应用包括:

  • TCCBOOT[4],一个可以在大约 10 秒内从原始码启动 Linux内核啟動程式。该啟動程式可以从硬盘中读取 Linux 原始码,将可执行指令写入内存并执行。
  • TCC 曾被用于演示对软件后门的防御。 [5]
  • TCC 曾被用于编译 GCC,虽然需要不少补丁才能完成这个操作。
  • Cinpy[6],一个允许在Python模块中添加C函数的库。这些 C 函数在运行时使用 TCC 编译,然后通过 ctypes 库在 Python 代码中调用。
  • 被安装在 JSLinux[7] ,一个能在浏览器中运行 Linux 和其它操作系统的虚拟机(也是由 Bellard 开发的)。
  • 被用于编译超微型国际象棋引擎。[8]
  • TCC 曾被内建于 Google Android 系统,于 Android 2.0 版本中。[9]

开发历史

TCC 项目起源于 OTCC (Obfuscated TCC,即代码混淆过的 TCC),这是 Bellard 为赢得 2001 年国际C语言混乱代码大赛(IOCCC)编写的一个程序。其后,Bellard 反混淆并延伸发展了该程序,于是有了 TCC。[10]

在 2012 年 2 月 4 日之前的某个时间, Bellard 在 TCC 的官方网站上宣布他不再参与 TCC 的维护工作。[11]

自从 Bellard 离开 TCC 项目以来,已经有不少组织和个人分发补丁或创建维护分支,为 TCC 提供构建支持以及问题修复。

参考文献

引用

  1. ^ http://repo.or.cz/tinycc.git/commit/d348a9a51d32cece842b7885d27a411436d7887b; 检索日期: 2018年1月19日.
  2. ^ Tiny C Compiler Reference Documentation页面存档备份,存于互联网档案馆) accessed on 2008-08-07]
  3. ^ Tiny C Compiler官方網站上关于编译速度的对比. [2019-03-01]. (原始内容存档于2019-02-19). 
  4. ^ TCCBOOT. [2019-03-01]. (原始内容存档于2011-05-18). 
  5. ^ Wheeler, David A. Countering Trusting Trust through Diverse Double-Compiling页面存档备份,存于互联网档案馆. ACSAC.
  6. ^ Cinpy. [2019-03-01]. (原始内容存档于2008-11-20). 
  7. ^ JavaScript Linux. [2019-03-01]. (原始内容存档于2011-07-09). 
  8. ^ Super Micro-Max Chess Engine. [2019-03-01]. (原始内容存档于2019-03-02). 
  9. ^ libacc : Android 2.0內建的輕量級C Compiler. [2012-05-06]. (原始内容存档于2010-10-23). 
  10. ^ Bellard, Fabrice. Obfuscated Tiny C Compiler页面存档备份,存于互联网档案馆
  11. ^ archive.org 上最古老的 TCC 官方网站快照,宣布 Bellard 停止维护 TCC 项目。. [2012-02-04]. (原始内容存档于2011-04-08). 

来源


外部链接


参见

{{bottomLinkPreText}} {{bottomLinkText}}
Tiny C Compiler
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?