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 {
406
406
if c .Target .LinkerScript != "" {
407
407
ldflags = append (ldflags , "-T" , c .Target .LinkerScript )
408
408
}
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 ... )
418
410
419
411
return ldflags
420
412
}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ type Options struct {
58
58
Timeout time.Duration
59
59
WITPackage string // pass through to wasm-tools component embed invocation
60
60
WITWorld string // pass through to wasm-tools component embed -w option
61
- ExtLDFlags string
61
+ ExtLDFlags [] string
62
62
}
63
63
64
64
// 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() {
1641
1641
Timeout : * timeout ,
1642
1642
WITPackage : witPackage ,
1643
1643
WITWorld : witWorld ,
1644
- ExtLDFlags : extLDFlags ,
1645
1644
}
1646
1645
if * printCommands {
1647
1646
options .PrintCommands = printCommand
1648
1647
}
1649
1648
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
+
1650
1657
err = options .Verify ()
1651
1658
if err != nil {
1652
1659
fmt .Fprintln (os .Stderr , err .Error ())
You can’t perform that action at this time.
0 commit comments