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: Questions about the libffi development process


Hi Richard,

Thanks for taking a look at this.

On Wed, Apr 22, 2015 at 2:11 AM, Richard Henderson <rth@redhat.com> 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
               ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*0
    ^
../src/arm/sysv.S:157:1: note: while in macro instantiation
E 0
^
<instantiation>: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]
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*1
    ^
../src/arm/sysv.S:160:1: note: while in macro instantiation
E 1
^
<instantiation>: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]
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*2
    ^
../src/arm/sysv.S:163:1: note: while in macro instantiation
E 2
^
<instantiation>: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}
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*3
    ^
../src/arm/sysv.S:166:1: note: while in macro instantiation
E 3
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:166:1: note: while in macro instantiation
E 3
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*4
    ^
../src/arm/sysv.S:169:1: note: while in macro instantiation
E 4
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:169:1: note: while in macro instantiation
E 4
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*5
    ^
../src/arm/sysv.S:172:1: note: while in macro instantiation
E 5
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:172:1: note: while in macro instantiation
E 5
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*6
    ^
../src/arm/sysv.S:175:1: note: while in macro instantiation
E 6
^
<instantiation>: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:
                                             ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*0
    ^
../src/arm/sysv.S:281:1: note: while in macro instantiation
E 0
^
<instantiation>: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]
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*1
    ^
../src/arm/sysv.S:284:1: note: while in macro instantiation
E 1
^
<instantiation>: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]
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*2
    ^
../src/arm/sysv.S:287:1: note: while in macro instantiation
E 2
^
<instantiation>: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}
     ^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*3
    ^
../src/arm/sysv.S:290:1: note: while in macro instantiation
E 3
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:290:1: note: while in macro instantiation
E 3
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*4
    ^
../src/arm/sysv.S:293:1: note: while in macro instantiation
E 4
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:293:1: note: while in macro instantiation
E 4
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*5
    ^
../src/arm/sysv.S:296:1: note: while in macro instantiation
E 5
^
<instantiation>:2:2: error: unknown directive
 .error "type table out of sync"
 ^
../src/arm/sysv.S:296:1: note: while in macro instantiation
E 5
^
<instantiation>:1:5: error: expected absolute expression
.if . - 0b - 8*6
    ^
../src/arm/sysv.S:299:1: note: while in macro instantiation
E 6
^
<instantiation>: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 %-)


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