OLD | NEW |
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 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 | 2027 |
2028 cgoLibGccFileOnce.Do(func() { | 2028 cgoLibGccFileOnce.Do(func() { |
2029 cgoLibGccFile, cgoLibGccErr = b.libgcc(p) | 2029 cgoLibGccFile, cgoLibGccErr = b.libgcc(p) |
2030 }) | 2030 }) |
2031 if cgoLibGccFile == "" && cgoLibGccErr != nil { | 2031 if cgoLibGccFile == "" && cgoLibGccErr != nil { |
2032 return nil, nil, err | 2032 return nil, nil, err |
2033 } | 2033 } |
2034 | 2034 |
2035 var staticLibs []string | 2035 var staticLibs []string |
2036 if goos == "windows" { | 2036 if goos == "windows" { |
2037 » » // libmingw32 and libmingwex might also use libgcc, so libgcc mu
st come last | 2037 » » // libmingw32 and libmingwex might also use libgcc, so libgcc mu
st come last, |
2038 » » staticLibs = []string{"-lmingwex", "-lmingw32"} | 2038 » » // and they also have some inter-dependencies, so must use linke
r groups. |
| 2039 » » staticLibs = []string{"-Wl,--start-group", "-lmingwex", "-lmingw
32", "-Wl,--end-group"} |
2039 } | 2040 } |
2040 if cgoLibGccFile != "" { | 2041 if cgoLibGccFile != "" { |
2041 staticLibs = append(staticLibs, cgoLibGccFile) | 2042 staticLibs = append(staticLibs, cgoLibGccFile) |
2042 } | 2043 } |
2043 | 2044 |
2044 cflags := stringList(cgoCPPFLAGS, cgoCFLAGS) | 2045 cflags := stringList(cgoCPPFLAGS, cgoCFLAGS) |
2045 for _, cfile := range cfiles { | 2046 for _, cfile := range cfiles { |
2046 ofile := obj + cfile[:len(cfile)-1] + "o" | 2047 ofile := obj + cfile[:len(cfile)-1] + "o" |
2047 if err := b.gcc(p, ofile, cflags, obj+cfile); err != nil { | 2048 if err := b.gcc(p, ofile, cflags, obj+cfile); err != nil { |
2048 return nil, nil, err | 2049 return nil, nil, err |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 func defaultSuffix() string { | 2313 func defaultSuffix() string { |
2313 switch runtime.GOOS { | 2314 switch runtime.GOOS { |
2314 case "windows": | 2315 case "windows": |
2315 return ".bat" | 2316 return ".bat" |
2316 case "plan9": | 2317 case "plan9": |
2317 return ".rc" | 2318 return ".rc" |
2318 default: | 2319 default: |
2319 return ".bash" | 2320 return ".bash" |
2320 } | 2321 } |
2321 } | 2322 } |
OLD | NEW |