Skip to content

Commit ca80c52

Browse files
aykevldeadprogram
authored andcommitted
builder: fix wasi-libc path names on Windows with -size=full
Without this fix, wasi-libc is listed as follows: 65 0 0 0 | 65 0 | C:\Users\Ayke\src\tinygo\tinygo\lib\wasi-libc\libc-bottom-half\sources 14 0 0 0 | 14 0 | C:\Users\Ayke\src\tinygo\tinygo\lib\wasi-libc\libc-top-half\musl\src\exit 1398 0 0 0 | 1398 0 | C:\Users\Ayke\src\tinygo\tinygo\lib\wasi-libc\libc-top-half\musl\src\string 1525 0 0 0 | 1525 0 | C:\Users\Ayke\src\tinygo\tinygo\lib\wasi-libc\libc-top-half\sources With this fix, it's identified as the wasi-libc C library: 3002 0 0 0 | 3002 0 | C wasi-libc
1 parent b76ea29 commit ca80c52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builder/sizes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ func readProgramSizeFromDWARF(data *dwarf.Data, codeOffset, codeAlignment uint64
200200
// Work around a Clang bug on Windows:
201201
// https://github.com/llvm/llvm-project/issues/117317
202202
path = strings.ReplaceAll(path, "\\\\", "\\")
203+
204+
// wasi-libc likes to use forward slashes, but we
205+
// canonicalize everything to use backwards slashes as
206+
// is common on Windows.
207+
path = strings.ReplaceAll(path, "/", "\\")
203208
}
204209
line := addressLine{
205210
Address: prevLineEntry.Address + codeOffset,

0 commit comments

Comments
 (0)