main: set the current working directory when calling an external linker

In particular, while LLVM lld supports -L for linker scripts imported
with the `INCLUDE` command, GNU ld does not seem to support this.

This is a prerequisite for supporting the HiFive1 board in the TinyGo
Playground.
This commit is contained in:
Ayke van Laethem
2019-07-08 00:18:40 +02:00
committed by Ron Evans
parent b0cad7ed63
commit 66d8899aa7
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -63,6 +63,7 @@ func Link(linker string, flags ...string) error {
cmd := exec.Command(linker, flags...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = sourceDir()
return cmd.Run()
}
}
+1
View File
@@ -20,5 +20,6 @@ func Link(linker string, flags ...string) error {
cmd := exec.Command(linker, flags...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = sourceDir()
return cmd.Run()
}