@@ -75,7 +75,7 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
75
75
}
76
76
77
77
pkgpath := pkgPath (a )
78
- gcargs := []string {"-p" , pkgpath }
78
+ gcflags := []string {"-p" , pkgpath }
79
79
if p .Module != nil {
80
80
v := p .Module .GoVersion
81
81
if v == "" {
@@ -94,19 +94,19 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
94
94
v = "1.16"
95
95
}
96
96
if allowedVersion (v ) {
97
- gcargs = append (gcargs , "-lang=go" + v )
97
+ gcflags = append (gcflags , "-lang=go" + v )
98
98
}
99
99
}
100
100
if p .Standard {
101
- gcargs = append (gcargs , "-std" )
101
+ gcflags = append (gcflags , "-std" )
102
102
}
103
103
_ , compilingRuntime := runtimePackages [p .ImportPath ]
104
104
compilingRuntime = compilingRuntime && p .Standard
105
105
if compilingRuntime {
106
106
// runtime compiles with a special gc flag to check for
107
107
// memory allocations that are invalid in the runtime package,
108
108
// and to implement some special compiler pragmas.
109
- gcargs = append (gcargs , "-+" )
109
+ gcflags = append (gcflags , "-+" )
110
110
}
111
111
112
112
// If we're giving the compiler the entire package (no C etc files), tell it that,
@@ -125,25 +125,25 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
125
125
}
126
126
}
127
127
if extFiles == 0 {
128
- gcargs = append (gcargs , "-complete" )
128
+ gcflags = append (gcflags , "-complete" )
129
129
}
130
130
if cfg .BuildContext .InstallSuffix != "" {
131
- gcargs = append (gcargs , "-installsuffix" , cfg .BuildContext .InstallSuffix )
131
+ gcflags = append (gcflags , "-installsuffix" , cfg .BuildContext .InstallSuffix )
132
132
}
133
133
if a .buildID != "" {
134
- gcargs = append (gcargs , "-buildid" , a .buildID )
134
+ gcflags = append (gcflags , "-buildid" , a .buildID )
135
135
}
136
136
if p .Internal .OmitDebug || cfg .Goos == "plan9" || cfg .Goarch == "wasm" {
137
- gcargs = append (gcargs , "-dwarf=false" )
137
+ gcflags = append (gcflags , "-dwarf=false" )
138
138
}
139
139
if strings .HasPrefix (runtimeVersion , "go1" ) && ! strings .Contains (os .Args [0 ], "go_bootstrap" ) {
140
- gcargs = append (gcargs , "-goversion" , runtimeVersion )
140
+ gcflags = append (gcflags , "-goversion" , runtimeVersion )
141
141
}
142
142
if symabis != "" {
143
- gcargs = append (gcargs , "-symabis" , symabis )
143
+ gcflags = append (gcflags , "-symabis" , symabis )
144
144
}
145
145
146
- gcflags := str .StringList (forcedGcflags , p .Internal .Gcflags )
146
+ gcflags = append ( gcflags , str .StringList (forcedGcflags , p .Internal .Gcflags ) ... )
147
147
if compilingRuntime {
148
148
// Remove -N, if present.
149
149
// It is not possible to build the runtime with no optimizations,
@@ -157,7 +157,7 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
157
157
}
158
158
}
159
159
160
- args := []interface {}{cfg .BuildToolexec , base .Tool ("compile" ), "-o" , ofile , "-trimpath" , a .trimpath (), gcflags , gcargs }
160
+ args := []interface {}{cfg .BuildToolexec , base .Tool ("compile" ), "-o" , ofile , "-trimpath" , a .trimpath (), gcflags }
161
161
if p .Internal .LocalPrefix != "" {
162
162
// Workaround #43883.
163
163
args = append (args , "-D" , p .Internal .LocalPrefix )
0 commit comments