This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH] Building with -fPIC on ARM uclibc
- From: Anthony Green <green at redhat dot com>
- To: Geoffroy Couprie <geo dot couprie at gmail dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Sun, 30 May 2010 13:55:36 -0400
- Subject: Re: [PATCH] Building with -fPIC on ARM uclibc
- References: <AANLkTilM2ql0FRnohIEPmhF8PU3ea17CeAPuXPLN_w44@mail.gmail.com>
Geoffroy Couprie <geo.couprie@gmail.com> writes:
> Hello,
>
> Recently, I had to build Python and Ctypes for an ARM device with
> uclibc. Loading the ctypes module (and libffi) triggers this error:
> "RARM_PC24: compile shared libraries with -fPIC". The error was caused
> by a symbol used in src/arm/sysv.S
>
> Here is the diff of my fix for this issue:
Hi Geoffroy,
Does this patch breaks the non-PIC build, right?
Could you try making one that works in both cases?
Thanks,
AG
>
> --- a/src/arm/sysv.S 2009-12-29 16:22:26.000000000 +0100
> +++ b/src/arm/sysv.S 2010-04-28 12:31:55.000000000 +0200
> @@ -243,11 +243,11 @@
> stmfd sp!, {ip, lr}
> UNWIND .save {r0, lr}
> add r2, sp, #8
> - .pad #16
> + UNWIND .pad #16
> sub sp, sp, #16
> str sp, [sp, #8]
> add r1, sp, #8
> - bl ffi_closure_SYSV_inner
> + bl ffi_closure_SYSV_inner(PLT)
> cmp r0, #FFI_TYPE_INT
> beq .Lretint
>
> The UNWIND line fixed compilation, and the bl line fixed the relocation problem.
>
> I don't know if this fix is correct for you (I'm not really confident
> in my ARM skills), but it works well!
>
> Best regards,
>
> Geoffroy Couprie