Skip to content

Commit 6ac4005

Browse files
committed
cmd/go: remove module loader state from ccompile
This commit is part of the overall effort to eliminate global modloader state. Change-Id: Iff90d83b440b39df3d598f5a999e270baa893e24 Reviewed-on: https://go-review.googlesource.com/c/go/+/711134 Reviewed-by: Michael Matloob <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
1 parent 6a5a452 commit 6ac4005

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cmd/go/internal/work/exec.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,7 @@ func (noToolchain) cc(b *Builder, a *Action, ofile, cfile string) error {
21932193
// gcc runs the gcc C compiler to create an object from a single C file.
21942194
func (b *Builder) gcc(a *Action, workdir, out string, flags []string, cfile string) error {
21952195
p := a.Package
2196-
return b.ccompile(modload.LoaderState, a, out, flags, cfile, b.GccCmd(p.Dir, workdir))
2196+
return b.ccompile(a, out, flags, cfile, b.GccCmd(p.Dir, workdir))
21972197
}
21982198

21992199
// gas runs the gcc c compiler to create an object file from a single C assembly file.
@@ -2207,23 +2207,23 @@ func (b *Builder) gas(a *Action, workdir, out string, flags []string, sfile stri
22072207
return fmt.Errorf("package using cgo has Go assembly file %s", sfile)
22082208
}
22092209
}
2210-
return b.ccompile(modload.LoaderState, a, out, flags, sfile, b.GccCmd(p.Dir, workdir))
2210+
return b.ccompile(a, out, flags, sfile, b.GccCmd(p.Dir, workdir))
22112211
}
22122212

22132213
// gxx runs the g++ C++ compiler to create an object from a single C++ file.
22142214
func (b *Builder) gxx(a *Action, workdir, out string, flags []string, cxxfile string) error {
22152215
p := a.Package
2216-
return b.ccompile(modload.LoaderState, a, out, flags, cxxfile, b.GxxCmd(p.Dir, workdir))
2216+
return b.ccompile(a, out, flags, cxxfile, b.GxxCmd(p.Dir, workdir))
22172217
}
22182218

22192219
// gfortran runs the gfortran Fortran compiler to create an object from a single Fortran file.
22202220
func (b *Builder) gfortran(a *Action, workdir, out string, flags []string, ffile string) error {
22212221
p := a.Package
2222-
return b.ccompile(modload.LoaderState, a, out, flags, ffile, b.gfortranCmd(p.Dir, workdir))
2222+
return b.ccompile(a, out, flags, ffile, b.gfortranCmd(p.Dir, workdir))
22232223
}
22242224

22252225
// ccompile runs the given C or C++ compiler and creates an object from a single source file.
2226-
func (b *Builder) ccompile(loaderstate *modload.State, a *Action, outfile string, flags []string, file string, compiler []string) error {
2226+
func (b *Builder) ccompile(a *Action, outfile string, flags []string, file string, compiler []string) error {
22272227
p := a.Package
22282228
sh := b.Shell(a)
22292229
file = mkAbs(p.Dir, file)
@@ -2310,7 +2310,7 @@ func (b *Builder) ccompile(loaderstate *modload.State, a *Action, outfile string
23102310
}
23112311
}
23122312
if len(newFlags) < len(flags) {
2313-
return b.ccompile(loaderstate, a, outfile, newFlags, file, compiler)
2313+
return b.ccompile(a, outfile, newFlags, file, compiler)
23142314
}
23152315
}
23162316

0 commit comments

Comments
 (0)