Re: [dev] Yet another C compiler

From: <>
Date: Mon, 20 May 2019 11:31:17 +0000

On Sun, May 19, 2019 at 08:41:38PM -0700, Michael Forney wrote:
> Hi all,
> I know there are a number of small C compilers out there in various
> states of completion, but recently I've been working on another to add
> to the mix:
> It is a C11 compiler based on QBE. The name is not yet chosen. I hope
> to differentiate it from the others by focusing on compiling lots of
> real world software in various environments.

Great news!

> In particular, most suckless software builds and works with an
> occasional tweak or two (dwm, dmenu, st, sbase, ...). I've also been
> able to build some other toolchain components including binutils and
> gcc-4.7 (which can then be used to bootstrap to gcc-9). It is not yet

Sadly, gcc-4.7 does not have an aarch64 backend and it's a pain to configure
without breaking anything.
Last time I tried to bootstrap, gcc 8 was not compiling with gcc 4.7 on x86_64,
did you test it with gcc 9?
What you say is good news, I may be able to add again a "gnu C" bootstrap to my
custom distro (may burn some sh scripts to kill the GNU autotools in gcc 4.7
then). Thanks to gcc steering commity, gcc is turning into a c++ pile of crap
like llvm (I don't know why the f*ck RMS is letting that happening).

> able to build musl libc due to lack of inline asm, volatile, and long
> double support, but I hope to add those features if QBE gains support
> for them.

You can replace inline asm:
        - machine code from an independant assembler, for big asm chunks.
        - with many extension keywords ("intrinsics"). A good idea is to make
          addition of a keyword with their "machine code conversion" kind of
          pluggable: I know it would have many limitations (llvm is literally
          brain diarhea on this) but it can circumvent many inline asm snippets
          this way. linux would be the primary target for this.
        - to a certain extend, you could patch the target source code if
          its authors are fine with it, (asm->plain and simple C, or
          C11->simpler C).

I really need to check Quentin's QBE again.

What you do is great work, keep going while real life let you.


Received on Mon May 20 2019 - 13:31:17 CEST

This archive was generated by hypermail 2.3.0 : Mon May 20 2019 - 13:36:09 CEST