diff options
author | Ayke van Laethem <[email protected]> | 2019-07-08 00:18:40 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-07-08 00:37:53 +0200 |
commit | 66d8899aa7e17223276b279f10853ef5fb2a4ea0 (patch) | |
tree | 028ac3bf2a015ae4c062cd8fcc0158b951d3c7cb | |
parent | b0cad7ed63698dd3ccb1e9782839337a0f610a57 (diff) | |
download | tinygo-66d8899aa7e17223276b279f10853ef5fb2a4ea0.tar.gz tinygo-66d8899aa7e17223276b279f10853ef5fb2a4ea0.zip |
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.
-rw-r--r-- | linker-builtin.go | 1 | ||||
-rw-r--r-- | linker-external.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/linker-builtin.go b/linker-builtin.go index d0a016811..f11d56865 100644 --- a/linker-builtin.go +++ b/linker-builtin.go @@ -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() } } diff --git a/linker-external.go b/linker-external.go index 48e4d2ecd..f114b39bb 100644 --- a/linker-external.go +++ b/linker-external.go @@ -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() } |