cmd/cgo: split cgo_export into cgo_export_static and cgo_export_dynamic

Also emit cgo_ldflag pragmas.

R=golang-dev, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/7530043
This commit is contained in:
Russ Cox 2013-03-06 16:57:14 -05:00
parent 56d1faa8b6
commit fb59aed60b
7 changed files with 65 additions and 23 deletions

View file

@ -139,11 +139,7 @@ NextLine:
// addToFlag appends args to flag. All flags are later written out onto the
// _cgo_flags file for the build system to use.
func (p *Package) addToFlag(flag string, args []string) {
if oldv, ok := p.CgoFlags[flag]; ok {
p.CgoFlags[flag] = oldv + " " + strings.Join(args, " ")
} else {
p.CgoFlags[flag] = strings.Join(args, " ")
}
p.CgoFlags[flag] = append(p.CgoFlags[flag], args...)
if flag == "CFLAGS" {
// We'll also need these when preprocessing for dwarf information.
p.GccOptions = append(p.GccOptions, args...)