Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(51)

Side by Side Diff: src/cmd/go/build.go

Issue 7432048: code review 7432048: cmd/cgo: use explicit flag to emit dynamic linker path (Closed)
Patch Set: diff -r 16c93a202587 https://code.google.com/p/go Created 12 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/cgo/out.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "container/heap" 9 "container/heap"
10 "errors" 10 "errors"
(...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 cgoLDFLAGS = cgoLDFLAGS[0 : len(cgoLDFLAGS)-1] 1857 cgoLDFLAGS = cgoLDFLAGS[0 : len(cgoLDFLAGS)-1]
1858 } 1858 }
1859 1859
1860 if _, ok := buildToolchain.(gccgoToolchain); ok { 1860 if _, ok := buildToolchain.(gccgoToolchain); ok {
1861 // we don't use dynimport when using gccgo. 1861 // we don't use dynimport when using gccgo.
1862 return outGo, outObj, nil 1862 return outGo, outObj, nil
1863 } 1863 }
1864 1864
1865 // cgo -dynimport 1865 // cgo -dynimport
1866 importC := obj + "_cgo_import.c" 1866 importC := obj + "_cgo_import.c"
1867 » if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, "-dynimport ", dynobj, "-dynout", importC); err != nil { 1867 » cgoflags = []string{}
1868 » if p.Standard && p.ImportPath == "runtime/cgo" {
1869 » » cgoflags = append(cgoflags, "-dynlinker") // record path to dyna mic linker
1870 » }
1871 » if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, "-dynimport ", dynobj, "-dynout", importC, cgoflags); err != nil {
1868 return nil, nil, err 1872 return nil, nil, err
1869 } 1873 }
1870 1874
1871 // cc _cgo_import.ARCH 1875 // cc _cgo_import.ARCH
1872 importObj := obj + "_cgo_import." + objExt 1876 importObj := obj + "_cgo_import." + objExt
1873 if err := buildToolchain.cc(b, p, obj, importObj, importC); err != nil { 1877 if err := buildToolchain.cc(b, p, obj, importObj, importC); err != nil {
1874 return nil, nil, err 1878 return nil, nil, err
1875 } 1879 }
1876 1880
1877 ofile := obj + "_all.o" 1881 ofile := obj + "_all.o"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 if goarch != "amd64" || goos != "linux" && goos != "darwin" && goos != " windows" { 2027 if goarch != "amd64" || goos != "linux" && goos != "darwin" && goos != " windows" {
2024 fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/ amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0]) 2028 fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/ amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
2025 os.Exit(2) 2029 os.Exit(2)
2026 } 2030 }
2027 buildGcflags = append(buildGcflags, "-race") 2031 buildGcflags = append(buildGcflags, "-race")
2028 buildLdflags = append(buildLdflags, "-race") 2032 buildLdflags = append(buildLdflags, "-race")
2029 buildCcflags = append(buildCcflags, "-D", "RACE") 2033 buildCcflags = append(buildCcflags, "-D", "RACE")
2030 buildContext.InstallTag = "race" 2034 buildContext.InstallTag = "race"
2031 buildContext.BuildTags = append(buildContext.BuildTags, "race") 2035 buildContext.BuildTags = append(buildContext.BuildTags, "race")
2032 } 2036 }
OLDNEW
« no previous file with comments | « src/cmd/cgo/out.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b