[qcc] qcc post from alt at altamiranus.info requires approval

Rob Landley rob at landley.net
Sun Mar 23 20:05:12 PDT 2014


On 03/23/14 03:56, Alt wrote:
>> On Sat, Mar 22, 2014 10:13 PM, Rob Landley <rob at landley.net> wrote:
>> Mailman thingy, there's a separate admin email address you use to
>> subscribe. Or you can subscribe via the list's web page:
>>
>> http://lists.landley.net/listinfo.cgi/qcc-landley.net
>>
>> That said, I'm not actively working on qcc yet. I'd love it if somebody
>> else wanted to do it though...
>>
>> Rob
>
> I'm interested in working on a C99-ish compiler. What does the job entail? :)

Short term, I got permission from Fabrice Bellard to bsd license his
original tcc code. I need to to triage his code for external
contributions I can't relicense (and remove/rewrite them), and triage my
fork for similar external commits.

Then I have a cleanly BSD licensed base to do work on.

In terms of the actual work:

A) Get it building "hello world" and itself again on current linux
distributions. (The libc moved out from under it; different headers,
libraries, and linker scripts. Plus the gcc versions you'd be building
it _with_ changed random stuff, which shouldn't break stuff but tends to
because gcc is horrible.)

2) Get it to build the following packages:

A) Itself. (It used to, probably still does. But confirm this.)
B) musl libc.
C) Busybox and/or toybox. - this requires dead code elimination.
D) The linux kernel. This requires c99 variable arrays and who knows
what else.

One of the first things the linux kernel build does is generate a header
by building a small .o file, calling objdump -d on it, running sed on
the resulting assembly to extract structure offsets, and creating a
header with #defines for those offsets. Tinycc didn't have assembly
output capability, nor did it implement objdump. So... todo item. :)

One of the big thigns I was doing with my fork was refactoring it to
break out the option parsing, the preprocessor, the linker, and so on
into separate *.c files. I then wanted to busyboxify it, so the main()
function would look at argv[0] to see what name it was called under and
then call the appropriate main() function (with its own option parsing)
for ld, cc, cpp, strip, and so on.

I have some notes:

http://landley.net/hg/qcc/file/tip/todo

The repository itself is at:

http://landley.net/hg/qcc

The last version from Fabrice was commit 395:

http://landley.net/hg/qcc/file/395

At that point, 90% of the code was in a single file, "tcc.c". What I did
was print out that file, put it in a three ring binder (it was over a
hundred pages), and read the code during my commute on the bus.

You could then look at what I did to it (the following commits), and my
blog entires described most of the development I did, starting with
October 8, 2006 at http://landley.net/notes-2006.html

I can explain more if you like. :)

Rob



More information about the qcc mailing list