mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
look for %s@%d format symbols when resolving native methods on Windows, which obviates the need for -k flag to dlltool
This commit is contained in:
parent
e3a5c7e03f
commit
5c04c19e29
2
makefile
2
makefile
@ -371,7 +371,7 @@ $(executable): \
|
||||
@echo "linking $(@)"
|
||||
ifeq ($(platform),windows)
|
||||
$(dlltool) -z $(@).def $(^)
|
||||
$(dlltool) -k -d $(@).def -e $(@).exp
|
||||
$(dlltool) -d $(@).def -e $(@).exp
|
||||
$(cc) $(@).exp $(^) $(lflags) -o $(@)
|
||||
else
|
||||
$(cc) $(^) $(rdynamic) $(lflags) -o $(@)
|
||||
|
@ -251,7 +251,7 @@ on Mac OS X:
|
||||
|
||||
on Windows:
|
||||
$ dlltool -z hello.def *.o
|
||||
$ dlltool -k -d hello.def -e hello.exp
|
||||
$ dlltool -d hello.def -e hello.exp
|
||||
$ g++ hello.exp *.o -L../../win32/lib -lmingwthrd -lm -lz -lws2_32 \
|
||||
-mwindows -mconsole -o hello
|
||||
$ strip --strip-all hello.exe
|
||||
|
@ -167,8 +167,7 @@ resolveNativeMethod2(Thread* t, object method)
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
// on windows, we also try the _%s@%d variant, since the SWT
|
||||
// libraries use it.
|
||||
// on windows, we also try the _%s@%d and %s@%d variants
|
||||
unsigned footprint = methodParameterFootprint(t, method) + 1;
|
||||
if (methodFlags(t, method) & ACC_STATIC) {
|
||||
++ footprint;
|
||||
@ -186,6 +185,12 @@ resolveNativeMethod2(Thread* t, object method)
|
||||
if (p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
// one more try without the leading underscore
|
||||
p = ::resolveNativeMethod(t, undecorated + 1, decorated + 1);
|
||||
if (p) {
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user