Merge pull request #106 from joshtriplett/darwin-award

[3.1 blocker] Update OS X build system to include win32.S on 32-bit
This commit is contained in:
Anthony Green
2014-03-25 16:12:35 -04:00
4 changed files with 22 additions and 8 deletions

View File

@@ -138,6 +138,9 @@ nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
endif endif
if X86_DARWIN if X86_DARWIN
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
if X86_DARWIN32
nodist_libffi_la_SOURCES += src/x86/win32.S
endif
endif endif
if SPARC if SPARC
nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S

View File

@@ -300,6 +300,8 @@ AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64) AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN) AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
AM_CONDITIONAL(X86_DARWIN32, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4)
AM_CONDITIONAL(X86_DARWIN64, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA) AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
AM_CONDITIONAL(IA64, test x$TARGET = xIA64) AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
AM_CONDITIONAL(M32R, test x$TARGET = xM32R) AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
@@ -439,11 +441,9 @@ AC_ARG_ENABLE(pax_emutramp,
[Define this if you want to enable pax emulated trampolines]) [Define this if you want to enable pax emulated trampolines])
fi) fi)
if test x$TARGET = xX86_WIN64; then LT_SYS_SYMBOL_USCORE
LT_SYS_SYMBOL_USCORE if test "x$sys_symbol_underscore" = xyes; then
if test "x$sys_symbol_underscore" = xyes; then AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
fi
fi fi
FFI_EXEC_TRAMPOLINE_TABLE=0 FFI_EXEC_TRAMPOLINE_TABLE=0

View File

@@ -19,7 +19,7 @@ class simulator_platform(Platform):
prefix = "#ifdef __i386__\n\n" prefix = "#ifdef __i386__\n\n"
suffix = "\n\n#endif" suffix = "\n\n#endif"
src_dir = 'x86' src_dir = 'x86'
src_files = ['darwin.S', 'ffi.c'] src_files = ['darwin.S', 'win32.S', 'ffi.c']
class simulator64_platform(Platform): class simulator64_platform(Platform):
@@ -68,7 +68,7 @@ class desktop32_platform(Platform):
triple = 'i386-apple-darwin10' triple = 'i386-apple-darwin10'
version_min = '-mmacosx-version-min=10.6' version_min = '-mmacosx-version-min=10.6'
src_dir = 'x86' src_dir = 'x86'
src_files = ['darwin.S', 'ffi.c'] src_files = ['darwin.S', 'win32.S', 'ffi.c']
prefix = "#ifdef __i386__\n\n" prefix = "#ifdef __i386__\n\n"
suffix = "\n\n#endif" suffix = "\n\n#endif"

View File

@@ -473,7 +473,7 @@ END
#else #else
#if defined(X86_WIN32) #if defined(SYMBOL_UNDERSCORE)
#define USCORE_SYMBOL(x) _##x #define USCORE_SYMBOL(x) _##x
#else #else
#define USCORE_SYMBOL(x) x #define USCORE_SYMBOL(x) x
@@ -691,6 +691,8 @@ USCORE_SYMBOL(ffi_closure_SYSV):
movl %edx, (%esp) /* &resp */ movl %edx, (%esp) /* &resp */
#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) #if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
call USCORE_SYMBOL(ffi_closure_SYSV_inner) call USCORE_SYMBOL(ffi_closure_SYSV_inner)
#elif defined(X86_DARWIN)
calll L_ffi_closure_SYSV_inner$stub
#else #else
movl %ebx, 8(%esp) movl %ebx, 8(%esp)
call 1f call 1f
@@ -970,6 +972,8 @@ USCORE_SYMBOL(ffi_closure_STDCALL):
movl %edx, (%esp) /* &resp */ movl %edx, (%esp) /* &resp */
#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) #if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
call USCORE_SYMBOL(ffi_closure_SYSV_inner) call USCORE_SYMBOL(ffi_closure_SYSV_inner)
#elif defined(X86_DARWIN)
calll L_ffi_closure_SYSV_inner$stub
#else #else
movl %ebx, 8(%esp) movl %ebx, 8(%esp)
call 1f call 1f
@@ -1070,6 +1074,13 @@ USCORE_SYMBOL(ffi_closure_STDCALL):
.ffi_closure_STDCALL_end: .ffi_closure_STDCALL_end:
.LFE5: .LFE5:
#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
#endif
#if defined(X86_WIN32) && !defined(__OS2__) #if defined(X86_WIN32) && !defined(__OS2__)
.section .eh_frame,"w" .section .eh_frame,"w"
#endif #endif