File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed
Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -406,15 +406,7 @@ func (c *Config) LDFlags() []string {
406406 if c .Target .LinkerScript != "" {
407407 ldflags = append (ldflags , "-T" , c .Target .LinkerScript )
408408 }
409-
410- if c .Options .ExtLDFlags != "" {
411- ext , err := shlex .Split (c .Options .ExtLDFlags )
412- if err != nil {
413- // if shlex can't split it, pass it as-is and let the external linker complain
414- ext = []string {c .Options .ExtLDFlags }
415- }
416- ldflags = append (ldflags , ext ... )
417- }
409+ ldflags = append (ldflags , c .Options .ExtLDFlags ... )
418410
419411 return ldflags
420412}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ type Options struct {
5858 Timeout time.Duration
5959 WITPackage string // pass through to wasm-tools component embed invocation
6060 WITWorld string // pass through to wasm-tools component embed -w option
61- ExtLDFlags string
61+ ExtLDFlags [] string
6262}
6363
6464// Verify performs a validation on the given options, raising an error if options are not valid.
Original file line number Diff line number Diff line change @@ -1641,12 +1641,19 @@ func main() {
16411641 Timeout : * timeout ,
16421642 WITPackage : witPackage ,
16431643 WITWorld : witWorld ,
1644- ExtLDFlags : extLDFlags ,
16451644 }
16461645 if * printCommands {
16471646 options .PrintCommands = printCommand
16481647 }
16491648
1649+ if extLDFlags != "" {
1650+ options .ExtLDFlags , err = shlex .Split (extLDFlags )
1651+ if err != nil {
1652+ fmt .Fprintln (os .Stderr , "could not parse -extldflags:" , err )
1653+ os .Exit (1 )
1654+ }
1655+ }
1656+
16501657 err = options .Verify ()
16511658 if err != nil {
16521659 fmt .Fprintln (os .Stderr , err .Error ())
You can’t perform that action at this time.
0 commit comments