suffix = "msan"
}
- Lflag(fmt.Sprintf("%s/pkg/%s_%s%s%s", goroot, goos, goarch, suffixsep, suffix))
+ Lflag(filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s%s%s", goos, goarch, suffixsep, suffix)))
mayberemoveoutfile()
f, err := os.OpenFile(outfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0775)
found := 0
for i := 0; i < len(Ctxt.Libdir); i++ {
if Linkshared {
- shlibname := fmt.Sprintf("%s/%s.shlibname", Ctxt.Libdir[i], name)
+ shlibname := filepath.Join(Ctxt.Libdir[i], name+".shlibname")
if Debug['v'] != 0 {
fmt.Fprintf(&Bso, "searching for %s.a in %s\n", name, shlibname)
}
break
}
}
- pname := fmt.Sprintf("%s/%s.a", Ctxt.Libdir[i], name)
+ pname := filepath.Join(Ctxt.Libdir[i], name+".a")
if Debug['v'] != 0 {
fmt.Fprintf(&Bso, "searching for %s.a in %s\n", name, pname)
}
coutbuf.f.Close()
mayberemoveoutfile()
- p := fmt.Sprintf("%s/go.o", tmpdir)
+ p := filepath.Join(tmpdir, "go.o")
var err error
f, err := os.OpenFile(p, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0775)
if err != nil {
sema := make(chan struct{}, runtime.NumCPU()) // limit open file descriptors
for i, h := range hostobj {
h := h
- dst := fmt.Sprintf("%s/%06d.o", tmpdir, i)
+ dst := filepath.Join(tmpdir, fmt.Sprintf("%06d.o", i))
paths = append(paths, dst)
wg.Add(1)
mayberemoveoutfile()
argv := []string{extar, "-q", "-c", "-s", outfile}
- argv = append(argv, fmt.Sprintf("%s/go.o", tmpdir))
+ argv = append(argv, filepath.Join(tmpdir, "go.o"))
argv = append(argv, hostobjCopy()...)
if Debug['v'] != 0 {
argv = append(argv, "-Qunused-arguments")
}
- argv = append(argv, fmt.Sprintf("%s/go.o", tmpdir))
+ argv = append(argv, filepath.Join(tmpdir, "go.o"))
argv = append(argv, hostobjCopy()...)
if Linkshared {
if Debug['s'] == 0 && debug_s == 0 && HEADTYPE == obj.Hdarwin {
// Skip combining dwarf on arm.
if Thearch.Thechar != '5' && Thearch.Thechar != '7' {
- dsym := fmt.Sprintf("%s/go.dwarf", tmpdir)
+ dsym := filepath.Join(tmpdir, "go.dwarf")
if out, err := exec.Command("dsymutil", "-f", outfile, "-o", dsym).CombinedOutput(); err != nil {
Ctxt.Cursym = nil
Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out)