mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-31 17:59:03 +00:00
builder: add strlen to wasm builtins
LLVM 22 can replace string-scanning loops with calls to strlen during optimization. Add the implementation to wasmbuiltins and invalidate cached archives. Add an optimized wasm-unknown smoke test that exercises the reflect name-decoding path which exposed the missing symbol.
This commit is contained in:
@@ -43,11 +43,11 @@ var libWasmBuiltins = Library{
|
||||
sourceDir: func() string { return filepath.Join(goenv.Get("TINYGOROOT"), "lib/wasi-libc") },
|
||||
librarySources: func(target string, _ bool) ([]string, error) {
|
||||
return []string{
|
||||
// memory builtins needed for llvm.memcpy.*, llvm.memmove.*, and
|
||||
// llvm.memset.* LLVM intrinsics.
|
||||
// Memory builtins needed for LLVM intrinsics and library calls.
|
||||
"libc-top-half/musl/src/string/memcpy.c",
|
||||
"libc-top-half/musl/src/string/memmove.c",
|
||||
"libc-top-half/musl/src/string/memset.c",
|
||||
"libc-top-half/musl/src/string/strlen.c",
|
||||
|
||||
// exp, exp2, and log are needed for LLVM math builtin functions
|
||||
// like llvm.exp.*.
|
||||
|
||||
Reference in New Issue
Block a user