When compiled SQLite out-of-the-box on MinGW-4.0
there are two problems. One is currently in progress
on the "mingw4x" branch, but there is one more.
For explanation and a suggested fix, see below.

When compiling sqlite3.dll, it contains a link to
libgcc_s_dw2-1.dll, which must be distributed
together with sqlite3.dll. Dit is - of course -
not desired. A workaround is easy: Add the
option "-static-libgcc" in the link line. Earlier
MinGW versions only had a static gcc library,
so it is safe to use this option always: In
MinGW 3 "-static-libgcc" was the default
anyway. Most recent MinGW-w64 versions
have exactly the same problem, only the
required dll name is different (libgcc_s_sjlj-1.dll).
This solution works for MinGW-w64 as well.

This bug is already reported to MinGW,
for details:
<https://sourceforge.net/p/mingw/bugs/2065/>

Regards,
        Jan Nijtmans

===================================================
--- Makefile.in
+++ Makefile.in
@@ -1001,7 +1001,7 @@
        echo 'EXPORTS' >sqlite3.def
        nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
                | sed 's/^.* _//' >>sqlite3.def

 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
-       $(TCC) -shared -o $@ sqlite3.def \
+       $(TCC) -shared -static-libgcc -o $@ sqlite3.def \
                -Wl,"--strip-all" $(REAL_LIBOBJ)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to