> The basic problem (as I vaguely understand it) is that the 6l/8l linkers
> don't support linker scripts, and glibc uses them, so we have to avoid using
> SQLite's os_unix vfs, as it assumes it can use libc.
Note that glibc only uses linker scripts when linking dynamically (you
can see the linker script in question if you look at /usr/lib/libc.so).
Glibc does not use linker scripts when linking statically. While there
may well be a problem with glibc, the problem is not linker scripts.
(I'm not going to try to tackle your question about Windows, though.)
Ian
Hey. I know nothing about gcc but if I remove your line ofI could build your package
#cgo windows LDFLAGS: -lpthread -lgcc_s -lmingwex -lmsvcrt
make clean
make all
The test
make test
fails:
gotest_test/camdev/sqlite.a(sqlite3_obj.o)(.text): __divdi3: not defined
rm -f _test/camdev/sqlite.a
8g -o _gotest_.8 _obj/vfs.cgo1.go _obj/sqlite.cgo1.go _obj/_cgo_gotypes.go sqlite_test.go
rm -f _test/camdev/sqlite.a
gopack grc _test/camdev/sqlite.a _gotest_.8 _cgo_defun.8 _cgo_import.8 sqlite3_obj.o vfs.o vfs.cgo2.o sqlite.cgo2.o _cgo_export.o
_test/camdev/sqlite.a(sqlite3_obj.o)(.text): __moddi3: not defined
_test/camdev/sqlite.a(sqlite3_obj.o)(.text): __moddi3: not defined
_test/camdev/sqlite.a(sqlite3_obj.o)(.text): __divdi3: not defined
yes, static works. ldpe has bug link global values, I fixed it, please
apply < http://codereview.appspot.com/4794052> and try again.
--
Wei guangjing
2011/7/22 mattn <mattn.jp@gmail.com>:
> try to add "static".yes, static works. ldpe has bug link global values, I fixed it, please
> static SYSTEM_INFO winSysInfo;
apply < http://codereview.appspot.com/4794052> and try again.
test works now, need apply CL <http://codereview.appspot.com/4794056>,
fixes another bug in ldpe.
--
Wei guangjing
I've been trying to build sqlite statically with mattn's go-sqlite3 and this post helped a lot with resolving linker issues, but I've got one last undefined reference that I haven't been able to find any information about.This is being built on go1.0.2 with. On compiling the package all goes well, but compiling a program using the package produces:# command-line-argumentsC:\fakepath\Source\GoLang\pkg\windows_386/github.com/mattn/go-sqlite3.a(sqlite3.o)(.text): __chkstk_ms: not defined__chkstk_ms(0): not defined
I've been looking for a solution for a while now and haven't found anything about it. Any help is appreciated.