This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: please, help me with libffi on iOS porting
Andrew Haley wrote:
>
> On 08/15/2012 03:30 AM, cowwoc wrote:
>>
>> Andrew Haley wrote:
>>>
>>>> to have 4 bytes alignment. So is there a reason the alignment is
>>>> set to 1 byte?
>>>
>>> The doc says:
>>>
>>> `.align EXPRESSION [, EXPRESSION]'
>>> This is the generic .ALIGN directive. For the ARM however if the
>>> first argument is zero (ie no alignment is needed) the assembler
>>> will behave as if the argument had been 2 (ie pad to the next four
>>> byte boundary). This is for compatibility with ARM's own
>>> assembler.
>>>
>>
>> I believe you are wrong on this point.
>
> I'm not: that is what it says.
>
>> GNU Assembler says this:
>> http://sourceware.org/binutils/docs/as/ARM-Directives.html
>>
>> but Apple Assembler does not:
>> https://developer.apple.com/library/mac/#documentation/developertools/Reference/Assembler/040-Assembler_Directives/asm_directives.html
>>
>> hence the generated memory alignment is wrong.
>
> Right, so Apple's assembler is incompatible. The align_expression
> doesn't seem to be optional there, so we could simply change this to
> .align 2".
>
> Andrew.
>
Hi Andrew,
Take a look at https://github.com/jspahrsummers/libffi. It's not my
repository but it contains lots of iOS-specific patches, including the one
for .align 2.
There is even a 4 month old pull request for this specific issue:
https://github.com/atgreen/libffi/pull/19
Gili
--
View this message in context: http://old.nabble.com/please%2C-help-me-with-libffi-on-iOS-porting-tp34250621p34301795.html
Sent from the Sourceware - libffi-discuss mailing list archive at Nabble.com.