]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: makes clang happy by not using __gcc_struct__ attribute.
authorShenghou Ma <minux.ma@gmail.com>
Mon, 10 Jun 2013 18:51:01 +0000 (02:51 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Mon, 10 Jun 2013 18:51:01 +0000 (02:51 +0800)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10150043

src/cmd/cgo/out.go

index eee71864cf8254bf7c42095a6b7a2c82442ac779..be05c85a2d1877cf37be0a5ab61b4d56a587dfcc 100644 (file)
@@ -488,7 +488,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
        // Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86,
        // and http://golang.org/issue/5603.
        extraAttr := ""
-       if goarch == "amd64" || goarch == "386" {
+       if !strings.Contains(p.gccName(), "clang") && (goarch == "amd64" || goarch == "386") {
                extraAttr = ", __gcc_struct__"
        }
        fmt.Fprintf(fgcc, "\t%s __attribute__((__packed__%v)) *a = v;\n", ctype, extraAttr)