Skip to content

Provide wcslen for x86_64-unknown-uefi target - #582

Closed
andrewdavidmackenzie wants to merge 1 commit into
rust-osdev:mainfrom
andrewdavidmackenzie:fix-wcslen
Closed

andrewdavidmackenzie wants to merge 1 commit into
rust-osdev:mainfrom
andrewdavidmackenzie:fix-wcslen

Conversation

@andrewdavidmackenzie

Copy link
Copy Markdown

The uefi crate's FileInfo::from_uefi and RegularFile::get_info reference wcslen for wide string length calculation. The x86_64-unknown-uefi target has no C runtime providing this symbol, causing a linker error:

rust-lld: error: undefined symbol: wcslen

This adds a simple wcslen implementation to the UEFI bootloader binary.

Fixes #579

The uefi crate's FileInfo::from_uefi and RegularFile::get_info reference
wcslen for wide string length calculation. The x86_64-unknown-uefi target
has no C runtime providing this symbol, causing a linker error.

Add a simple wcslen implementation to the UEFI bootloader binary.
Use #[unsafe(no_mangle)] for compatibility with Rust 2024 edition.

Fixes: rust-osdev#579
@phil-opp

Copy link
Copy Markdown
Member

Thanks for submitting! This should no longer be needed on the latest Rust nightly. It was fixed in compiler_builtins directly in rust-lang/compiler-builtins#1297, which rust-lang/rust upgraded to in rust-lang/rust#162816.

@phil-opp phil-opp closed this Sep 16, 2026
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.

rust-lld: error: undefined symbol: wcslen

2 participants