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/go: Cannot pass linker macros to a CGO #6038

Closed
gopherbot opened this issue Aug 4, 2013 · 2 comments
Closed

cmd/go: Cannot pass linker macros to a CGO #6038

gopherbot opened this issue Aug 4, 2013 · 2 comments
Milestone

Comments

@gopherbot
Copy link

by rjeczalik:

go tool does not allow for a '$' char in a #cgo comment, which makes passing e.g.
"-Wl,-rpath -Wl,$ORIGIN" to a cgo a bit hard.



What steps will reproduce the problem?

package main

// #include <stdio.h>
// #cgo LDFLAGS: -Wl,-rpath -Wl,$ORIGIN
import "C"

func main() {
 C.printf("ok")
}

What is the expected output?

$ go run test.go 
ok

What do you see instead?

$ go run test.go 
/tmp/test.go: malformed #cgo argument: -Wl,$ORIGIN

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

Ubuntu 13.04

Which version are you using?  (run 'go version')

go version devel +52e26bb34741 Sun Aug 04 23:32:40 2013 +0400 linux/amd64

Please provide any additional information below.

A proposed patch.

Attachments:

  1. 0001-go-build-Cannot-pass-linker-macros-to-a-CGO.patch (1156 bytes)
@robpike
Copy link
Contributor

robpike commented Aug 4, 2013

Comment 1:

Labels changed: added priority-later, cgo, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 3:

This issue was closed by revision c971f95.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 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
Development

No branches or pull requests

3 participants