compiler: act as a compiler driver (on unix systems)

As a final step, link the object file with the system compiler/linker.
TODO: cross compiling.
This commit is contained in:
Ayke van Laethem
2018-09-12 19:56:15 +02:00
parent 6ab2b30984
commit 865520b571
2 changed files with 55 additions and 2 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ func NewCompiler(pkgName, triple string, dumpSSA bool) (*Compiler, error) {
if err != nil {
return nil, err
}
c.machine = target.CreateTargetMachine(triple, "", "", llvm.CodeGenLevelDefault, llvm.RelocDefault, llvm.CodeModelDefault)
c.machine = target.CreateTargetMachine(triple, "", "", llvm.CodeGenLevelDefault, llvm.RelocPIC, llvm.CodeModelDefault)
c.targetData = c.machine.CreateTargetData()
c.mod = llvm.NewModule(pkgName)