On Thu, 2026-09-24 at 15:27 +0200, Przemysław Korcik wrote: > Hi everyone, > > I would like to share a project I have been working on: **TCCygwin**, > a port of TinyCC targeting the Cygwin runtime on Windows. > > Project: https://github.com/Muras69/TCCygwin > > The goal was to make TCC compile and run native Cygwin/POSIX programs > directly, rather than merely producing Windows binaries. > > Some results so far: > > * **Fully self-hosting:** the compiler can be bootstrapped through a > 4-stage native bootstrap process using a batch script. > * **Cygwin/POSIX runtime support:** TCC can compile and execute code > using Cygwin headers such as `<unistd.h>`, `<signal.h>`, and > `<pthread.h>`. > * POSIX functionality has been tested with working `fork()`, > anonymous pipes, `wait()`, and `pthread_mutex_timedlock()`. > * The resulting TCC package is approximately **2 MB** unpacked. > * It can generate small working executables, including examples > around **9 KB**, dynamically linked against `cygwin1.dll`. > * The port makes extensive use of the current bleeding-edge `mob` > branch. > > One particularly interesting part of the work was getting TCC to deal > with the Cygwin/Newlib header and library environment correctly while > still retaining TCC's small footprint and self-hosting capability. > > I thought this might be interesting to the TCC developers and > contributors, especially from the perspective of how TCC can be > adapted to a POSIX compatibility environment such as Cygwin. > > Feedback, technical comments, and suggestions would be very welcome. > > Best regards, > Muras
Consider perhaps borrowing code or reusing partly: GNU lightning library on https://www.gnu.org/software/lightning/ asmjit.com is a C++ library to generate directly machine code on AMD64 / ARM etc... of course recent GCC compilers have a libgccjit https://gcc.gnu.org/onlinedocs/jit/ (see https://arxiv.org/abs/1109.0779 ...) https://ageinghacker.net/projects/jitter-ghm-2017/jitter-manual--the-introduction-is-there--2017-08-25.pdf and https://www.gnu.org/software/jitter/ are also relevant. compcert.org is also relevant. ocaml.org might have code interesting to study. (I cannot help you more than that, since I never used successfully any software sold by Microsoft) Regards -- Basile STARYNKEVITCH <[email protected]> 8 rue de la Faïencerie http://starynkevitch.net/Basile/ 92340 Bourg-la-Reine https://github.com/bstarynk France https://github.com/RefPerSys/RefPerSys https://orcid.org/0000-0003-0908-5250
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
