This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Build libgcj, libgcj-tools, and libffi as shared libraries on Windows
- From: "Danny Smith" <dansmister at gmail dot com>
- To: "Aaron W. LaFramboise" <aaronavay62 at aaronwl dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, java-patches at gcc dot gnu dot org
- Date: Sun, 24 Aug 2008 16:23:09 +1200
- Subject: Re: [PATCH] Build libgcj, libgcj-tools, and libffi as shared libraries on Windows
- References: <48B0BD19.8080300@aaronwl.com>
On Sun, Aug 24, 2008 at 1:44 PM, Aaron W. LaFramboise
<aaronavay62@aaronwl.com> wrote:
> This patch builds libgcj, libgcj-tools, and libffi as DLLs on Windows.
>
> Autoimport is used in the final link of some of the tools. This is OK for
> now, but suboptimal in the long run. I'll address this later by adding the
> proper decorations.
>
There is problem in libffi/src/x86/win32.S that may be hidden by auto-import.
Namely, the function labels is the asm src file are not being defined
as functions and so will be treated as data symbols when building a
dll.
This will fix * src/x86/win32.S (_ffi_prep_args): Prefix label with underscore.
(_ffi_call_SYSV) : Define as function.
(_ffi_call_STDCALL) : Likewise.
(_ffi_closure_SYSV): Likewise.
(_ffi_raw_closure_SYSV): Likewise.
Index: win32.S
===================================================================
--- win32.S (revision 139424)
+++ win32.S (working copy)
@@ -32,11 +32,12 @@
.text
-.globl ffi_prep_args
+.globl _ffi_prep_args
# This assumes we are using gas.
.balign 16
.globl _ffi_call_SYSV
+ .def _ffi_call_SYSV; .scl 2; .type 32; .endef
_ffi_call_SYSV:
pushl %ebp
@@ -150,6 +151,7 @@
# This assumes we are using gas.
.balign 16
.globl _ffi_call_STDCALL
+ .def _ffi_call_STDCALL; .scl 2; .type 32; .endef
_ffi_call_STDCALL:
pushl %ebp
@@ -259,6 +261,8 @@
.ffi_call_STDCALL_end:
.globl _ffi_closure_SYSV
+ .def _ffi_closure_SYSV; .scl 2; .type 32; .endef
+
_ffi_closure_SYSV:
pushl %ebp
movl %esp, %ebp
@@ -322,6 +326,7 @@
.balign 16
.globl _ffi_closure_raw_SYSV
+ .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef
_ffi_closure_raw_SYSV:
pushl %ebp
movl %esp, %ebp