简体   繁体   English

就嵌入式系统的大小而言,我能得到clang或gcc之类的成熟编译器有多小?

[英]How small can I get full fledged compiler like clang or gcc in terms of size for an embedded system?

I am making an embedded linux system and for the hell of it trying to fit my secondary boot loader (AT91), U-Boot, the linux Kernel, and the rootfs onto an 8 MB data flash chip. 我正在制作一个嵌入式Linux系统,而在它的地狱中,它试图将我的辅助引导加载程序(AT91),U-Boot,Linux内核和rootfs安装到8 MB数据闪存芯片上。 Busybox takes up roughly 2 MB though I can probably get it down to roughly 1 MB, and U-Boot takes roughly 512 KB and that too I bet I can get smaller. Busybox大约占用2 MB,尽管我可能可以将其减小到大约1 MB,而U-Boot大约占用512 KB,我敢打赌,我会变得更小。

Can I decrease the size of these larger compilers by cross compiling on my desktop and take out code like things meant for optimization passes and building code for handling all architectures except armv5te? 我可以通过在桌面上进行交叉编译来减小这些较大的编译器的大小,并取出诸如用于优化过程的代码以及构建用于处理除armv5te以外的所有体系结构的代码的代码吗? Or am I stuck with the 50+ MB binaries for gcc? 还是我坚持使用50+ MB的gcc二进制文件? If there is no hope of getting it in under 6 MB, what's the smallest I can get? 如果没有希望将其容纳在6 MB以下,我能得到的最小容量是多少?

You may want to take a look at some alternative compilers; 您可能想看看一些替代编译器。 gcc isn't known for being small. gcc并不小。 In particular, you may be interested in TCC , the Tiny C Compiler. 特别是,您可能对TCC (Tiny C编译器)感兴趣。 :) :)

Check out Smaller C . 查看较小的C。 It's comparable to TCC, though supports less of the language. 尽管支持的语言较少,但它可与TCC媲美。 We run it on RetroBSD in 96KB of RAM. 我们在RetroBSD的96KB RAM中运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM