mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 20:39:06 +00:00
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.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user