Skip to content

Provide wcslen - #10

Merged
JohnAZoidberg merged 1 commit into
mainfrom
fix-wcslen
Nov 20, 2026
Merged

JohnAZoidberg merged 1 commit into
mainfrom
fix-wcslen

Conversation

@JohnAZoidberg

Copy link
Copy Markdown
Member

Since Rust 1.99 (LLVM 23), loops that search for a NUL u16, like in uefi's CStr16::from_ptr, are turned into calls to wcslen. There's no libc on UEFI and compiler_builtins doesn't provide it, so the release build fails to link:

rust-lld: error: undefined symbol: wcslen

Provide our own implementation, same as framework-system commit 307c485 ("uefi: Provide wcslen"). It uses volatile reads, so LLVM can't turn it into a call to itself.

Since Rust 1.99 (LLVM 23), loops that search for a NUL u16, like in
uefi's CStr16::from_ptr, are turned into calls to wcslen. There's no
libc on UEFI and compiler_builtins doesn't provide it, so the release
build fails to link:

    rust-lld: error: undefined symbol: wcslen

Provide our own implementation, same as framework-system commit
307c485 ("uefi: Provide wcslen"). It uses volatile reads, so LLVM
can't turn it into a call to itself.

Signed-off-by: Daniel Schaefer <[email protected]>
@github-actions

Copy link
Copy Markdown

📦 Binary Size Comparison (Nix Build)

Metric Base PR Difference
Size 756.50 KiB 756.50 KiB ✅ ±0 bytes (0%)
SHA256 90413da6fb611cbc... a00c14bfc6aad5c4... ⚠️ Changed
Full hashes
  • Base: 90413da6fb611cbcd341ea85b9564b02f3e29b0b18bcdc3b411fef2850b138fb
  • PR: a00c14bfc6aad5c460e6d4d5407b547307a4637871d17774047ba40d2e81d19b

@JohnAZoidberg
JohnAZoidberg merged commit 087414f into main Nov 20, 2026
8 checks passed
@JohnAZoidberg
JohnAZoidberg deleted the fix-wcslen branch November 20, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant