kumquat-buildroot/package/libffi/libffi-arc-02-Rebuild-for-ARC-additions.patch
Alexey Brodkin 34c2afeb75 libffi: back-port support for ARC
Support for ARC CPUs was added in libffi after 3.0.13 vesion was cut and up
until now no new release has been done. So to enale libffi on ARC we need this
set of patches.

These are corrsponding commits in libffi:
 * b082e15091961373c03d10ed0251f619ebb6ed76 - Add ARC support
 * 0f8690a84c874ec09a090c8c6adfb93c594acac6 - Rebuild for ARC additions
 * d918d47809c174d62283306b282749f8db93661f - arc: Fix build error

The first patch was modified a bit (cut changelog part) to accomodate
changes not related to ARC between 3.0.14 and changes in question.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Misca Jonker <mjonker@synopsys.com>

Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-29 22:15:00 +02:00

263 lines
14 KiB
Diff

From 234414f2c9d32e9fd94d15f94871837210dbab04 Mon Sep 17 00:00:00 2001
From: Anthony Green <green@moxielogic.com>
Date: Tue, 2 Jul 2013 15:54:40 -0400
Subject: [PATCH 2/3] Rebuild for ARC additions
---
Makefile.in | 96 +++++++++++++++++++++++++++++++++++++------------------------
configure | 18 ++++++++++++
2 files changed, 76 insertions(+), 38 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 4b6abe5..be425d8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -72,20 +72,21 @@ target_triplet = @target@
@POWERPC_DARWIN_TRUE@am__append_18 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
@POWERPC_FREEBSD_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
@AARCH64_TRUE@am__append_20 = src/aarch64/sysv.S src/aarch64/ffi.c
-@ARM_TRUE@am__append_21 = src/arm/sysv.S src/arm/ffi.c
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_22 = src/arm/trampoline.S
-@AVR32_TRUE@am__append_23 = src/avr32/sysv.S src/avr32/ffi.c
-@LIBFFI_CRIS_TRUE@am__append_24 = src/cris/sysv.S src/cris/ffi.c
-@FRV_TRUE@am__append_25 = src/frv/eabi.S src/frv/ffi.c
-@S390_TRUE@am__append_26 = src/s390/sysv.S src/s390/ffi.c
-@X86_64_TRUE@am__append_27 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-@SH_TRUE@am__append_28 = src/sh/sysv.S src/sh/ffi.c
-@SH64_TRUE@am__append_29 = src/sh64/sysv.S src/sh64/ffi.c
-@PA_LINUX_TRUE@am__append_30 = src/pa/linux.S src/pa/ffi.c
-@PA_HPUX_TRUE@am__append_31 = src/pa/hpux32.S src/pa/ffi.c
-@TILE_TRUE@am__append_32 = src/tile/tile.S src/tile/ffi.c
-@XTENSA_TRUE@am__append_33 = src/xtensa/sysv.S src/xtensa/ffi.c
-@METAG_TRUE@am__append_34 = src/metag/sysv.S src/metag/ffi.c
+@ARC_TRUE@am__append_21 = src/arc/sysv.S src/arc/ffi.c
+@ARM_TRUE@am__append_22 = src/arm/sysv.S src/arm/ffi.c
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_23 = src/arm/trampoline.S
+@AVR32_TRUE@am__append_24 = src/avr32/sysv.S src/avr32/ffi.c
+@LIBFFI_CRIS_TRUE@am__append_25 = src/cris/sysv.S src/cris/ffi.c
+@FRV_TRUE@am__append_26 = src/frv/eabi.S src/frv/ffi.c
+@S390_TRUE@am__append_27 = src/s390/sysv.S src/s390/ffi.c
+@X86_64_TRUE@am__append_28 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+@SH_TRUE@am__append_29 = src/sh/sysv.S src/sh/ffi.c
+@SH64_TRUE@am__append_30 = src/sh64/sysv.S src/sh64/ffi.c
+@PA_LINUX_TRUE@am__append_31 = src/pa/linux.S src/pa/ffi.c
+@PA_HPUX_TRUE@am__append_32 = src/pa/hpux32.S src/pa/ffi.c
+@TILE_TRUE@am__append_33 = src/tile/tile.S src/tile/ffi.c
+@XTENSA_TRUE@am__append_34 = src/xtensa/sysv.S src/xtensa/ffi.c
+@METAG_TRUE@am__append_35 = src/metag/sysv.S src/metag/ffi.c
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \
@@ -183,21 +184,22 @@ am_libffi_la_OBJECTS = src/prep_cif.lo src/types.lo src/raw_api.lo \
@POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \
@POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo
@AARCH64_TRUE@am__objects_20 = src/aarch64/sysv.lo src/aarch64/ffi.lo
-@ARM_TRUE@am__objects_21 = src/arm/sysv.lo src/arm/ffi.lo
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_22 = src/arm/trampoline.lo
-@AVR32_TRUE@am__objects_23 = src/avr32/sysv.lo src/avr32/ffi.lo
-@LIBFFI_CRIS_TRUE@am__objects_24 = src/cris/sysv.lo src/cris/ffi.lo
-@FRV_TRUE@am__objects_25 = src/frv/eabi.lo src/frv/ffi.lo
-@S390_TRUE@am__objects_26 = src/s390/sysv.lo src/s390/ffi.lo
-@X86_64_TRUE@am__objects_27 = src/x86/ffi64.lo src/x86/unix64.lo \
+@ARC_TRUE@am__objects_21 = src/arc/sysv.lo src/arc/ffi.lo
+@ARM_TRUE@am__objects_22 = src/arm/sysv.lo src/arm/ffi.lo
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_23 = src/arm/trampoline.lo
+@AVR32_TRUE@am__objects_24 = src/avr32/sysv.lo src/avr32/ffi.lo
+@LIBFFI_CRIS_TRUE@am__objects_25 = src/cris/sysv.lo src/cris/ffi.lo
+@FRV_TRUE@am__objects_26 = src/frv/eabi.lo src/frv/ffi.lo
+@S390_TRUE@am__objects_27 = src/s390/sysv.lo src/s390/ffi.lo
+@X86_64_TRUE@am__objects_28 = src/x86/ffi64.lo src/x86/unix64.lo \
@X86_64_TRUE@ src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@am__objects_28 = src/sh/sysv.lo src/sh/ffi.lo
-@SH64_TRUE@am__objects_29 = src/sh64/sysv.lo src/sh64/ffi.lo
-@PA_LINUX_TRUE@am__objects_30 = src/pa/linux.lo src/pa/ffi.lo
-@PA_HPUX_TRUE@am__objects_31 = src/pa/hpux32.lo src/pa/ffi.lo
-@TILE_TRUE@am__objects_32 = src/tile/tile.lo src/tile/ffi.lo
-@XTENSA_TRUE@am__objects_33 = src/xtensa/sysv.lo src/xtensa/ffi.lo
-@METAG_TRUE@am__objects_34 = src/metag/sysv.lo src/metag/ffi.lo
+@SH_TRUE@am__objects_29 = src/sh/sysv.lo src/sh/ffi.lo
+@SH64_TRUE@am__objects_30 = src/sh64/sysv.lo src/sh64/ffi.lo
+@PA_LINUX_TRUE@am__objects_31 = src/pa/linux.lo src/pa/ffi.lo
+@PA_HPUX_TRUE@am__objects_32 = src/pa/hpux32.lo src/pa/ffi.lo
+@TILE_TRUE@am__objects_33 = src/tile/tile.lo src/tile/ffi.lo
+@XTENSA_TRUE@am__objects_34 = src/xtensa/sysv.lo src/xtensa/ffi.lo
+@METAG_TRUE@am__objects_35 = src/metag/sysv.lo src/metag/ffi.lo
nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_3) $(am__objects_4) $(am__objects_5) \
$(am__objects_6) $(am__objects_7) $(am__objects_8) \
@@ -209,17 +211,17 @@ nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_24) $(am__objects_25) $(am__objects_26) \
$(am__objects_27) $(am__objects_28) $(am__objects_29) \
$(am__objects_30) $(am__objects_31) $(am__objects_32) \
- $(am__objects_33) $(am__objects_34)
+ $(am__objects_33) $(am__objects_34) $(am__objects_35)
libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
$(nodist_libffi_la_OBJECTS)
libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
libffi_convenience_la_LIBADD =
-am__objects_35 = src/prep_cif.lo src/types.lo src/raw_api.lo \
+am__objects_36 = src/prep_cif.lo src/types.lo src/raw_api.lo \
src/java_raw_api.lo src/closures.lo
-am_libffi_convenience_la_OBJECTS = $(am__objects_35)
-am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+am_libffi_convenience_la_OBJECTS = $(am__objects_36)
+am__objects_37 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_4) $(am__objects_5) $(am__objects_6) \
$(am__objects_7) $(am__objects_8) $(am__objects_9) \
$(am__objects_10) $(am__objects_11) $(am__objects_12) \
@@ -230,8 +232,8 @@ am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_25) $(am__objects_26) $(am__objects_27) \
$(am__objects_28) $(am__objects_29) $(am__objects_30) \
$(am__objects_31) $(am__objects_32) $(am__objects_33) \
- $(am__objects_34)
-nodist_libffi_convenience_la_OBJECTS = $(am__objects_36)
+ $(am__objects_34) $(am__objects_35)
+nodist_libffi_convenience_la_OBJECTS = $(am__objects_37)
libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
$(nodist_libffi_convenience_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
@@ -471,7 +473,8 @@ SUBDIRS = include testsuite man
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \
build-ios.sh src/alpha/ffi.c src/alpha/osf.S \
- src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
+ src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \
+ src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \
src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \
src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \
@@ -571,7 +574,7 @@ nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
$(am__append_24) $(am__append_25) $(am__append_26) \
$(am__append_27) $(am__append_28) $(am__append_29) \
$(am__append_30) $(am__append_31) $(am__append_32) \
- $(am__append_33) $(am__append_34)
+ $(am__append_33) $(am__append_34) $(am__append_35)
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
@@ -843,6 +846,16 @@ src/aarch64/sysv.lo: src/aarch64/$(am__dirstamp) \
src/aarch64/$(DEPDIR)/$(am__dirstamp)
src/aarch64/ffi.lo: src/aarch64/$(am__dirstamp) \
src/aarch64/$(DEPDIR)/$(am__dirstamp)
+src/arc/$(am__dirstamp):
+ @$(MKDIR_P) src/arc
+ @: > src/arc/$(am__dirstamp)
+src/arc/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/arc/$(DEPDIR)
+ @: > src/arc/$(DEPDIR)/$(am__dirstamp)
+src/arc/sysv.lo: src/arc/$(am__dirstamp) \
+ src/arc/$(DEPDIR)/$(am__dirstamp)
+src/arc/ffi.lo: src/arc/$(am__dirstamp) \
+ src/arc/$(DEPDIR)/$(am__dirstamp)
src/arm/$(am__dirstamp):
@$(MKDIR_P) src/arm
@: > src/arm/$(am__dirstamp)
@@ -970,6 +983,8 @@ mostlyclean-compile:
-rm -f src/aarch64/*.lo
-rm -f src/alpha/*.$(OBJEXT)
-rm -f src/alpha/*.lo
+ -rm -f src/arc/*.$(OBJEXT)
+ -rm -f src/arc/*.lo
-rm -f src/arm/*.$(OBJEXT)
-rm -f src/arm/*.lo
-rm -f src/avr32/*.$(OBJEXT)
@@ -1026,6 +1041,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/ffi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/trampoline.Plo@am__quote@
@@ -1144,6 +1161,7 @@ clean-libtool:
-rm -rf src/.libs src/_libs
-rm -rf src/aarch64/.libs src/aarch64/_libs
-rm -rf src/alpha/.libs src/alpha/_libs
+ -rm -rf src/arc/.libs src/arc/_libs
-rm -rf src/arm/.libs src/arm/_libs
-rm -rf src/avr32/.libs src/avr32/_libs
-rm -rf src/bfin/.libs src/bfin/_libs
@@ -1714,6 +1732,8 @@ distclean-generic:
-rm -f src/aarch64/$(am__dirstamp)
-rm -f src/alpha/$(DEPDIR)/$(am__dirstamp)
-rm -f src/alpha/$(am__dirstamp)
+ -rm -f src/arc/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/arc/$(am__dirstamp)
-rm -f src/arm/$(DEPDIR)/$(am__dirstamp)
-rm -f src/arm/$(am__dirstamp)
-rm -f src/avr32/$(DEPDIR)/$(am__dirstamp)
@@ -1768,7 +1788,7 @@ clean-am: clean-aminfo clean-generic clean-libtool \
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+ -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -1907,7 +1927,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+ -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
diff --git a/configure b/configure
index 4b04db7..495389d 100755
--- a/configure
+++ b/configure
@@ -673,6 +673,8 @@ AVR32_FALSE
AVR32_TRUE
ARM_FALSE
ARM_TRUE
+ARC_FALSE
+ARC_TRUE
AARCH64_FALSE
AARCH64_TRUE
POWERPC_FREEBSD_FALSE
@@ -13299,6 +13301,10 @@ case "$host" in
HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
;;
+ arc*-*-*)
+ TARGET=ARC; TARGETDIR=arc
+ ;;
+
arm*-*-*)
TARGET=ARM; TARGETDIR=arm
;;
@@ -13651,6 +13657,14 @@ else
AARCH64_FALSE=
fi
+ if test x$TARGET = xARC; then
+ ARC_TRUE=
+ ARC_FALSE='#'
+else
+ ARC_TRUE='#'
+ ARC_FALSE=
+fi
+
if test x$TARGET = xARM; then
ARM_TRUE=
ARM_FALSE='#'
@@ -15087,6 +15101,10 @@ if test -z "${AARCH64_TRUE}" && test -z "${AARCH64_FALSE}"; then
as_fn_error $? "conditional \"AARCH64\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ARC_TRUE}" && test -z "${ARC_FALSE}"; then
+ as_fn_error $? "conditional \"ARC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then
as_fn_error $? "conditional \"ARM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
--
1.9.0