On Mon, 12 Dec 2016 03:23:21 -0800 (PST) s...@infitialis.com wrote: > Hello, > > I love the pure-Go compiler & tool-chain, especially how effortless > it makes cross-compiling from our Linux development server for our > estate of Windows PCs. > > It even made me feel like it was worth the effort to create a DLL > wrapper for SQLite3, so we can use it without CGo by bundling the > pre-build DLL. Plus I already have to bundle several other DLLs > anyway, so this deployment method wasn't as much of an issue as the > build process. > > I've just put an early test version online > here: https://github.com/iamacarpet/go-sqlite3-win64 > > Ideally I'd like to tweak it to worth with 32bit Windows too (should > be fairly easy), plus Linux (which seems a bit more difficult). > > From what I've seen, dlopen is only supported via CGo > (e.g. https://github.com/rainycape/dl). > > Does anyone have advice on calling C shared libraries on Linux using > pure-Go, like we can call DLLs on Windows?
AFAIK, dlopen() requires cgo simply due to the fact it's not just a thin wrapper around some syscall (like, say, open() is) but it's actually implemented in libc. So I think what you can do is to start with [1] and chase the code paths from there. Note that surely other libc implementations exist, such as muzzle and ulibc, and they could have simpler implementations. (Maybe, I'm not sure.) 1. https://github.com/lattera/glibc/blob/master/dlfcn/dlopen.c -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.