Commit e636f6f5 authored by Mikio Hara's avatar Mikio Hara

cmd/gc: make sure use of pthread for gcc-4.5 and beyond

R=golang-dev, rsc, n13m3y3r, rogpeppe
CC=golang-dev
https://golang.org/cl/5501060
parent 43bc8a9b
......@@ -912,6 +912,16 @@ func (b *builder) gccCmd(objdir string, flags []string, args ...string) []string
case "6":
a = append(a, "-m64")
}
// gcc-4.5 and beyond require explicit "-pthread" flag
// for multithreading with pthread library.
if build.DefaultContext.CgoEnabled {
switch b.goos {
case "windows":
a = append(a, "-mthread")
default:
a = append(a, "-pthread")
}
}
a = append(a, flags...)
return append(a, args...)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment