简体   繁体   中英

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. 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.

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? Or am I stuck with the 50+ MB binaries for gcc? If there is no hope of getting it in under 6 MB, what's the smallest I can get?

You may want to take a look at some alternative compilers; gcc isn't known for being small. In particular, you may be interested in TCC , the Tiny C Compiler. :)

Check out Smaller C . It's comparable to TCC, though supports less of the language. We run it on RetroBSD in 96KB of RAM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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