Commit aa31c67
authored
fix(bindings): strip debug info on Windows to avoid Go 1.25 DWARF5 PE bug (#5524)
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 ff529b7 commit aa31c67
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| |||
0 commit comments