Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import doesn't work on MacOS X 10.7.5, go version go1.2rc3 darwin/amd64 #92

Closed
sacado opened this issue Nov 19, 2013 · 12 comments
Closed

Comments

@sacado
Copy link

sacado commented Nov 19, 2013

My source code:

package main

import (
   "fmt"
   _ "github.com/mattn/go-sqlite3"
)

func main() {
   fmt.Printf("Testing import\n")
}

Result on calling go install github.com/sacado/foo:

# github.com/sacado/foo
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 mmap
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol munmap
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for close (type 32 rtype 120)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for access (type 32 rtype 120)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for getcwd (type 32 rtype 120)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for stat$INODE64 (type 32 rtype 120)
too many errors
@mattn
Copy link
Owner

mattn commented Nov 20, 2013

Could you please try:

go install -x github.com/sacado/foo:

@aarsakian
Copy link

I also get the same error with go version go1.2rc5 and mac os version 10.6.8 when I try to build the above script. On my linux machine I built it without problems.

@mattn
Copy link
Owner

mattn commented Dec 1, 2013

Are you using clang?

@aarsakian
Copy link

No, I checked my list of installed packages as provided by mac ports, there is not any clang package among them.

@mattn
Copy link
Owner

mattn commented Dec 2, 2013

Could you please try: go get -x github.com/mattn/go-sqlite3

@aarsakian
Copy link

Running the command go-sqlite from a subdirectory say MyProgram, it seems to build without any problems. Note that it creates an archive file go-sqlite3.a at MyProgram/pkg/darwin_amd64, however my system architecture is i386 is this normal?. Finally when I try to run either go install or go build at MyProgram/src/Folder/ where my go files reside the above error happens.

@mattn
Copy link
Owner

mattn commented Dec 3, 2013

this normal?

Then, why are you using go version go1.2rc3 darwin/amd64?

@aarsakian
Copy link

I changed the go version to one prebuilt for mac os, go version gives me "go1.2rc5 darwin/386". In a fresh install, go-sqlite3 builds succesfully, but when I try to build the above example the error persists.

The error differs slightly as you can see

github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol close$UNIX2003
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$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol read$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol pread$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol write$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol pwrite$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol fchmod$UNIX2003
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 mmap$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unexpected reloc for dynamic symbol munmap$UNIX2003
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for close$UNIX2003 (type 32 rtype 76)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for access (type 32 rtype 76)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for getcwd (type 32 rtype 76)
github.com/mattn/go-sqlite3(__DATA/__data): unhandled relocation for stat$INODE64 (type 32 rtype 76)
too many errors

@sacado
Copy link
Author

sacado commented Dec 4, 2013

Ok, got it working. When compiled with

go install -x -ldflags -linkmode=external github.com/sacado/foo

Everything works perfectly.

Sacado

2013/12/3 Armen Arsakian notifications@github.com

I changed the go version to one prebuilt for mac os, go version gives me
"go1.2rc5 darwin/386". In a fresh install, go-sqlite3 builds succesfully,
but when I try to build the above example the error persists.

The error differs slightly as you can see
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol close$UNIX2003
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$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol read$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol pread$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol write$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol pwrite$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol fchmod$UNIX2003
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 mmap$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unexpected reloc for dynamic
symbol munmap$UNIX2003
github.com/mattn/go-sqlite3(_DATA/_data): unhandled relocation for
close$UNIX2003 (type 32 rtype 76)
github.com/mattn/go-sqlite3(_DATA/_data): unhandled relocation for access
(type 32 rtype 76)
github.com/mattn/go-sqlite3(_DATA/_data): unhandled relocation for getcwd
(type 32 rtype 76)
github.com/mattn/go-sqlite3(_DATA/_data): unhandled relocation for
stat$INODE64 (type 32 rtype 76)
too many errors


Reply to this email directly or view it on GitHubhttps://github.com//issues/92#issuecomment-29726295
.

|\___

(:> ___ |3 Fabien Delorme
|/

@mattn
Copy link
Owner

mattn commented Dec 4, 2013

@aarsakian Could you try @sacado 's way?

@aarsakian
Copy link

I followed sacado's instructions and it compiled succesfully.
Thank you both for your help.

@337240552
Copy link

@sacado right solution, 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

No branches or pull requests

4 participants