diff options
author | Ayke van Laethem <[email protected]> | 2024-10-25 15:32:20 +0200 |
---|---|---|
committer | Ayke <[email protected]> | 2024-11-01 09:10:49 +0100 |
commit | 058f62ac08ace927f01b005e7b0a21b1a41590a7 (patch) | |
tree | 2aff4b24813e27f63b49a433dd13ed9d8fa9eb05 /main.go | |
parent | 4e49ba597dc20e0bfd13fc39e0a1c89959576ec5 (diff) | |
download | tinygo-058f62ac08ace927f01b005e7b0a21b1a41590a7.tar.gz tinygo-058f62ac08ace927f01b005e7b0a21b1a41590a7.zip |
main: parse extldflags early so we can report the error message
This avoids some weird behavior when the -extldflags flag cannot be
parsed by TinyGo.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1641,12 +1641,19 @@ func main() { Timeout: *timeout, WITPackage: witPackage, WITWorld: witWorld, - ExtLDFlags: extLDFlags, } if *printCommands { options.PrintCommands = printCommand } + if extLDFlags != "" { + options.ExtLDFlags, err = shlex.Split(extLDFlags) + if err != nil { + fmt.Fprintln(os.Stderr, "could not parse -extldflags:", err) + os.Exit(1) + } + } + err = options.Verify() if err != nil { fmt.Fprintln(os.Stderr, err.Error()) |