hak8or
hak8or

Reputation: 528

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?

Upvotes: 0

Views: 1427

Answers (2)

Alexey Frunze
Alexey Frunze

Reputation: 62106

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

Upvotes: 1

user149341
user149341

Reputation:

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

Upvotes: 1

Related Questions