Red Hat Bugzilla – Bug 1467717
NSISdl.dll is not loadable (LIBWINPTHREAD-1.DLL)
Last modified: 2017-08-24 14:42:34 EDT
+++ This bug was initially created as a clone of Bug #734905 +++
The NSISdl plugin built for Fedora and RedHat fails to load for NSIS installers which call NSISdl::download or NSISdl::download_quiet when the installer is generated by the makensis command of the mingw-nsis component.
I've used the Dependency Walker (http://www.dependencywalker.com/) to verify that the bug has the same kind of root cause as the original bug (https://bugzilla.redhat.com/show_bug.cgi?id=734905), except that the NSISdl.dll now depends on libwinpthread-1.dll instead of libstdc++-6.dll in the original bug.
The tool shows the following functions from libwinpthread-1.dll being referenced: pthread_getspecific, pthread_key_create, pthread_key_delete, pthread_mutex_lock, pthread_mutex_unlock, pthread_once, pthread_setspecific.
As mentioned by Kevin Kofler in the first comment of the original bug, "NSIS plugins may not depend on any additional DLLs, we have to link them statically.".
I've downloaded and tested some RPMs from https://kojipkgs.fedoraproject.org/packages/mingw-nsis/ to try and see when the regression occurred.
The NSISdl.dll files in /usr/share/nsis/Plugins/x86-ansi/ and /usr/share/nsis/Plugins/x86-unicode/ are both affected in following versions:
The NSISdl.dll file in /usr/share/nsis/Plugins/ is also affected in the following versions:
The last good version I could find is mingw32-nsis-2.46-12.fc21.x86_64.rpm so the regression should be around that time.
Comparing the build logs for NSISdl.dll between the -12 and -13 versions doesn't seem to show any changes to the linker command for that DLL.
- Logs for ..-12 at https://kojipkgs.fedoraproject.org/packages/mingw-nsis/2.46/12.fc21/data/logs/x86_64/build.log
- Logs for ..-13 at https://kojipkgs.fedoraproject.org/packages/mingw-nsis/2.46/13.fc21/data/logs/x86_64/build.log
In both cases it seems to be linked with:
i686-w64-mingw32-g++ -s -mwindows -Wl,--file-alignment,512 -Wl,-Map,build/release/NSISdl/NSISdl.map -static-libgcc -static-libstdc++ -Wl,-e_DllMain@12 -shared -o build/release/NSISdl/NSISdl.dll build/release/NSISdl/asyncdns.o build/release/NSISdl/connection.o build/release/NSISdl/httpget.o build/release/NSISdl/nsisdl.o build/release/NSISdl/util.o -Lbuild/release/api/nsis -lpluginapi -lkernel32 -luser32 -ladvapi32 -lws2_32 -Wl,--out-implib,build/release/NSISdl/libNSISdl.a -Wl,--output-def,build/release/NSISdl/NSISdl.def
I am a bit rusty with GCC, but maybe the situation could be improved by adding -static in there somewhere.