1
0
mirror of https://github.com/golang/go synced 2024-11-25 11:27:56 -07:00

cmd/go: allow to use syso files with cgo

I have C functions implemented in .syso file (rather than .so or inlined in .go file).
W/o this change the gcc invocation fails with undefined symbols.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6352076
This commit is contained in:
Dmitriy Vyukov 2012-08-04 18:02:12 +03:00
parent 8be5e8a419
commit 2f2df2aceb

View File

@ -1576,6 +1576,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
linkobj = append(linkobj, ofile)
outObj = append(outObj, ofile)
}
linkobj = append(linkobj, p.SysoFiles...)
dynobj := obj + "_cgo_.o"
if goarch == "arm" && goos == "linux" { // we need to use -pie for Linux/ARM to get accurate imported sym
cgoLDFLAGS = append(cgoLDFLAGS, "-pie")