va_arglist

Austin, Alex Alex.Austin@spectrumdsi.com
Thu Dec 4 01:37:00 GMT 2008


I'm not aware of __builtin_apply, but the target arch is arm. Not sure whether it's eabi or oabi. Whatever the default of gcc-4.0.1 is.

-----Original Message-----
From: Robert William Fuller [mailto:hydrologiccycle@gmail.com] 
Sent: Tuesday, December 02, 2008 5:27 PM
To: David Daney
Cc: Austin, Alex; Harvey Chapman; gcc-help@gcc.gnu.org
Subject: Re: va_arglist

David Daney wrote:
> Austin, Alex wrote:
>> That's all about unpacking an arglist.
> 
> No, it does both 'packing' and 'unpacking'.
> 
>> I need to pack an arglist. Also, the function in question isn't
>> actually printf, but a custom API, and it doesn't have a vprintf
>> equivalent.
> 
> If your architecture is supported by libffi, and the vargs ABI is the 
> same as the ABI for fixed args, libffi should do exactly what you need.
> 
> David Daney

Whatever you do, don't try to use __builtin_apply.  It's busted on 
x86-64.  This is why the Objective-C runtime is broken out of the box on 
x86-64.  The only reason Objective-C works for the GnuStep project is 
they are using hooks in the runtime to replace calls to __builtin_apply 
with calls to libffi in their runtime.



More information about the Gcc-help mailing list