Skip to content

Conversation

stgraber
Copy link
Contributor

Those two commits fix go-sqlite3 building with gccgo by renaming the various files which when compiled using cgo could overwrite sqlite3.c and sqlite3.h and then by passing the extra -lpthread flag to the linker which is required because of the symbols in use.

Travis appears to be happy with this and I've successfully built go-sqlite3 in the following setups:

  • golang-go x86_64 linux
  • golang-go x86 linux
  • golang-go armv7 linux
  • gcc-go arm64 linux
  • gcc-go ppc64le linux

This fixes the problem where when building with gccgo, sqlite3.c is
overwritten, leading to a build failure.

An alternative would have been to move sqlite3*.{c,h} to a subdirectory,
but that seems to confuse the linker a fair bit and would just swap one
implementation-dependent issue for another.

Closes #20

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This is required by gccgo because of the pthread_mutex_trylock symbol.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.52% when pulling e688f0a on stgraber:master into aa317ad on mattn:master.

mattn added a commit that referenced this pull request Mar 12, 2015
@mattn mattn merged commit 1b67b9f into mattn:master Mar 12, 2015
@mattn
Copy link
Owner

mattn commented Mar 12, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants