func compileFiles(files *set.StringSet, targetBaseName string) {
	compilerName, ok := compilers[os.Getenv("GOARCH")]
	if !ok {
		fmt.Println("Could not determine the correct compiler to run.")
		fmt.Println("Please ensure that $GOARCH is set.")
		os.Exit(1)
	}
	compilerPath := path.Join(os.Getenv("GOBIN"), compilerName)
	gopackPath := path.Join(os.Getenv("GOBIN"), "gopack")
	targetDir, _ := path.Split(targetBaseName)
	if targetDir != "" {
		os.MkdirAll(path.Join("igo-out", targetDir), 0700)
	}
	var compilerArgs vector.StringVector
	compilerArgs.Push("-o")
	compilerArgs.Push(targetBaseName + ".6")
	for file := range files.Iter() {
		compilerArgs.Push(path.Join("../", file))
	}
	if !executeCommand(compilerPath, compilerArgs.Data(), "igo-out/") {
		os.Exit(1)
	}
	var gopackArgs vector.StringVector
	gopackArgs.Push("grc")
	gopackArgs.Push(targetBaseName + ".a")
	gopackArgs.Push(targetBaseName + ".6")
	if !executeCommand(gopackPath, gopackArgs.Data(), "igo-out/") {
		os.Exit(1)
	}
}
compileFiles invokes 6g with the appropriate arguments for compiling the
supplied set of .go files, and exits the program if the subprocess fails.
package main
import (
	"container/vector"
	"flag"
	"fmt"
	"igo/build"
	"igo/deps"
	"igo/set"
	"igo/test"
	"io/ioutil"
	"os"
	"path"
	"strings"
)
func executeCommand(tool string, args []string, dir string) bool {
	fmt.Printf("%s %s\n", tool, strings.Join(args, " "))
	var fullArgs vector.StringVector
	fullArgs.Push(tool)
	fullArgs.AppendVector(&args)
	pid, err := os.ForkExec(
		tool,
		fullArgs.Data(),
		os.Environ(),
		dir,
		[]*os.File{os.Stdin, os.Stdout, os.Stderr})
	if err != nil {
		panic(err)
	}
	waitMsg, err := os.Wait(pid, 0)
	if err != nil {
		panic(err)
	}
	return waitMsg.ExitStatus() == 0
}
var compilers = map[string]string {
	"amd64": "6g",
	"386": "8g",
	"arm": "5g",
}