cmd/go: add -fno-common by default on Darwin

Fixes part of issue 3253.
        We still need to support scattered relocations though.

R=golang-dev, bsiegert, rsc, iant
CC=golang-dev
https://golang.org/cl/5822050
This commit is contained in:
Shenghou Ma 2012-03-16 12:05:09 -04:00 committed by Russ Cox
parent a4b2c5efbc
commit 9b70c70ffb

View File

@ -1403,6 +1403,14 @@ func (b *builder) gccCmd(objdir string) []string {
a = append(a, "-pthread")
}
}
// On OS X, some of the compilers behave as if -fno-common
// is always set, and the Mach-O linker in 6l/8l assumes this.
// See http://golang.org/issue/3253.
if goos == "darwin" {
a = append(a, "-fno-common")
}
return a
}