Re: Dietlibc + tcc
"Markus Wichmann" <[email protected]> Tue, 7 Dec 2010 12:08:04 +0100 (CET)
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
Julius Schmidt schrieb:
> Hello folks,
>
> I don't know if this list and/or this project is still active,
Yes it is. True, there haven't been tar file releases for a while, and
this project ain't exactly bursting with manpower and worktime, but it
ain't dead either.
> but I'll try it nevertheless.
> I've tried to compile dietlibc with tcc and i've stumbled upon several
> problems:
>
I can imagine that... There is some pretty gcc-specific code in there.
You'll have a hard time trying to compile it with anything else.
> 1. Odd options (-isystem) and the like
-isystem causes gcc to add the named directory to the _beginning_ of the
include directory search list, instead of the end. That should cause it to
forget about the standard headers in /usr/include, as they aren't
compatible with dietlibc.
Unless tcc has its own way of doing that, you cannot do much about it.
> 2. This piece of code (__v_printf.c):
>
> union { char*s; } u_str;
> #define s u_str.s
>
Where's the problem? tcc cannot compile it? Error message?
> (The C equivalent of rape)
>
Well, someone will have thought something about this at the time of
writing... I guess. Nonetheless, it is legit C, conforming to the C
grammar as defined by ISO 9899:1999. If tcc cannot compile the above, that
means it's broken.
> 3. alloca is ubiquitiously used, but defined nowhere.
>
Unless prohibited by -fno-builtin or -fno-builtin-alloca, that function is
a gcc builtin. There is no sensible way to write it outside of the
compiler. alloca() allocates memory on the stack. That is, it decreases
the stack pointer. Can't do that in a separate function.
> Just try to compile it, should be easily reproducable.
>
> Since the makefile contains some tcc-specific pieces I hope that these are
> just mistakes and tcc compliance might be restored.
>
> Aiju
>
Well, if you really want that, you could add support for alloca() and
-isystem to tcc. Good luck in that, though.
CU,
Markus
--
Progress (n.): Process through which USENET evolved from smart people in
front of dumb terminals to dumb people in front of smart terminals.