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: -Wl , -rpath in LDFLAGS throws invalid flag in #cgo LDFLAGS: -Wl,-rpath=$ORIGIN/lib #23904

Closed
datNurd opened this issue Feb 18, 2018 · 3 comments

Comments

@datNurd
Copy link

datNurd commented Feb 18, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10 windows/386

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Windows 10, 64 bit

What did you do?

#cgo CFLAGS: -I${SRCDIR}/lib
#cgo LDFLAGS: -L${SRCDIR}/lib -Wl,-rpath=\$ORIGIN/lib -ltest
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

Compiled go program.

What did you see instead?

go build command-line-arguments: invalid flag in #cgo LDFLAGS: -Wl,-rpath=$ORIGIN/lib

@odeke-em odeke-em changed the title -Wl , -rpath in LDFLAGS throws invalid flag in #cgo LDFLAGS: -Wl,-rpath=$ORIGIN/lib cmd/cgo: -Wl , -rpath in LDFLAGS throws invalid flag in #cgo LDFLAGS: -Wl,-rpath=$ORIGIN/lib Feb 18, 2018
@odeke-em
Copy link
Member

@hirochachacha
Copy link
Contributor

use ',' instead of '='.

#cgo LDFLAGS: -L${SRCDIR}/lib -Wl,-rpath,$ORIGIN/lib -ltest

@ianlancetaylor
Copy link
Contributor

Consolidating into #23937.

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

5 participants