mattn / go-sqlite3

sqlite3 driver for go using database/sql

Home Page:http://mattn.github.io/go-sqlite3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unexpected reloc for dynamic symbol close

jackhu1990 opened this issue · comments

yesterday I upgrade xcode
then

command-line-arguments

github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol close
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol access
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol getcwd
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol stat$INODE64
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol fstat$INODE64
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol ftruncate
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol fcntl
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol read
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol pread
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol write
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol pwrite
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol fchmod
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol unlink
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol mkdir
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol rmdir
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol fchown
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol geteuid
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol mmap
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol munmap
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol readlink
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol lstat$INODE64
/usr/local/go/pkg/tool/darwin_amd64/link: too many errors

before upgrade, it's worked。
anybody help me?

commented

seem to be golang/go#8211

env

go version go1.8 darwin/amd64

MacBook Pro (15-inch, Late 2016) 10.12.4 (16E195)

@mattn thanks, I don't find the solution from goland/go#8211
😭😭😭😭😭😭😭😭😭😭😭😭

commented

Since I don't have macOS, I don't make sure, it caused by version of xcode.

golang/go#19772

Are you somehow using -linkmode=internal explicitly in your build?
The linker should default to -linkmode=external for code using this package.
If you're setting -linkmode=internal, please don't.
It's not guaranteed to work for any uses of cgo except the standard library.

This is unrelated to golang/go#19772 except that they both seem to be due to the new Xcode toolchain.

commented

I don't specify the flags explicitly in this package. @jackhu1990 did you build with appended something flags especially?

Sorry to bother on a closed issue, but @jackhu1990 were you able to get Gogland to not use the internal linkmode? I ran into the same problem trying to debug, and was hoping to not have to stand up a more dedicated DB(postgres, or mysql) for this beego project i'm working on.

@solcates if you user gogland to debug. you can

1、brew install sqlite3
2、in gogland debug tools config args --tags "libsqlite3 darwin"

image

then everthing is ok!
image

after brew install sqlite3, you can use go build to build mac'application.
if you want go build other os and arch like linuxarm linuxamd64 .. in mac
you can use karalabe/xgo

image

I have the same issue. @jackhu1990's solution worked for me. Thanks!