Get libffi 3.0.8 building on OS/2. b=522118, r=dwitte
authorWalter Meinl <wuno@lsvw.de>
Tue, 05 Jan 2010 13:39:56 -0800
changeset 36848 e8a2b8c6c912f98aa27667993f207c4f5ec79905
parent 36847 829fbe79d1bfb7e13bc13a5b7900b98c218d4345
child 36849 96a38b690156d20c26e609eb5b05d67602927ef3
push idunknown
push userunknown
push dateunknown
reviewersdwitte
bugs522118
milestone1.9.3a1pre
Get libffi 3.0.8 building on OS/2. b=522118, r=dwitte
js/ctypes/Function.cpp
js/ctypes/Makefile.in
js/ctypes/libffi/configure
js/ctypes/libffi/configure.ac
js/ctypes/libffi/src/x86/win32.S
--- a/js/ctypes/Function.cpp
+++ b/js/ctypes/Function.cpp
@@ -159,17 +159,17 @@ GetABI(JSContext* cx, jsval aCallType, f
 
   // determine the ABI from the subset of those available on the
   // given platform. TYPE_DEFAULT specifies the default
   // C calling convention (cdecl) on each platform.
   switch (abi) {
   case ABI_default_abi:
     aResult = FFI_DEFAULT_ABI;
     return true;
-#if defined(_WIN32) && !defined(_WIN64)
+#if (defined(_WIN32) && !defined(_WIN64)) || defined(_OS2)
   case ABI_stdcall_abi:
     aResult = FFI_STDCALL;
     return true;
 #endif
   default:
     return false;
   }
 }
--- a/js/ctypes/Makefile.in
+++ b/js/ctypes/Makefile.in
@@ -94,16 +94,21 @@ endif
 
 else # _MSVC_VER
 
 # build libffi proper
 LOCAL_INCLUDES = \
     -Ilibffi/include \
     $(NULL)
 
+ifeq ($(OS_ARCH),OS2)
+libffi/.libs/ffi.$(LIB_SUFFIX): libffi/.libs/$(LIB_PREFIX)ffi.a
+	emxomf $<
+endif
+
 SHARED_LIBRARY_LIBS = \
     libffi/.libs/$(LIB_PREFIX)ffi.$(LIB_SUFFIX) \
     $(NULL)
 
 endif # _MSVC_VER
 
 EXTRA_DSO_LDOPTS += \
     $(MOZ_COMPONENT_LIBS) \
--- a/js/ctypes/libffi/configure
+++ b/js/ctypes/libffi/configure
@@ -20984,17 +20984,17 @@ case "$host" in
 	;;
   hppa*-*-hpux*)
 	TARGET=PA_HPUX; TARGETDIR=pa
 	;;
 
   i386-*-freebsd* | i386-*-openbsd*)
 	TARGET=X86_FREEBSD; TARGETDIR=x86
 	;;
-  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
+  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
 	TARGET=X86_WIN32; TARGETDIR=x86
 	;;
   i?86-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86
 	;;
   i?86-*-solaris2.1[0-9]*)
 	TARGET=X86_64; TARGETDIR=x86
 	;;
--- a/js/ctypes/libffi/configure.ac
+++ b/js/ctypes/libffi/configure.ac
@@ -69,17 +69,17 @@ case "$host" in
 	;;
   hppa*-*-hpux*)
 	TARGET=PA_HPUX; TARGETDIR=pa
 	;;
 
   i386-*-freebsd* | i386-*-openbsd*)
 	TARGET=X86_FREEBSD; TARGETDIR=x86
 	;;
-  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
+  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
 	TARGET=X86_WIN32; TARGETDIR=x86
 	;;
   i?86-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86
 	;;
   i?86-*-solaris2.1[[0-9]]*)
 	TARGET=X86_64; TARGETDIR=x86
 	;;
--- a/js/ctypes/libffi/src/x86/win32.S
+++ b/js/ctypes/libffi/src/x86/win32.S
@@ -28,18 +28,16 @@
    ----------------------------------------------------------------------- */
  
 #define LIBFFI_ASM
 #include <fficonfig.h>
 #include <ffi.h>
  
 .text
  
-.globl ffi_prep_args
- 
         # This assumes we are using gas.
         .balign 16
 .globl _ffi_call_SYSV
  
 _ffi_call_SYSV:
         pushl %ebp
         movl  %esp,%ebp