public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Russell Keith-Magee <russell@keith-magee.com>
To: Richard Henderson <rth@redhat.com>
Cc: libffi-discuss@sourceware.org
Subject: Re: Questions about the libffi development process
Date: Sat, 25 Apr 2015 11:15:00 -0000	[thread overview]
Message-ID: <CAJxq849N4swpqoVekVBs2_m4Up4qZVm1=H=zP6hYjcpgt05n6w@mail.gmail.com> (raw)
In-Reply-To: <553A6F4A.9040409@redhat.com>

(Apologies to Richard - this is a resend; the first version was
silently rejected by the mailing list because of sourceware.org's
anachronistic, broken policies on HTML mail)

On Sat, Apr 25, 2015 at 12:28 AM, Richard Henderson <rth@redhat.com> wrote:
> On 04/23/2015 03:49 PM, Russell Keith-Magee wrote:
>> None at all? There's no release candidate process? No release testing
>> procedures?
>
> I Anthony will have to answer that.
>
>> libtool: compile:  xcrun -sdk iphoneos clang -arch armv7
>> -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I.
>> -I../include -Iinclude -I../src -miphoneos-version-min=7.0 -MT
>> src/arm/sysv.lo -MD -MP -MF src/arm/.deps/sysv.Tpo -c
>> ../src/arm/sysv.S  -fno-common -DPIC -o src/arm/.libs/sysv.o
>> ../src/arm/sysv.S:111:2: error: .arch directive not valid for Mach-O
>>  .arch armv5t
>
> Any chance you know what is the base architecture for iOS on ARM?

As far as I can make out, they're all ARMv7-A.

The iPhone 5C and 5 both use an Apple A7 Swift [1][2]; The iPhone 4S
and 5th generation iPod Touches use an ARM Cortex-A9 [3][4]; the
iPhone4 is an ARM Cortex-A8 [5]; according to [6].

[1] http://en.wikipedia.org/wiki/IPhone_5C
[2] http://en.wikipedia.org/wiki/IPhone_5
[3] http://en.wikipedia.org/wiki/IPhone_4S
[4] http://en.wikipedia.org/wiki/IPod_Touch_(5th_generation)
[5] http://en.wikipedia.org/wiki/IPhone_4
[6] http://en.wikipedia.org/wiki/List_of_ARM_microarchitectures

>> ../src/arm/sysv.S:128:8: error: invalid operand for instruction
>>  ldcle p11, cr0, [r0] @ vldrle d0, [sp]
>>        ^
>
> Try replacing these with the comment (text after @) and see if it assembles.
>
> The generic "coprocessor load" instructions are used instead of the more
> specific vfp load instructions in order to support armv7hf at run-time while
> not requiring more than arm5t at compile-time.  Something that makes sense for
> ELF, but I guess not for iOS.

With those hints and and some #ifdef __clang__ clauses, I've got the
code compiling. It works for simple function calls (e.g., calls to get
system time), but it fails at runtime with a segfault in
ffi_closure_inner_SYSV when you try to call a function using a
function pointer as an argument (in my test case, a call to the posix
qsort() method to sort a list of integers).

My patch, as it currently stands, is in a branch on Github if anyone
wants to help.

https://github.com/freakboy3742/libffi/tree/t181

Yours,
Russ Magee %-)

      reply	other threads:[~2015-04-25 11:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18  6:29 Russell Keith-Magee
2015-04-21 18:11 ` Richard Henderson
2015-04-23  8:25   ` Russell Keith-Magee
2015-04-23 19:13     ` Richard Henderson
2015-04-24  1:49       ` Russell Keith-Magee
2015-04-24 16:29         ` Richard Henderson
2015-04-25 11:15           ` Russell Keith-Magee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJxq849N4swpqoVekVBs2_m4Up4qZVm1=H=zP6hYjcpgt05n6w@mail.gmail.com' \
    --to=russell@keith-magee.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).