[Buildroot] [git commit] libffi: fix m68k coldfire compile

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Aug 20 09:45:41 UTC 2016


commit: https://git.buildroot.net/buildroot/commit/?id=548657513d3d935e74aed2cfbc6d56ba0804736d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix suggested upstream:
https://github.com/libffi/libffi/pull/273

Fixes:
  http://autobuild.buildroot.net/results/1014a22cfdd3b18f349dde33f14acca4131dbd5b/

Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 .../0004-m68k-support-ISA-A-Coldfire-CPUs.patch    | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/package/libffi/0004-m68k-support-ISA-A-Coldfire-CPUs.patch b/package/libffi/0004-m68k-support-ISA-A-Coldfire-CPUs.patch
new file mode 100644
index 0000000..9308c89
--- /dev/null
+++ b/package/libffi/0004-m68k-support-ISA-A-Coldfire-CPUs.patch
@@ -0,0 +1,77 @@
+From 733bb188b898385cfb5ad28cc0e3ecaf38237350 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx at openadk.org>
+Date: Sat, 20 Aug 2016 00:52:19 +0200
+Subject: [PATCH] m68k: support ISA-A Coldfire CPUs
+
+Fix compilation for m68k/coldfire CPUs like mcf5208.
+
+Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
+Signed-off-by: Thorsten Glaser <tg at mirbsd.de>
+---
+ src/m68k/sysv.S |   29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/src/m68k/sysv.S b/src/m68k/sysv.S
+index ec2b14f..ea40f11 100644
+--- a/src/m68k/sysv.S
++++ b/src/m68k/sysv.S
+@@ -3,7 +3,7 @@
+    sysv.S - Copyright (c) 2012 Alan Hourihane
+ 	    Copyright (c) 1998, 2012 Andreas Schwab
+ 	    Copyright (c) 2008 Red Hat, Inc.
+-	    Copyright (c) 2012 Thorsten Glaser
++	    Copyright (c) 2012, 2016 Thorsten Glaser
+ 
+    m68k Foreign Function Interface
+ 
+@@ -72,6 +72,15 @@ CALLFUNC(ffi_call_SYSV):
+ 	pea	4(%sp)
+ #if !defined __PIC__
+ 	jsr	CALLFUNC(ffi_prep_args)
++#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
++	move.l  _current_shared_library_a5_offset_(%a5),%a0
++	move.l  CALLFUNC(ffi_prep_args at GOT)(%a0),%a0
++	jsr     (%a0)
++#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
++	move.l  #_GLOBAL_OFFSET_TABLE_ at GOTPC,%a0
++	lea     (-6,%pc,%a0),%a0
++	move.l  CALLFUNC(ffi_prep_args at GOT)(%a0),%a0
++	jsr     (%a0)
+ #else
+ 	bsr.l	CALLFUNC(ffi_prep_args at PLTPC)
+ #endif
+@@ -215,6 +224,15 @@ CALLFUNC(ffi_closure_SYSV):
+ 	move.l	%a0,-(%sp)
+ #if !defined __PIC__
+ 	jsr	CALLFUNC(ffi_closure_SYSV_inner)
++#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
++	move.l  _current_shared_library_a5_offset_(%a5),%a0
++	move.l  CALLFUNC(ffi_closure_SYSV_inner at GOT)(%a0),%a0
++	jsr     (%a0)
++#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
++	move.l  #_GLOBAL_OFFSET_TABLE_ at GOTPC,%a0
++	lea     (-6,%pc,%a0),%a0
++	move.l  CALLFUNC(ffi_closure_SYSV_inner at GOT)(%a0),%a0
++	jsr     (%a0)
+ #else
+ 	bsr.l	CALLFUNC(ffi_closure_SYSV_inner at PLTPC)
+ #endif
+@@ -317,6 +335,15 @@ CALLFUNC(ffi_closure_struct_SYSV):
+ 	move.l	%a0,-(%sp)
+ #if !defined __PIC__
+ 	jsr	CALLFUNC(ffi_closure_SYSV_inner)
++#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
++	move.l  _current_shared_library_a5_offset_(%a5),%a0
++	move.l  CALLFUNC(ffi_closure_SYSV_inner at GOT)(%a0),%a0
++	jsr     (%a0)
++#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
++	move.l  #_GLOBAL_OFFSET_TABLE_ at GOTPC,%a0
++	lea     (-6,%pc,%a0),%a0
++	move.l  CALLFUNC(ffi_closure_SYSV_inner at GOT)(%a0),%a0
++	jsr     (%a0)
+ #else
+ 	bsr.l	CALLFUNC(ffi_closure_SYSV_inner at PLTPC)
+ #endif
+-- 
+1.7.10.4
+


More information about the buildroot mailing list