OSDN Git Service

cheets-libffi: Fix compilation of 32-bit library on x86/x86_64
authorTomasz Figa <tfiga@google.com>
Wed, 2 Dec 2015 10:58:32 +0000 (19:58 +0900)
committerTomasz Figa <tfiga@google.com>
Wed, 2 Dec 2015 11:03:10 +0000 (20:03 +0900)
32-bit libffi requires different source files than 64-bit ones.
Moreover, regardless of target system, win32.S is always needed. Also
additional define is required to select code path supported by GNU
Assembler version provided by Android x86/x86_64 toolchain.

Change-Id: I0d2e17a8ee08fd28d0f8b7649b9e444932819874

Android.mk

index 09ad513..9665724 100644 (file)
@@ -41,19 +41,28 @@ LOCAL_CFLAGS += -Wno-sign-compare
 
 ifeq ($(ffi_os)-$(ffi_arch),linux-arm)
 LOCAL_SRC_FILES := src/arm/sysv.S src/arm/ffi.c
+valid_arch := true
 endif
 
 ifeq ($(ffi_os)-$(ffi_arch),linux-x86)
-LOCAL_SRC_FILES := src/x86/ffi.c src/x86/sysv.S
-LOCAL_ASFLAGS += -DHAVE_AS_X86_PCREL
+LOCAL_SRC_FILES := src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
+LOCAL_ASFLAGS += \
+       -DHAVE_AS_X86_PCREL \
+       -DHAVE_AS_ASCII_PSEUDO_OP
+valid_arch := true
 endif
 
 ifeq ($(ffi_os)-$(ffi_arch),linux-x86_64)
-LOCAL_SRC_FILES := src/x86/ffi64.c src/x86/unix64.S
-LOCAL_ASFLAGS += -DHAVE_AS_X86_PCREL
+LOCAL_SRC_FILES_64 := src/x86/ffi64.c src/x86/unix64.S
+LOCAL_SRC_FILES_32 := src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
+LOCAL_ASFLAGS += \
+       -DHAVE_AS_X86_PCREL \
+       -DHAVE_AS_ASCII_PSEUDO_OP
+
+valid_arch := true
 endif
 
-ifeq ($(LOCAL_SRC_FILES),)
+ifneq ($(valid_arch),true)
 $(error The os/architecture $(ffi_os)-$(ffi_arch) is not supported by cheets-libffi.)
 endif