diff options
Diffstat (limited to 'meta/recipes-support/libffi/libffi')
5 files changed, 120 insertions, 246 deletions
diff --git a/meta/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch b/meta/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch new file mode 100644 index 0000000000..5e529d1ce7 --- /dev/null +++ b/meta/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch @@ -0,0 +1,104 @@ +From 501a6b55853af549fae72723e74271f2a4ec7cf6 Mon Sep 17 00:00:00 2001 +From: Brett Warren <brett.warren@arm.com> +Date: Fri, 27 Nov 2020 15:28:42 +0000 +Subject: [PATCH] arm/sysv: reverted clang VFP mitigation + +Since commit e3d2812ce43940aacae5bab2d0e965278cb1e7ea, +seperate instructions were used when compiling under clang, +as clang didn't allow the directives at the time. This mitigation +now causes compilation to fail under clang 10, as described by +https://github.com/libffi/libffi/issues/607. Now that +clang supports the LDC and SDC instructions, this mitigation +has been reverted. + +Upstream-Status: Pending +Signed-off-by: Brett Warren <brett.warren@arm.com> +--- + src/arm/sysv.S | 33 --------------------------------- + 1 file changed, 33 deletions(-) + +diff --git a/src/arm/sysv.S b/src/arm/sysv.S +index fb36213..e4272a1 100644 +--- a/src/arm/sysv.S ++++ b/src/arm/sysv.S +@@ -142,13 +142,8 @@ ARM_FUNC_START(ffi_call_VFP) + + cmp r3, #3 @ load only d0 if possible + ite le +-#ifdef __clang__ +- vldrle d0, [r0] +- vldmgt r0, {d0-d7} +-#else + ldcle p11, cr0, [r0] @ vldrle d0, [r0] + ldcgt p11, cr0, [r0], {16} @ vldmgt r0, {d0-d7} +-#endif + add r0, r0, #64 @ discard the vfp register args + /* FALLTHRU */ + ARM_FUNC_END(ffi_call_VFP) +@@ -193,25 +188,13 @@ ARM_FUNC_START(ffi_call_SYSV) + #endif + 0: + E(ARM_TYPE_VFP_S) +-#ifdef __clang__ +- vstr s0, [r2] +-#else + stc p10, cr0, [r2] @ vstr s0, [r2] +-#endif + pop {fp,pc} + E(ARM_TYPE_VFP_D) +-#ifdef __clang__ +- vstr d0, [r2] +-#else + stc p11, cr0, [r2] @ vstr d0, [r2] +-#endif + pop {fp,pc} + E(ARM_TYPE_VFP_N) +-#ifdef __clang__ +- vstm r2, {d0-d3} +-#else + stc p11, cr0, [r2], {8} @ vstm r2, {d0-d3} +-#endif + pop {fp,pc} + E(ARM_TYPE_INT64) + str r1, [r2, #4] +@@ -320,11 +303,7 @@ ARM_FUNC_START(ffi_closure_VFP) + add ip, sp, #16 + sub sp, sp, #64+32 @ allocate frame + cfi_adjust_cfa_offset(64+32) +-#ifdef __clang__ +- vstm sp, {d0-d7} +-#else + stc p11, cr0, [sp], {16} @ vstm sp, {d0-d7} +-#endif + stmdb sp!, {ip,lr} + + /* See above. */ +@@ -358,25 +337,13 @@ ARM_FUNC_START_LOCAL(ffi_closure_ret) + cfi_rel_offset(lr, 4) + 0: + E(ARM_TYPE_VFP_S) +-#ifdef __clang__ +- vldr s0, [r2] +-#else + ldc p10, cr0, [r2] @ vldr s0, [r2] +-#endif + b call_epilogue + E(ARM_TYPE_VFP_D) +-#ifdef __clang__ +- vldr d0, [r2] +-#else + ldc p11, cr0, [r2] @ vldr d0, [r2] +-#endif + b call_epilogue + E(ARM_TYPE_VFP_N) +-#ifdef __clang__ +- vldm r2, {d0-d3} +-#else + ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} +-#endif + b call_epilogue + E(ARM_TYPE_INT64) + ldr r1, [r2, #4] +-- +2.25.1 + diff --git a/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch b/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch deleted file mode 100644 index 6b167c8421..0000000000 --- a/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 69c3906c85c791716bf650aa36d9361d22acf3fb Mon Sep 17 00:00:00 2001 -From: sweeaun <swee.aun.khor@intel.com> -Date: Thu, 6 Jul 2017 16:32:46 -0700 -Subject: [PATCH] libffi: Support musl x32 build - -Support libffi build with target musl-x32. - -Upstream-Status: Pending - -Signed-off-by: sweeaun <swee.aun.khor@intel.com> ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index a7bf5ee..8ebe99c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -177,7 +177,7 @@ case "$host" in - TARGETDIR=x86 - if test $ac_cv_sizeof_size_t = 4; then - case "$host" in -- *-gnux32) -+ *-gnux32 | *-muslx32) - TARGET=X86_64 - ;; - *) --- -2.7.4 - diff --git a/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch b/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch deleted file mode 100644 index db96e63547..0000000000 --- a/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a5efaa96fd934eb245c234a5275fcf62698ef986 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 2 Apr 2015 21:38:03 -0700 -Subject: [PATCH] mips: Use compiler internal define for linux - -__linux__ is defined by compiler when building for -linux platforms, lets use it - - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/mips/ffitarget.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h -index 717d659..6faa358 100644 ---- a/src/mips/ffitarget.h -+++ b/src/mips/ffitarget.h -@@ -32,7 +32,7 @@ - #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." - #endif - --#ifdef linux -+#ifdef __linux__ - # include <asm/sgidefs.h> - #elif defined(__rtems__) - /* --- -2.1.4 - diff --git a/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch b/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch deleted file mode 100644 index 61c9eb31d1..0000000000 --- a/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 655e82c92d5c3875aee04322f1993d6b0774a7bf Mon Sep 17 00:00:00 2001 -From: Yousong Zhou <yszhou4tech@gmail.com> -Date: Mon, 15 Aug 2016 15:00:13 +0800 -Subject: [PATCH] mips: fix MIPS softfloat build issue - -The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi: -fix MIPS softfloat build issue with current binutils" - -Signed-off-by: Felix Fietkau <nbd@openwrt.org> -Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> ---- -Upstream-Status: Backport [https://github.com/libffi/libffi/commit/2ded2a4f494165c93293afc14ab0be1243cf8c49] - src/mips/n32.S | 17 +++++++++++++++++ - src/mips/o32.S | 17 +++++++++++++++++ - 2 files changed, 34 insertions(+) - -diff --git a/src/mips/n32.S b/src/mips/n32.S -index c6985d3..8f25994 100644 ---- a/src/mips/n32.S -+++ b/src/mips/n32.S -@@ -107,6 +107,16 @@ loadregs: - - REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. - -+#ifdef __mips_soft_float -+ REG_L a0, 0*FFI_SIZEOF_ARG(t9) -+ REG_L a1, 1*FFI_SIZEOF_ARG(t9) -+ REG_L a2, 2*FFI_SIZEOF_ARG(t9) -+ REG_L a3, 3*FFI_SIZEOF_ARG(t9) -+ REG_L a4, 4*FFI_SIZEOF_ARG(t9) -+ REG_L a5, 5*FFI_SIZEOF_ARG(t9) -+ REG_L a6, 6*FFI_SIZEOF_ARG(t9) -+ REG_L a7, 7*FFI_SIZEOF_ARG(t9) -+#else - and t4, t6, ((1<<FFI_FLAG_BITS)-1) - REG_L a0, 0*FFI_SIZEOF_ARG(t9) - beqz t4, arg1_next -@@ -193,6 +203,7 @@ arg7_next: - arg8_doublep: - l.d $f19, 7*FFI_SIZEOF_ARG(t9) - arg8_next: -+#endif - - callit: - # Load the function pointer -@@ -214,6 +225,7 @@ retint: - b epilogue - - retfloat: -+#ifndef __mips_soft_float - bne t6, FFI_TYPE_FLOAT, retdouble - jal t9 - REG_L t4, 4*FFI_SIZEOF_ARG($fp) -@@ -272,6 +284,7 @@ retstruct_f_d: - s.s $f0, 0(t4) - s.d $f2, 8(t4) - b epilogue -+#endif - - retstruct_d_soft: - bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft -@@ -429,6 +442,7 @@ ffi_closure_N32: - REG_S a6, A6_OFF2($sp) - REG_S a7, A7_OFF2($sp) - -+#ifndef __mips_soft_float - # Store all possible float/double registers. - s.d $f12, F12_OFF2($sp) - s.d $f13, F13_OFF2($sp) -@@ -438,6 +452,7 @@ ffi_closure_N32: - s.d $f17, F17_OFF2($sp) - s.d $f18, F18_OFF2($sp) - s.d $f19, F19_OFF2($sp) -+#endif - - # Call ffi_closure_mips_inner_N32 to do the real work. - LA t9, ffi_closure_mips_inner_N32 -@@ -458,6 +473,7 @@ cls_retint: - b cls_epilogue - - cls_retfloat: -+#ifndef __mips_soft_float - bne v0, FFI_TYPE_FLOAT, cls_retdouble - l.s $f0, V0_OFF2($sp) - b cls_epilogue -@@ -500,6 +516,7 @@ cls_retstruct_f_d: - l.s $f0, V0_OFF2($sp) - l.d $f2, V1_OFF2($sp) - b cls_epilogue -+#endif - - cls_retstruct_small2: - REG_L v0, V0_OFF2($sp) -diff --git a/src/mips/o32.S b/src/mips/o32.S -index eb27981..429dd0a 100644 ---- a/src/mips/o32.S -+++ b/src/mips/o32.S -@@ -82,13 +82,16 @@ sixteen: - - ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args - -+#ifndef __mips_soft_float - bnez t0, pass_d # make it quick for int -+#endif - REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the - REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. - REG_L a2, 2*FFI_SIZEOF_ARG($sp) - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -+#ifndef __mips_soft_float - pass_d: - bne t0, FFI_ARGS_D, pass_f - l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args -@@ -130,6 +133,7 @@ pass_f_d: - # bne t0, FFI_ARGS_F_D, call_it - l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float -+#endif - - call_it: - # Load the function pointer -@@ -158,14 +162,23 @@ retfloat: - bne t2, FFI_TYPE_FLOAT, retdouble - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) -+#ifndef __mips_soft_float - s.s $f0, 0(t0) -+#else -+ REG_S v0, 0(t0) -+#endif - b epilogue - - retdouble: - bne t2, FFI_TYPE_DOUBLE, noretval - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) -+#ifndef __mips_soft_float - s.d $f0, 0(t0) -+#else -+ REG_S v1, 4(t0) -+ REG_S v0, 0(t0) -+#endif - b epilogue - - noretval: -@@ -261,9 +274,11 @@ $LCFI7: - li $13, 1 # FFI_O32 - bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT - -+#ifndef __mips_soft_float - # Store all possible float/double registers. - s.d $f12, FA_0_0_OFF2($fp) - s.d $f14, FA_1_0_OFF2($fp) -+#endif - 1: - # Call ffi_closure_mips_inner_O32 to do the work. - la t9, ffi_closure_mips_inner_O32 -@@ -281,6 +296,7 @@ $LCFI7: - li $13, 1 # FFI_O32 - bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT - -+#ifndef __mips_soft_float - li $9, FFI_TYPE_FLOAT - l.s $f0, V0_OFF2($fp) - beq $8, $9, closure_done -@@ -288,6 +304,7 @@ $LCFI7: - li $9, FFI_TYPE_DOUBLE - l.d $f0, V0_OFF2($fp) - beq $8, $9, closure_done -+#endif - 1: - REG_L $3, V1_OFF2($fp) - REG_L $2, V0_OFF2($fp) --- -2.9.3 - diff --git a/meta/recipes-support/libffi/libffi/not-win32.patch b/meta/recipes-support/libffi/libffi/not-win32.patch index 80c40a4742..62daaf4b38 100644 --- a/meta/recipes-support/libffi/libffi/not-win32.patch +++ b/meta/recipes-support/libffi/libffi/not-win32.patch @@ -1,3 +1,8 @@ +From 306719369a0d3608b4ff2737de74ae284788a14b Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Thu, 4 Feb 2016 16:22:50 +0000 +Subject: [PATCH] libffi: ensure sysroot paths are not in libffi.pc + libffi's configure assumes that cross-compiled builds are complicated and introduces convoluted path manipulation involving gcc search paths to the install paths, resulting in paths like -L/usr/lib/../lib/ appearing in @@ -11,16 +16,20 @@ As this block is generally pointless, disable it. Upstream-Status: Inappropriate Signed-off-by: Ross Burton <ross.burton@intel.com> -Index: libffi-3.2.1/configure.ac -=================================================================== ---- libffi-3.2.1.orig/configure.ac -+++ libffi-3.2.1/configure.ac -@@ -592,7 +592,7 @@ AC_ARG_ENABLE(purify-safety, - +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b764368..d51ce91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -354,7 +354,7 @@ AC_ARG_ENABLE(multi-os-directory, + # These variables are only ever used when we cross-build to X86_WIN32. # And we only support this with GCC, so... -if test "x$GCC" = "xyes"; then +if false; then if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then - toolexecdir="${exec_prefix}"/'$(target_alias)' + toolexecdir='${exec_prefix}'/'$(target_alias)' |