This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: 3.2.1 on Solaris 10/x86
- From: Albert Chin <libffi-discuss at mlists dot thewrittenword dot com>
- To: libffi-discuss at sourceware dot org
- Date: Wed, 1 Aug 2018 19:46:40 -0500
- Subject: Re: 3.2.1 on Solaris 10/x86
- References: <20180801233807.GA29252@thewrittenword.com>
- Reply-to: libffi-discuss at sourceware dot org
On Wed, Aug 01, 2018 at 06:38:07PM -0500, Albert Chin wrote:
> [[ snip snip ]]
> libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -c ../src/x86/win32.S -KPIC -DPIC -o src/x86/.libs/win32.o
> Assembler:
> "../src/x86/win32.S", line 935 : Illegal character: <7e>
> "../src/x86/win32.S", line 935 : Syntax error
> Near line: " movl ((10 + 3) & ~3)(%eax), %esi "
> "../src/x86/win32.S", line 936 : Illegal character: <7e>
> "../src/x86/win32.S", line 936 : Syntax error
> Near line: " movl ((((10 + 3) & ~3) + 4) + 4)(%eax), %edx "
> "../src/x86/win32.S", line 944 : Illegal character: <7e>
> "../src/x86/win32.S", line 944 : Syntax error
> Near line: " call *(((10 + 3) & ~3) + 4)(%eax) "
> "../src/x86/win32.S", line 1079 : Illegal character: <7e>
> "../src/x86/win32.S", line 1079 : Syntax error
> Near line: " movl ((10 + 3) & ~3)(%eax), %eax"
> cc: fbe failed for ../src/x86/win32.S
> gmake[2]: *** [src/x86/win32.lo] Error 1
Based on https://bugs.python.org/issue25413, I am using the attached
patch which causes the build to succeed. We basically avoid win32.S on
Solaris/x86.
--
albert chin (china@thewrittenword.com)
Index: Makefile.am
===================================================================
--- Makefile.am.orig 2014-11-08 12:47:24.000000000 +0000
+++ Makefile.am 2018-08-01 23:54:10.532235224 +0000
@@ -126,7 +126,7 @@
nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
endif
if X86
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
endif
if X86_FREEBSD
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
Index: src/x86/ffi.c
===================================================================
--- src/x86/ffi.c.orig 2014-11-08 12:47:24.000000000 +0000
+++ src/x86/ffi.c 2018-08-01 23:59:43.730599037 +0000
@@ -340,9 +340,11 @@
ffi_call_win64(unsigned int (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned *, void (*fn)(void));
#else
+#ifdef X86_WIN32
extern void
ffi_call_win32(unsigned int (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
+#endif
extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned *, void (*fn)(void));
#endif
@@ -393,11 +395,13 @@
case FFI_SYSV:
case FFI_MS_CDECL:
#endif
+#ifdef X86_WIN32
case FFI_STDCALL:
case FFI_THISCALL:
case FFI_FASTCALL:
case FFI_PASCAL:
case FFI_REGISTER:
+#endif
ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;
@@ -428,10 +432,12 @@
__attribute__ ((regparm(1)));
#endif
#ifndef X86_WIN64
+#ifdef X86_WIN32
void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *);
void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *);
void FFI_HIDDEN ffi_closure_FASTCALL (ffi_closure *);
void FFI_HIDDEN ffi_closure_REGISTER (ffi_closure *);
+#endif
#else
void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
#endif
@@ -741,6 +747,7 @@
&ffi_closure_SYSV,
(void*)codeloc);
}
+#ifdef X86_WIN32
else if (cif->abi == FFI_REGISTER)
{
FFI_INIT_TRAMPOLINE_WIN32 (&closure->tramp[0],
@@ -765,7 +772,6 @@
&ffi_closure_STDCALL,
(void*)codeloc);
}
-#ifdef X86_WIN32
else if (cif->abi == FFI_MS_CDECL)
{
FFI_INIT_TRAMPOLINE (&closure->tramp[0],
@@ -910,11 +916,13 @@
case FFI_MS_CDECL:
#endif
#ifndef X86_WIN64
+#ifdef X86_WIN32
case FFI_STDCALL:
case FFI_THISCALL:
case FFI_FASTCALL:
case FFI_PASCAL:
case FFI_REGISTER:
+#endif
ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;