如何在cgo中使用Xlinker? 格式错误的#cgo参数:-(

env:

gcc3.4.5 go1.3 linux2.6.32 centos4

problem:

I want to pass -Xlinker "-(" and -Xlinker "-)" to cgo LDFLAGS, in order to solve static library order problem.

But it seems that cgo does not support this, failed when compile:

xxx.go: malformed #cgo argument: -(

The cgo directive which sets LDFLAGS in xxx.go:

// #cgo LDFLAGS: -Xlinker "-(" libyyy.a libzzz.a -lstdc++ -Xlinker "-)"
import "C"

question:

how to use -Xlinker in cgo?

Use the full option names of --start-group and --end-group rather than the shorthand version.