https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50818
David Woodhouse <dwmw2 at infradead dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dwmw2 at infradead dot org --- Comment #2 from David Woodhouse <dwmw2 at infradead dot org> --- Still broken in 5.1.1. Note that if you contrive to build it with -mabi=ms on the command line (by splitting the two functions into separate files and building them separately), it works fine. It also works fine if you explicitly use __builtin_ms_va_{list,start,end}. The problem seems to be that GCC is using the *global* ABI setting to decide what to do when it sees a plain __builtin_va_list, rather the ABI for the *current* function. This is hurting us for UEFI builds too, where only public functions are marked with __attribute__((ms_abi)) but we need *some* way to make va_list do the right thing in the general case.