From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86262 invoked by alias); 23 Apr 2015 08:25:25 -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 86230 invoked by uid 89); 23 Apr 2015 08:25:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.4 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-f182.google.com Received: from mail-wi0-f182.google.com (HELO mail-wi0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 23 Apr 2015 08:25:20 +0000 Received: by widdi4 with SMTP id di4so206526194wid.0 for ; Thu, 23 Apr 2015 01:25:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.83.105 with SMTP id p9mr3138878wjy.117.1429777517452; Thu, 23 Apr 2015 01:25:17 -0700 (PDT) Received: by 10.194.29.65 with HTTP; Thu, 23 Apr 2015 01:25:17 -0700 (PDT) In-Reply-To: <553692BE.2070306@redhat.com> References: <553692BE.2070306@redhat.com> Date: Thu, 23 Apr 2015 08:25: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/msg00056.txt.bz2 Hi Richard, Thanks for taking a look at this. On Wed, Apr 22, 2015 at 2:11 AM, Richard Henderson wrote: > > On 04/17/2015 08:29 PM, Russell Keith-Magee wrote: > > I've got 2 questions about the libffi development process. > > > > 1. A recent commit: > > > > https://github.com/atgreen/libffi/commit/a4b785ea > > > > (authored by Richard Henderson) appears to have broken ARMv7 support > > to the point where libffi doesn't build. (Or, at least, it raises a > > syntax error on iOS - but I can't see any reason the same problem > > wouldn't exist for other ARM platforms). > > It certainly does build for armv7l-unknown-linux-gnueabihf. But then, only iOS > defines FFI_EXEC_TRAMPOLINE_TABLE, wherein the trouble lies. > > The development process relies on those having access to proprietary operating > systems fixing the problems that arise on those systems. I don't have access > to iOS. I can certainly appreciate the problem of having access to appropriate hardware for testing, and I'm definitely appreciative of the efforts of those (such as yourself) who are doing work that I don't have the skills to handle myself. If nothing else, the patch that caused this ARMv7 problem also *fixed* a big problem on iOS AARCH64; for that, you definitely have my gratitude. My concern is that it isn't at all clear how the project as a whole is responding to this problem - hence my original question. From the perspective of an outside observer - someone who *uses* libffi, and can definitely report bugs, but isn't in a good position to fix bugs - a patch has been applied to trunk that fails the most basic of acceptance tests. The code doesn't compile on a platform that, according to the documentation, is supported. Prior to the patch in question being applied, the code *did* compile. The problem has been reported in a ticket, but there's no response on the ticket that indicates that this is (or would be considered) a "release blocker" - or even that the existence of the bug has been acknowledged. I'm not asking for the magic code faeries to fix the problem for me (although that would certainly be nice!). I'm asking what, if any, processes are in place to make sure that a known critical bug doesn't get rolled into a stable release; and what, if any, processes are in place to get this bug in front of the eyes of people who *are* in a position to fix it. > That said, the problem appears to be trivial. Please try the following. That solution (or something close to it) was already proposed on ticket #181; while it does solve one compilation problem, it opens a whole lot more errors. Compile log follows: ==== 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:55:19: error: expected identifier in '.macro' directive .macro UNWIND text:vararg ^ ../src/arm/sysv.S:59:6: error: unexpected '.endm' in file, no current macro definition .endm ^ ../src/arm/sysv.S:102:2: error: .arch directive not valid for Mach-O .arch armv5t ^ ../src/arm/sysv.S:114:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_call_VFP;; .endif;; _ffi_call_VFP: ^ ../src/arm/sysv.S:114:43: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_call_VFP;; .endif;; _ffi_call_VFP: ^ ../src/arm/sysv.S:115:2: error: invalid instruction UNWIND .fnstart ^ ../src/arm/sysv.S:119:8: error: invalid operand for instruction ldcle p11, cr0, [r0] @ vldrle d0, [sp] ^ ../src/arm/sysv.S:120:8: error: invalid operand for instruction ldcgt p11, cr0, [r0], {16} @ vldmgt sp, {d0-d7} ^ ../src/arm/sysv.S:125:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_call_SYSV;; .endif;; _ffi_call_SYSV: ^ ../src/arm/sysv.S:125:44: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_call_SYSV;; .endif;; _ffi_call_SYSV: ^ ../src/arm/sysv.S:131:15: error: unexpected token in argument list UNWIND .save {fp,lr} ^ ../src/arm/sysv.S:132:16: error: unexpected token in argument list UNWIND .setfp fp, sp ^ :1:5: error: expected absolute expression .if . - 0b - 8*0 ^ ../src/arm/sysv.S:157:1: note: while in macro instantiation E 0 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:157:1: note: while in macro instantiation E 0 ^ ../src/arm/sysv.S:158:6: error: invalid operand for instruction stc p10, cr0, [r2] @ vstr s0, [r2] ^ :1:5: error: expected absolute expression .if . - 0b - 8*1 ^ ../src/arm/sysv.S:160:1: note: while in macro instantiation E 1 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:160:1: note: while in macro instantiation E 1 ^ ../src/arm/sysv.S:161:6: error: invalid operand for instruction stc p11, cr0, [r2] @ vstr d0, [r2] ^ :1:5: error: expected absolute expression .if . - 0b - 8*2 ^ ../src/arm/sysv.S:163:1: note: while in macro instantiation E 2 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:163:1: note: while in macro instantiation E 2 ^ ../src/arm/sysv.S:164:6: error: invalid operand for instruction stc p11, cr0, [r2], {8} @ vstm r2, {d0-d3} ^ :1:5: error: expected absolute expression .if . - 0b - 8*3 ^ ../src/arm/sysv.S:166:1: note: while in macro instantiation E 3 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:166:1: note: while in macro instantiation E 3 ^ :1:5: error: expected absolute expression .if . - 0b - 8*4 ^ ../src/arm/sysv.S:169:1: note: while in macro instantiation E 4 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:169:1: note: while in macro instantiation E 4 ^ :1:5: error: expected absolute expression .if . - 0b - 8*5 ^ ../src/arm/sysv.S:172:1: note: while in macro instantiation E 5 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:172:1: note: while in macro instantiation E 5 ^ :1:5: error: expected absolute expression .if . - 0b - 8*6 ^ ../src/arm/sysv.S:175:1: note: while in macro instantiation E 6 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:175:1: note: while in macro instantiation E 6 ^ ../src/arm/sysv.S:179:2: error: invalid instruction UNWIND .fnend ^ ../src/arm/sysv.S:187:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_go_closure_SYSV;; .endif;; _ffi_go_closure_SYSV: ^ ../src/arm/sysv.S:187:50: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_go_closure_SYSV;; .endif;; _ffi_go_closure_SYSV: ^ ../src/arm/sysv.S:198:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_closure_SYSV;; .endif;; _ffi_closure_SYSV: ^ ../src/arm/sysv.S:198:47: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_closure_SYSV;; .endif;; _ffi_closure_SYSV: ^ ../src/arm/sysv.S:199:2: error: invalid instruction UNWIND .fnstart ^ ../src/arm/sysv.S:215:15: error: unexpected token in argument list UNWIND .save {sp,lr} ^ ../src/arm/sysv.S:227:2: error: invalid instruction UNWIND .fnend ^ ../src/arm/sysv.S:230:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_go_closure_VFP;; .endif;; _ffi_go_closure_VFP: ^ ../src/arm/sysv.S:230:49: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_go_closure_VFP;; .endif;; _ffi_go_closure_VFP: ^ ../src/arm/sysv.S:241:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_closure_VFP;; .endif;; _ffi_closure_VFP: ^ ../src/arm/sysv.S:241:46: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_closure_VFP;; .endif;; _ffi_closure_VFP: ^ ../src/arm/sysv.S:242:2: error: invalid instruction UNWIND .fnstart ^ ../src/arm/sysv.S:253:6: error: invalid operand for instruction stc p11, cr0, [sp], {16} @ vstm sp, {d0-d7} ^ ../src/arm/sysv.S:257:15: error: unexpected token in argument list UNWIND .save {sp,lr} ^ ../src/arm/sysv.S:269:2: error: invalid instruction UNWIND .fnend ^ ../src/arm/sysv.S:276:11: error: unknown directive .align 3; .ifne 0; .globl _ffi_closure_ret;; .endif;; _ffi_closure_ret: ^ ../src/arm/sysv.S:276:46: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 0; .globl _ffi_closure_ret;; .endif;; _ffi_closure_ret: ^ :1:5: error: expected absolute expression .if . - 0b - 8*0 ^ ../src/arm/sysv.S:281:1: note: while in macro instantiation E 0 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:281:1: note: while in macro instantiation E 0 ^ ../src/arm/sysv.S:282:6: error: invalid operand for instruction ldc p10, cr0, [r2] @ vldr s0, [r2] ^ :1:5: error: expected absolute expression .if . - 0b - 8*1 ^ ../src/arm/sysv.S:284:1: note: while in macro instantiation E 1 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:284:1: note: while in macro instantiation E 1 ^ ../src/arm/sysv.S:285:6: error: invalid operand for instruction ldc p11, cr0, [r2] @ vldr d0, [r2] ^ :1:5: error: expected absolute expression .if . - 0b - 8*2 ^ ../src/arm/sysv.S:287:1: note: while in macro instantiation E 2 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:287:1: note: while in macro instantiation E 2 ^ ../src/arm/sysv.S:288:6: error: invalid operand for instruction ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} ^ :1:5: error: expected absolute expression .if . - 0b - 8*3 ^ ../src/arm/sysv.S:290:1: note: while in macro instantiation E 3 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:290:1: note: while in macro instantiation E 3 ^ :1:5: error: expected absolute expression .if . - 0b - 8*4 ^ ../src/arm/sysv.S:293:1: note: while in macro instantiation E 4 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:293:1: note: while in macro instantiation E 4 ^ :1:5: error: expected absolute expression .if . - 0b - 8*5 ^ ../src/arm/sysv.S:296:1: note: while in macro instantiation E 5 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:296:1: note: while in macro instantiation E 5 ^ :1:5: error: expected absolute expression .if . - 0b - 8*6 ^ ../src/arm/sysv.S:299:1: note: while in macro instantiation E 6 ^ :2:2: error: unknown directive .error "type table out of sync" ^ ../src/arm/sysv.S:299:1: note: while in macro instantiation E 6 ^ ../src/arm/sysv.S:316:11: error: unknown directive .align 3; .ifne 1; .globl _ffi_closure_trampoline_table_page;; .endif;; _ffi_closure_trampoline_table_page: ^ ../src/arm/sysv.S:316:64: error: Encountered a .endif that doesn't follow a .if or .else .align 3; .ifne 1; .globl _ffi_closure_trampoline_table_page;; .endif;; _ffi_closure_trampoline_table_page: ^ make[2]: *** [src/arm/sysv.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 === A lot of these errors look to me like a fundamental difference in the allowed syntax for ARM assembler - .ifne, .arch and .error look like the biggest offenders, and comparing the last version of sysv.S that did compile, that code had none of those directives. However, I haven't touched assembler since pre-university days, so I could be completely wrong. Yours, Russ Magee %-)