Skip to content

-lpthread revert broke gccgo on ppc64le (at least) #203

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

Closed
stgraber opened this issue Apr 30, 2015 · 7 comments
Closed

-lpthread revert broke gccgo on ppc64le (at least) #203

stgraber opened this issue Apr 30, 2015 · 7 comments

Comments

@stgraber
Copy link
Contributor

The -lpthread option is required for pthread trylock under gccgo at least for ppc64le (likely more architectures too).

If setting it for everyone breaks some cases, can we at least keep it for gccgo+linux?

@mattn
Copy link
Owner

mattn commented Apr 30, 2015

@minux is it possible to avoid this with something like #cgo gccgo LDFLAGS -lpthread ?

@minux
Copy link

minux commented Apr 30, 2015 via email

@stgraber
Copy link
Contributor Author

We're running into that issue using gccgo 5.0 on ppc64le (and I suspect on other arches too but I don't have access to arm64 right now to confirm)

@minux
Copy link

minux commented Apr 30, 2015 via email

@stgraber
Copy link
Contributor Author

So it may well be that gccgo is the problem, unfortunately changing the compiler isn't something I can trivially do, and retro-actively doing so for existing older releases is even less likely to happen.

Can anyone think of a problem with using:

#cgo gccgo,linux LDFLAGS: -lpthread

That should be specific enough not to affect anyone else.

@ianlancetaylor
Copy link
Contributor

How does this problem arise? As minux said, libgo is already linked against libpthread. When linking statically, the gccgo driver adds an explicit -lpthread. So what precisely are you doing to cause a problem? And what precisely happens?

@stgraber
Copy link
Contributor Author

Still not sure exactly what's going on as I can't reproduce the issue with a simple example but can when attempting to build our project (and its ton of dependencies).

Anyway, looks like adding -lpthread to our own cgo file fixes things so I'll just do that.

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