From 3b92a059fe3f921639baa45b2685a932d92b5c1b Mon Sep 17 00:00:00 2001 From: Alexander Andersson Date: Wed, 31 Aug 2016 10:14:29 +0200 Subject: [PATCH] cmd: Clean up and cmnts in 3rdpartycompile --- cmd/3rdpartycompile/3rdpartycompile.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/3rdpartycompile/3rdpartycompile.go b/cmd/3rdpartycompile/3rdpartycompile.go index f851f24..4fb1f85 100644 --- a/cmd/3rdpartycompile/3rdpartycompile.go +++ b/cmd/3rdpartycompile/3rdpartycompile.go @@ -136,11 +136,16 @@ func compileFile(path string, outputPath string, goccLexer bool) error { // Generate LLVM IR module based on the syntax tree of the given file. module := irgen.Gen(file, info) + + // Add path to uc lib. lib, err := goutil.SrcDir("github.com/mewmew/uc/testdata") if err != nil { return errutil.Err(err) } - clang := exec.Command("clang", "-o", outputPath, "-x", "ir", filepath.Join(lib, "uc.ll"), "-") + lib = filepath.Join(lib, "uc.ll") + + // Link and create binary through clang + clang := exec.Command("clang", "-o", outputPath, "-x", "ir", lib, "-") clang.Stdin = strings.NewReader(module.String()) clang.Stderr = os.Stderr clang.Stdout = os.Stdout