aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-04 15:46:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-05 07:59:04 +0000
commit2a7487da654cb7875244039d65a5d2e5b5abec78 (patch)
tree1742fb91c2ffe3384b2f003528eda9ac09aef7c8
parent63548bbc7db9d089faf9ca4d6d98e88468aef9f6 (diff)
downloadmeta-darwin-contrib-2a7487da654cb7875244039d65a5d2e5b5abec78.tar.gz
meta-darwin-contrib-2a7487da654cb7875244039d65a5d2e5b5abec78.tar.bz2
meta-darwin-contrib-2a7487da654cb7875244039d65a5d2e5b5abec78.zip
libffi: Add fix for darwin build issues
See the patch header for more info. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--recipes-gnome/libffi/libffi/darwinfix.patch49
-rw-r--r--recipes-gnome/libffi/libffi_%.bbappend3
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes-gnome/libffi/libffi/darwinfix.patch b/recipes-gnome/libffi/libffi/darwinfix.patch
new file mode 100644
index 0000000..e504e46
--- /dev/null
+++ b/recipes-gnome/libffi/libffi/darwinfix.patch
@@ -0,0 +1,49 @@
+Hacky workaround for build failures on darwin. The linker is buggy and it
+can't cope with arithmatic at the end of sections, therefore we pad the
+sections with a dummy instruction.
+
+Also, our compiler doesn't support relocs so we need to enter the configure
+section to run those tests and avoid build failures.
+
+RP 2014/8/4
+
+Index: libffi-3.1/src/x86/win32.S
+===================================================================
+--- libffi-3.1.orig/src/x86/win32.S 2014-07-09 16:23:45.361202177 +0000
++++ libffi-3.1/src/x86/win32.S 2014-07-09 16:23:45.565202182 +0000
+@@ -1133,11 +1133,14 @@
+ .ffi_closure_STDCALL_end:
+ .LFE5:
+
++ hlt;
++
+ #if defined(X86_DARWIN)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+ L_ffi_closure_SYSV_inner$stub:
+ .indirect_symbol _ffi_closure_SYSV_inner
+ hlt ; hlt ; hlt ; hlt ; hlt
++.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
+ #endif
+
+ #if defined(X86_WIN32) && !defined(__OS2__)
+@@ -1301,6 +1304,6 @@
+ /* End of DW_CFA_xxx CFI instructions. */
+ .align 4
+ .LEFDE5:
+-
++ hlt
+ #endif /* !_MSC_VER */
+
+Index: libffi-3.1/configure.ac
+===================================================================
+--- libffi-3.1.orig/configure.ac 2014-05-11 13:57:49.000000000 +0000
++++ libffi-3.1/configure.ac 2014-07-09 16:24:53.885204044 +0000
+@@ -393,7 +393,7 @@
+ fi
+ fi
+
+-if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
++if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64 || test x$TARGET = xX86_DARWIN; then
+ AC_CACHE_CHECK([assembler supports pc related relocs],
+ libffi_cv_as_x86_pcrel, [
+ libffi_cv_as_x86_pcrel=no
diff --git a/recipes-gnome/libffi/libffi_%.bbappend b/recipes-gnome/libffi/libffi_%.bbappend
new file mode 100644
index 0000000..9f420ed
--- /dev/null
+++ b/recipes-gnome/libffi/libffi_%.bbappend
@@ -0,0 +1,3 @@
+SRC_URI_append_darwin = " file://darwinfix.patch "
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"