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

cmd/cgo: use of LDFLAGS -Wl,-rpath fails on darwin with clang #7293

Closed
davecheney opened this issue Feb 9, 2014 · 2 comments

Comments

@davecheney
Copy link
Contributor

commented Feb 9, 2014

What steps will reproduce the problem?

This example is extracted from cmd/go/test.bash

odessa(~/src) % cat origin/origin.go                                                    
                                                                                 
package origin
// #cgo LDFLAGS: -Wl,-rpath -Wl,$ORIGIN
// void f(void) {}
import "C"

func f() { C.f() }


What is the expected output? What do you see instead?

odessa(~/src) % go build origin
# origin
ld: -rpath can only be used when creating a dynamic final linked image
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The same test passes on linux

Please use labels and text to provide additional information.

odessa(~/src) % uname -a
Darwin odessa.fritz.box 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT
2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
odessa(~/src) % cc -v
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
@davecheney

This comment has been minimized.

Copy link
Contributor Author

commented Feb 10, 2014

Comment 2:

https://golang.org/cl/58480045

Status changed to Started.

@davecheney

This comment has been minimized.

Copy link
Contributor Author

commented Feb 10, 2014

Comment 3:

This issue was closed by revision ff5f9bb.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015

@rsc rsc removed the release-go1.3 label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.