This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PSP support? (MIPS)


On Wed, Mar 04, 2009 at 05:23:47PM -0500, Anthony Green wrote:
> Sylvain Beucler wrote:
>> On Wed, Mar 04, 2009 at 09:33:52PM +0100, Sylvain Beucler wrote:
>>   
>>> Hi,
>>>
>>> I'm attempting to cross-compile GNU FreeDink, which uses libffi5, for
>>> Sony PSP (PlayStation Portable), i.e. a MIPS CPU.
>>>
>>> The GCC toolchain port, called pspdev, describes the architecture as
>>> "mipsallegrexel-psp-elf".
>>>
>>> I tried to force TARGET=MIPS with libffi 3.0.8, but this triggers:
>>>   #if !defined(_MIPS_SIM)
>>>   -- something is very wrong --
>>> in src/mips/ffitarget.h.
>>>
>>> Is there support in libffi for this platform?
>>>
>>>
>>> Similar project dyncall(.org) has PSP binaries, and it mentions in the
>>> source code "32bit MIPS", with "eabi" calling convention.

It appears that dyncall supports for MIPS only includes the PSP
architecture.

According to the documentation http://www.dyncall.org/r0.3/manual.pdf,
the PSP architecture uses a different calling convention dubbed "eabi"
(which has probably nothing to do with arm eabi):

  "Many possible conventions are used by many different environments
  such as 32, O64, N32, 64 and EABI."

The documentation also includes an unofficial documentation of that
convention.  Is it very different than O32/32?


>>> http://code.google.com/p/pspstacklesspython cross-compiles Python
>>> which (normally) uses libffi.  I'll send a mail to the maintainer to
>>> check whether he knows about this.
>>>     
>>
>> The maintainer just answered me that libffi and dependent Python
>> module (ctypes) weren't part of the port.
>>
>> So do you think the platform is supported by libffi?
>>   
>
> MIPS is supported in general, but I guess _MIPS_SIM is not defined in  
> the PSP toolchain,

Indeed.

> so you have a little porting work to do.
> On Linux and for some other targets. _MIPS_SIM defines the MIPS ABI used  
> on the target.

I think I don't have the skills to implement a new calling convention
:/


libffi was previously bundled in the GCC tree.  Do you think the PSP
toolchain, which ported GCC, includes some port of libffi, or is this
the availability of libffi completely unrelated to a GCC port?

-- 
Sylvain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]