Commit bf9e5aa
committed
fix(bindings): strip debug info on Windows to avoid Go 1.25 DWARF5 PE bug
Go 1.25 switched to DWARF5 debug format by default. On Windows, the
internal linker emits malformed PE section headers when DWARF5 sections
are present, producing a binary that Windows refuses to execute:
fork/exec wailsbindings.exe: %1 is not a valid Win32 application.
fork/exec wailsbindings.exe: This version of %1 is not compatible
with the version of Windows you're running.
Pass -ldflags="-s -w" when building wailsbindings.exe on Windows.
Stripping debug info removes DWARF5 sections entirely, producing clean
PE headers. This is appropriate for a temporary tool binary that is
deleted immediately after use and never debugged.
The fix works regardless of whether the user's project uses CGO.
Upstream: golang/go#75077, golang/go#75121
Fixes #4605
Fixes #45511 parent 03fab14 commit bf9e5aa
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
0 commit comments