tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] va_* broken on x86-64: any volonteer?


From: shinichiro hamaji
Subject: Re: [Tinycc-devel] va_* broken on x86-64: any volonteer?
Date: Fri, 10 Jan 2014 01:37:32 +0900

On Fri, Jan 10, 2014 at 1:13 AM, Michael Matz <address@hidden> wrote:
Hi,

[bah, resent again because of suse.de not being the subscribed address
here :-/ ]

On Thu, 9 Jan 2014, Thomas Preud'homme wrote:

> Oh I see. I compiled with --with-libgcc and gcc doesn't provide __va_*
> like libtcc1 does. So I guess either libgcc should not be proposed for
> x86-64 systems or libtcc1 should always be linked in as well as to fill
> in the blank.

Yeah.  tcc meanwhile also emits references to other symbols that aren't in
libgcc.  E.g. __floatundixf.

> Or maybe now that arm can uses libtcc1 this option could be just
> removed. If there is some value in keeping it, it could also be nice
> that tcc can work directly with libgcc (and thus have va_* macros
> builtin, see stdarg.h from gcc and gcc's source code).

You can't without providing the implementation currently residing in
libtcc directly as inline variant in the code generator (as libgcc doesn't
contain any implementation of that stuff).  As the x86_64 variant of
stdargs is a bit convoluted (as in, more that three/four instructions)
that doesn't seem like the best solution.  So, ...

Yeah, I have looked at how GCC handles stdarg for x86-64, but I chose the current way because I didn't want to make TCC unnecessary bigger. Hard-coding va_* would be appropriate for GCC, but might be inappropriate for TinyCC :)

BTW, I have just noticed http://repo.or.cz/w/tinycc.git/commitdiff/55ea6d3fc175b0e01e2e946ca9b319c1fbe8aa67?hp=3f1d9000071eeebe315795079c3adbe4022d6d19 . I knew my first implementation did not follow the x86-64 ABI but I was too lazy to implement it correctly. It should have been working for basic types and printf was OK, and everything should have been working if you build everything with TCC, so I stopped fixing this. A big kudos to James!


> Dear users, does any of you see value in the --with-libgcc switch of
> configure?

... if the possibility of using libgcc should be retained, then yes,
libtcc needs to be linked in additionally.  Which seems to make sense as
that lib indeed is supposed to provide the runtime parts that the compiler
(here tcc) specifically wants to rely on.


Ciao,
Michael.

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]