Update: New port: rcc700 for esp32 RISC-V variants (tested on esp32-p4)
./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 they are, as on esp32 ticks are millisecond, and on POSIX microsecond, but there is no adjustment here.
https://github.com/user-attachments/assets/2bbd4fd5-04f7-4890-abf0-5e7454345148
.
Several options:
A. Compile with gcc xcc700.c and run it on your computer as a cross-compiler. It is fairly portable, tested on Mac x86_64 and arm64.
B. Compile for esp32 using xtensa-gcc or xcc700 from the option A (yes it can compile and cross-compile itself). Or grab the gcc-compiled version here: xcc700.elf (16kB). Run with ESP-IDF elf_loader.
C. If you use my BreezyBox shell component, like in this demo project, this will download and install it into your bin folder:
eget valdanylchuk/xcc700
D. Adapt the source code and call it as a function in your firmware.
This is free software under MIT License, see LICENSE.
While I do not believe the world needs another C99 implementation, and do not intend to add features here, I am dead curious to see where the other creative minds can take a tiny self-hosting compiler on esp32.
If you organize hackathons, or assign coursework, or write tutorials, please consider xcc700 as a base to fork and extend! It can run on the available PCs, or on a $5 MCU if you want real cool hardware for the final test. Or you can port it to other systems, and use ld to link those ELF files.
I was making an esp32 "cyberdeck", and thought it cool to build some binaries directly on it. Esp32 is underrated in userland. It can do everything a 90s PC could do and more.
You can also take this as an artistic statement, and ask yourself:
Have fun!
669 followers · starred Apr 2026
411 followers · starred Jul 2026
1,201 followers · starred Dec 2025
740 followers · starred Feb 2026
Update: New port: rcc700 for esp32 RISC-V variants (tested on esp32-p4)
./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 they are, as on esp32 ticks are millisecond, and on POSIX microsecond, but there is no adjustment here.
https://github.com/user-attachments/assets/2bbd4fd5-04f7-4890-abf0-5e7454345148
.
Several options:
A. Compile with gcc xcc700.c and run it on your computer as a cross-compiler. It is fairly portable, tested on Mac x86_64 and arm64.
B. Compile for esp32 using xtensa-gcc or xcc700 from the option A (yes it can compile and cross-compile itself). Or grab the gcc-compiled version here: xcc700.elf (16kB). Run with ESP-IDF elf_loader.
C. If you use my BreezyBox shell component, like in this demo project, this will download and install it into your bin folder:
eget valdanylchuk/xcc700
D. Adapt the source code and call it as a function in your firmware.
This is free software under MIT License, see LICENSE.
While I do not believe the world needs another C99 implementation, and do not intend to add features here, I am dead curious to see where the other creative minds can take a tiny self-hosting compiler on esp32.
If you organize hackathons, or assign coursework, or write tutorials, please consider xcc700 as a base to fork and extend! It can run on the available PCs, or on a $5 MCU if you want real cool hardware for the final test. Or you can port it to other systems, and use ld to link those ELF files.
I was making an esp32 "cyberdeck", and thought it cool to build some binaries directly on it. Esp32 is underrated in userland. It can do everything a 90s PC could do and more.
You can also take this as an artistic statement, and ask yourself:
Have fun!
669 followers · starred Apr 2026
411 followers · starred Jul 2026
1,201 followers · starred Dec 2025
740 followers · starred Feb 2026