On Monday 09 October 2006 2:00 pm, Daniel Glöckner wrote: > On Sun, Oct 08, 2006 at 11:49:53PM -0400, Rob Landley wrote: > > Would someone please explain to me why stdarg.h says the va_args macros > > are "only correct for i386", but we have an arm eabi patch pending that > > doesn't touch this file? Which is wrong? > > The both are wrong. > The macros are correct for non-EABI ARM as well. > EABI ARM needs something like: > > #define va_arg(ap,type) ( \ > *(type *)((ap = (va_list)((ap + (((sizeof(type) + 3) & ~3) \ > + (__alignof__(type) > 4) \ > * (__alignof__(type) - 1)) \ > - (va_list)0) \ > & - (1 + (__alignof__(type) > 4) \ > * (__alignof__(type) - 1)))) \ > - ((sizeof(type) + 3) & ~3))) > > This "thing" generates the shortest instruction sequence. > Feel free to reformat it :-)
Is that the only one that needs per-arch tweaking? I need to figure out how to handle config-specific headers. (Is there some "I am currently building for this architecture" #ifdef I can check? And it's too bad unifdef isn't part of the standard build environment, but I can probably do something evil with sed...) Alas, I don't yet have a good enough mental model of the tcc build process to know where to whack it with the big hammers yet... Rob -- Never bet against the cheap plastic solution. _______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
