From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64716 invoked by alias); 25 Apr 2015 11:15:23 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 64702 invoked by uid 89); 25 Apr 2015 11:15:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 25 Apr 2015 11:15:21 +0000 Received: by widdi4 with SMTP id di4so49234541wid.0 for ; Sat, 25 Apr 2015 04:15:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.103.130 with SMTP id fw2mr4626085wib.87.1429960518812; Sat, 25 Apr 2015 04:15:18 -0700 (PDT) Received: by 10.194.29.65 with HTTP; Sat, 25 Apr 2015 04:15:18 -0700 (PDT) In-Reply-To: <553A6F4A.9040409@redhat.com> References: <553692BE.2070306@redhat.com> <55394442.9020701@redhat.com> <553A6F4A.9040409@redhat.com> Date: Sat, 25 Apr 2015 11:15:00 -0000 Message-ID: Subject: Re: Questions about the libffi development process From: Russell Keith-Magee To: Richard Henderson Cc: libffi-discuss@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015/txt/msg00062.txt.bz2 (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 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 %-)