microsoft / microsoft/win32metadata
Remapping structs/unions to integers causes issues for Arm64EC
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 149
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 4
Description
When linking with the Rust standard library for Arm64EC, the MSVC linker emits the following warning:
```
LINK : warning LNK4279: function '__imp_SetFilePointerEx' mapped to different icall push thunks: '$iexit_thunk$cdecl$i8$i8m8i8i8' (in 'libucrt.lib(lseek.obj)') and '$iexit_thunk$cdecl$i8$i8i8i8i8' (in 'libstd-c30f7696d89718e8.rlib(std-c30f7696d89718e8.std.1ff72d9e129d2bea-cgu.07.rcgu.o)')
```
The Win32 definitions of `SetFilePointerEx` uses `LARGE_INTEGER`:
Whereas windows-rs uses an `i64`:
This all comes from the type remapping that win32metadata sets up:
It would be easy to fix this one instance, but we need to consider how to handle this in general: having mismatches in function signatures where a struct/union has been replaced with an integer will lead to these issues in Arm64EC.
Contributor guide
Research direction
Start with the remapping entry in generation/WinSDK/scraper.settings.rsp, then compare the Win32 SetFilePointerEx definition with the generated windows-rs signature in crates/libs/sys/src/Windows/Win32/Storage/FileSystem/mod.rs. Investigate how struct and union remappings affect function signatures and Arm64EC icall thunks. Done means a general handling approach is defined and the reported linker mismatch is eliminated without fixing only this instance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- build-system, compilers, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100