https://bugs.winehq.org/show_bug.cgi?id=49033
Bug ID: 49033 Summary: Inno Setup installer: runtime error with external dll - regression in msvcrt Product: Wine Version: 5.7 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: winehq-bugzilla@reichardt.de
Exult's Inno Setup based installer fails with
"Runtime Error (at -1:0): Cannot Import dll:C:\users\crossover\Temp\is-05TAH.tmp\exconfig.dll."
but the dll is at the given path.
I am running macOS 10.15 so I was only able to do limited regression testing. But on a machine with an older macOS I was able to confirm that it used to work with:
Crossover 18.0 (based on Wine 3.14)
But with Crossover 18.1 (also based on Wine 3.14) it stopped working. On the older machine I also installed Wine 4.0.3 (via MacPorts) and it's not working there either.
Gcenx in the forums confirmed that this also does not work with the latest Wine version https://forum.winehq.org/viewtopic.php?f=9&t=33784&p=127447#p127447 (neither native nor builtin).
A search in the forum lead me to https://bugs.winehq.org/show_bug.cgi?id=43940 but the attached msvcrt.dll let's the Exult installer die silently.
The Exult installer is at http://exult.sourceforge.net/snapshots/Exultwin32.exe
The Inno Setup script is at https://github.com/exult/exult/blob/master/win32/exult_installer.iss
The source for exconfig.dll is at https://github.com/exult/exult/blob/master/win32/exconfig.cc
https://bugs.winehq.org/show_bug.cgi?id=49033
Gcenx gcenx83@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gcenx83@gmail.com
--- Comment #1 from Gcenx gcenx83@gmail.com --- Just posting directly to confirm the issue, I tested on wine-devel 5.7 wow64 built from source on macOS Mojave using Xcode11.3.1 with the 10.13SDK
The build was done using the wine-Devel Portfile I maintain https://raw.githubusercontent.com/Gcenx/macports-wine/master/x11/wine-devel/...
https://bugs.winehq.org/show_bug.cgi?id=49033
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com Component|msvcrt |-unknown
--- Comment #2 from Piotr Caban piotr.caban@gmail.com --- The exconfig.dll is a 32-bit dll so it will not work with current Wine on Catalina.
I've done a quick test and the problem is that: - on Mac user32.dll.so is loaded at 0x69c00000 - exconfig.dll base address is 0x69cc0000, because of that the dll needs to be relocated - I don't know how exconfig.dll was created but it fails to relocate both on Windows and in Wine even so the dll have relocation data
The relocation test I have written looks as follows: VirtualAlloc((void*)0x69CC0000, 0x4096, MEM_RESERVE | MEM_COMMIT, PAGE_NOACCESS); LoadLibraryA("exconfig.dll");
I'm not familiar with this part of wine but in order to fix it we will need to make sure that 0x69cc0000-0x69df4000 memory range is not used. Another option of working around it is to recompile exconfig.dll so it contains valid relocation data.
https://bugs.winehq.org/show_bug.cgi?id=49033
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Inno Setup installer: |Inno Setup installer: fails |runtime error with external |to load external dll |dll - regression in msvcrt |
https://bugs.winehq.org/show_bug.cgi?id=49033
--- Comment #3 from Dominik Reichardt winehq-bugzilla@reichardt.de --- Thanks for looking into it. I don't see how and where this relocation would be set. It was created with mingw/msys64.
The files are https://github.com/exult/exult/blob/master/win32/exconfig.cc https://github.com/exult/exult/blob/master/win32/exconfig.h https://github.com/exult/exult/blob/master/win32/exconfig.rc https://github.com/exult/exult/blob/master/win32/exconfig.def
and in the makefile it is compiled with these rules: exconfig_rc.o: win32/exconfig.rc windres --include-dir win32 win32/exconfig.rc exconfig_rc.o
exconfig.dll: win32/exconfig.def $(FILE_OBJS) $(CONF_OBJS) exconfig_rc.o win32/exconfig.o dllwrap --def win32/exconfig.def -o $@ $(FILE_OBJS) $(CONF_OBJS) exconfig_rc.o win32/exconfig.o -static -lstdc++
https://bugs.winehq.org/show_bug.cgi?id=49033
--- Comment #4 from Piotr Caban piotr.caban@gmail.com --- You might find https://sourceforge.net/p/mingw-w64/mailman/message/35595229/ interesting. It looks like dllwrap is broken/deprecated and should not be used (I didn't verify if this information is valid).
Something like: i686-w64-mingw32-dlltool -d win32/exconfig.def -e export.o i686-w64-mingw32-g++ -shared -o $@ $(FILE_OBJS) $(CONF_OBJS) exconfig_rc.o win32/exconfig.o export.o -static -lstdc++ should create a dll with valid relocation data.
https://bugs.winehq.org/show_bug.cgi?id=49033
--- Comment #5 from Dominik Reichardt winehq-bugzilla@reichardt.de --- Ended up with $(CXX) $(LDFLAGS) -shared -o $@ $(filter-out $<,$^) --def $< -static -lstdc++ -Wl,--add-stdcall-alias -Wl,--dynamicbase and now the dll is correct and our installer runs.
So, this bug report can probably be closed.
Thanks a lot Piotr, your comments lead us on the right path and we were able to fix it.
https://bugs.winehq.org/show_bug.cgi?id=49033
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
--- Comment #6 from Gijs Vermeulen gijsvrm@gmail.com --- Resolving based on Comment #5.
https://bugs.winehq.org/show_bug.cgi?id=49033
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=49033
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #8 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=49033
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Gijs Vermeulen gijsvrm@gmail.com --- Closing INVALID.