xcc700: Self-hosting mini C compiler for esp32 / Xtensa

Why look into this project?

  • A compiler you can fully grasp and tweak, on a modern platform where small is still cool.
  • Basic features, not too entrenched, easy to morph into your language of choice.
  • Reusable ELF writer, and a basic Xtensa bytecodes emitter.
  • Possibly useful for hotfixes, CI, quick test/debug turnaround on esp32.

Sample output

./xcc700 xcc700.c -o xcc700.elf

[ xcc700 ] BUILD COMPLETED > OK
> IN  : 700 Lines / 7977 Tokens
> SYM : 69 Funcs / 91 Globals
> REL : 152 Literals / 1027 Patches
> MEM : 1041 B .rodata / 17120 B .bss
> OUT : 27735 B .text / 33300 B ELF
[ 40 ms ] >> 17500 Lines/sec <<

Note: that timing is from esp32-s3. Timings on Mac/POSIX will be reported 1000x slower than the…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help