diff --git a/compiler.go b/compiler.go index e206dc48..8946f01d 100644 --- a/compiler.go +++ b/compiler.go @@ -3042,10 +3042,6 @@ func (c *Compiler) Verify() error { return llvm.VerifyModule(c.mod, 0) } -func (c *Compiler) LinkModule(mod llvm.Module) error { - return llvm.LinkModules(c.mod, mod) -} - func (c *Compiler) ApplyFunctionSections() { // Put every function in a separate section. This makes it possible for the // linker to remove dead code (-ffunction-sections). diff --git a/main.go b/main.go index 9f1b489d..512cbbc8 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ import ( ) // Helper function for Compiler object. -func Compile(pkgName, runtimePath, outpath, target string, printIR, dumpSSA bool) error { +func Compile(pkgName, outpath, target string, printIR, dumpSSA bool) error { spec, err := LoadTarget(target) c, err := NewCompiler(pkgName, spec.Triple, dumpSSA) @@ -24,18 +24,6 @@ func Compile(pkgName, runtimePath, outpath, target string, printIR, dumpSSA bool return err } - // Add C/LLVM runtime. - if runtimePath != "" { - runtime, err := llvm.ParseBitcodeFile(runtimePath) - if err != nil { - return err - } - err = c.LinkModule(runtime) - if err != nil { - return err - } - } - // Compile Go code to IR. parseErr := func() error { if printIR { @@ -169,7 +157,7 @@ func Run(pkgName string) error { } func usage() { - fmt.Fprintf(os.Stderr, "usage: %s command [-printir] -runtime= [-target=] -o \n", os.Args[0]) + fmt.Fprintf(os.Stderr, "usage: %s command [-printir] [-target=] -o \n", os.Args[0]) fmt.Fprintln(os.Stderr, "\ncommands:") fmt.Fprintln(os.Stderr, " build: compile packages and dependencies") fmt.Fprintln(os.Stderr, " help: print this help text") @@ -182,7 +170,6 @@ func main() { outpath := flag.String("o", "", "output filename") printIR := flag.Bool("printir", false, "print LLVM IR") dumpSSA := flag.Bool("dumpssa", false, "dump internal Go SSA") - runtime := flag.String("runtime", "", "runtime LLVM bitcode files (from C sources)") target := flag.String("target", llvm.DefaultTargetTriple(), "LLVM target") if len(os.Args) < 2 { @@ -208,7 +195,7 @@ func main() { usage() os.Exit(1) } - err := Compile(flag.Arg(0), *runtime, *outpath, *target, *printIR, *dumpSSA) + err := Compile(flag.Arg(0), *outpath, *target, *printIR, *dumpSSA) if err != nil { fmt.Fprintln(os.Stderr, "error:", err) os.Exit(1)