This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix build for newish MSVC


---
 ChangeLog       |    6 ++++++
 src/x86/win32.S |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

Hi!

I tried to build libffi using MSYS/MSVC and ml stumbled with

win32.asm(958) : error A2006: undefined symbol : stub

when it compiled win32.S.  Looking into that, I could fix it
with this patch, but it seems a bit strange that I need it,
given that it fails like this regardless if I use MSVC 2005
or MSVC 2010 (I can't find any ml.exe in my old MSVC 6 (1998)
install, I might have selected to not install it?).  It seems
like this double colon problem should have been detected
earlier...

I would also like a hint on how to do basic tests given that
dejagnu isn't available for MSYS (or is it?).  "make check"
complains with:

WARNING: could not find `runtest'

Cheers,
Peter

diff --git a/ChangeLog b/ChangeLog
index bb5bc16..3f4c5b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-13  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub'
+	label visible outside the PROC, so that ffi_closure_THISCALL
+	can see it.
+
 2012-03-03  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* src/x86/ffi64.c (ffi_call): Cast the return value to unsigned
diff --git a/src/x86/win32.S b/src/x86/win32.S
index e5c93ecf..47629fe 100644
--- a/src/x86/win32.S
+++ b/src/x86/win32.S
@@ -187,7 +187,7 @@ ffi_closure_SYSV PROC NEAR FORCEFRAME
         lea  edx, [ebp - 24]
         mov  [ebp - 12], edx         ;; resp
         lea  edx, [ebp + 8]
-stub:
+stub::
         mov  [esp + 8], edx          ;; args
         lea  edx, [ebp - 12]
         mov  [esp + 4], edx          ;; &resp
-- 
1.7.9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]