// gcc runs the gcc C compiler to create an object from a single C file.
func (b *Builder) gcc(a *Action, workdir, out string, flags []string, cfile string) error {
p := a.Package
- return b.ccompile(modload.LoaderState, a, out, flags, cfile, b.GccCmd(p.Dir, workdir))
+ return b.ccompile(a, out, flags, cfile, b.GccCmd(p.Dir, workdir))
}
// gas runs the gcc c compiler to create an object file from a single C assembly file.
return fmt.Errorf("package using cgo has Go assembly file %s", sfile)
}
}
- return b.ccompile(modload.LoaderState, a, out, flags, sfile, b.GccCmd(p.Dir, workdir))
+ return b.ccompile(a, out, flags, sfile, b.GccCmd(p.Dir, workdir))
}
// gxx runs the g++ C++ compiler to create an object from a single C++ file.
func (b *Builder) gxx(a *Action, workdir, out string, flags []string, cxxfile string) error {
p := a.Package
- return b.ccompile(modload.LoaderState, a, out, flags, cxxfile, b.GxxCmd(p.Dir, workdir))
+ return b.ccompile(a, out, flags, cxxfile, b.GxxCmd(p.Dir, workdir))
}
// gfortran runs the gfortran Fortran compiler to create an object from a single Fortran file.
func (b *Builder) gfortran(a *Action, workdir, out string, flags []string, ffile string) error {
p := a.Package
- return b.ccompile(modload.LoaderState, a, out, flags, ffile, b.gfortranCmd(p.Dir, workdir))
+ return b.ccompile(a, out, flags, ffile, b.gfortranCmd(p.Dir, workdir))
}
// ccompile runs the given C or C++ compiler and creates an object from a single source file.
-func (b *Builder) ccompile(loaderstate *modload.State, a *Action, outfile string, flags []string, file string, compiler []string) error {
+func (b *Builder) ccompile(a *Action, outfile string, flags []string, file string, compiler []string) error {
p := a.Package
sh := b.Shell(a)
file = mkAbs(p.Dir, file)
}
}
if len(newFlags) < len(flags) {
- return b.ccompile(loaderstate, a, outfile, newFlags, file, compiler)
+ return b.ccompile(a, outfile, newFlags, file, compiler)
}
}