Trying to port libffi to OpenVMS.

John E. Malmberg wb8tyw@qsl.net
Tue Feb 17 13:35:00 GMT 2015


On 2/16/2015 1:42 PM, John E. Malmberg wrote:
> On 2/16/2015 11:13 AM, Richard Henderson wrote:
>> On 02/13/2015 03:48 PM, John E. Malmberg wrote:
>>> On 2/13/2015 8:41 AM, Richard Henderson wrote:
>>>> On 02/13/2015 06:00 AM, John E. Malmberg wrote:
>
>>> In any case, on VMS, the "int lib$callg(void **args, int (*func)())"
>>> hides all that though.
>>
>> I'd be very surprised if this actually passes the testsuite, as you're
>> not giving lib$callg any information about the types of the arguments.
>
>> This is probably one of those things that worked find on VAX, but only
>> works on Alpha and IA-64 for integer arguments, and a limited number of
 >> them at that.

As stated before, that has turned out to be the case.  A more 
experienced Macro-64/VMS programmer on comp.os.vms has confirmed using 
lib$callg on other than VAX is a lost cause.

>> I'm sure you're going to have to write assembly, at least for Alpha.

It is starting to look like the best approach is to find out how to get 
the osf-1/alpha assembler to be conditionally compiled/assembled on VMS 
and the same for HP-UX/itanium as Philippe did.

I got the "master" ffi.c to build against Phillipe's macro code, but 
there still are significant differences between it and master.

The "puts" example worked though.

A test with "atof" did not work.  Unlike the lib$callg() case, once it 
the assembler called the routine, the correct result was in the F0 register.

The old code was expecting a different flag format, so did not translate 
the result back.

Regards,
-John





More information about the Libffi-discuss mailing list