jmhodges/levigo

Build with current tip Go on darwin?

Closed this issue · 3 comments

Hey,

Would you be able to confirm whether you are still able to compile levigo
executable on darwin,amd64 with a current tip version of Go?

I am able to build on Linux, but not on OSX.

The linker keeps refusing to find symbols. Oddly a couple of weeks ago I had no problem.
I cannot figure out what is going on.

My CGO_LDFLAGS="-L/Users/petar/aux/leveldb/lib -lleveldb -lstdc++"
and I've removed the #cgo -lleveldb directives from the code. I doubt that makes any difference? (It works on Linux with that modification.)

Thank you
Petar

I have seen this email and will confirm. I would be very surprised if it
does not work. I'm buried at the day job. Will check this weekend.

On Wednesday, April 3, 2013, Petar Maymounkov wrote:

Hey,

Would you be able to confirm whether you are still able to compile levigo
executable on darwin,amd64 with a current tip version of Go?

I am able to build on Linux, but not on OSX.

The linker keeps refusing to find symbols. Oddly a couple of weeks ago I
had no problem.
I cannot figure out what is going on.

My CGO_LDFLAGS="-L/Users/petar/aux/leveldb/lib -lleveldb -lstdc++"
and I've removed the #cgo -lleveldb directives from the code. I doubt that
makes any difference? (It works on Linux with that modification.)

Thank you
Petar


Reply to this email directly or view it on GitHubhttps://github.com//issues/13
.

Well, don't worry.

I found a solution for static linking.

It works, but you need to use:

go build -ldflags='-extld g++'

(you can find a thread from me on gonuts. search for 'petar extld ian'

this is for the case where I deleted all dynamic links from the code like
"#cgo -lleveldb"
and i replaced them with a CGO_LDFLAGS that points directly to the static
library.

So I am set myself. But I did not manage to get dynamic linking to work,
but I also didn't try hard enough, in case this is useful to you.

Thanks
P

On 5 April 2013 02:36, jmhodges notifications@github.com wrote:

I have seen this email and will confirm. I would be very surprised if it
does not work. I'm buried at the day job. Will check this weekend.

On Wednesday, April 3, 2013, Petar Maymounkov wrote:

Hey,

Would you be able to confirm whether you are still able to compile
levigo
executable on darwin,amd64 with a current tip version of Go?

I am able to build on Linux, but not on OSX.

The linker keeps refusing to find symbols. Oddly a couple of weeks ago I
had no problem.
I cannot figure out what is going on.

My CGO_LDFLAGS="-L/Users/petar/aux/leveldb/lib -lleveldb -lstdc++"
and I've removed the #cgo -lleveldb directives from the code. I doubt
that
makes any difference? (It works on Linux with that modification.)

Thank you
Petar


Reply to this email directly or view it on GitHub<
https://github.com/jmhodges/levigo/issues/13>
.


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

Unable to repro. Seems likely it was https://code.google.com/p/go/issues/detail?id=5205