On Tue, 12 May 2026, at 19:10, Oliver Smith-Denny wrote: > On 5/12/2026 9:57 AM, Ard Biesheuvel via groups.io wrote: >> Does MSVC follow the AAPCS64 for varargs? >> >> https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#id120 >> > > Thanks for the link here, I didn't realize the va_list definition was > defined in the AAPCS64 ABI spec, I thought that this was only compiler > defined, but its good it is here. Unfortunately...MSVC does not follow > this. > > They simply have typedef char * va_list. Presumably to match what x86 > had. Which is very unfortunate. So then to match, clang has followed > that. > > I'm reaching out to some internal compiler folks on this, but I don't > think this is likely to change, of course. >
Even if MSVC grows a 'compliant' mode at some point which could be used to compile EDK2 with AAPCS64-style varargs, that would be years away. And the current situation is that MSVC and AAPCS64 disagree, and so putting VA_LISTs in PPIs or protocol definitions is problematic. So there you have your answer :-) >> If not, then I don't think this is fixable. If it does, then we need to >> fix the VA_LIST definitions for _M_ARM64. >> > > Yeah, I think the question is whether we should rely on the compiler > builtins here or use our own definitions here, the char * and related > macros. > > Because this is AAPCS64 defined, I somewhat lean towards saying MSVC did > this wrong and we shouldn't punish the toolchains that did this right. > Unfortunately, that doesn't solve the problem. > > We still could make sure CLANGPDB takes advantage of the compiler > builtins by avoiding the _M_ARM64 path, that presumably would have > some benefit, but again, doesn't solve this problem. Agreed. No need to force Clang to do the wrong thing here. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121939): https://edk2.groups.io/g/devel/message/121939 Mute This Topic: https://groups.io/mt/119278849/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
