From: Shenghou Ma Date: Fri, 16 Mar 2012 16:05:09 +0000 (-0400) Subject: cmd/go: add -fno-common by default on Darwin X-Git-Tag: weekly.2012-03-22~61 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9b70c70ffb3f42d6f413bbff894621f8f1e4de05;p=gostls13.git 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 --- diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 3246b02f35..67b682ecb7 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -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 }