From 25380026cfc288c7218eb9a48b4d2ab48bebbc30 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 5 Feb 2024 13:06:08 +0100 Subject: [PATCH] Add workaround for VaList being generated in v(f)printf --- build.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.rs b/build.rs index e9bb749..05c216f 100644 --- a/build.rs +++ b/build.rs @@ -486,6 +486,13 @@ fn main() { .to_string(); } + // On 64-bit native, what gets emitted as vprintf(_, _, _: __builtin_va_list) gets emitted as + // vprintf(_, _, _: core::ffi::VaList), which is unsupported in stable -- but we don't use that + // function, it's just an unfortunate side effect of --preserve-unused-functions. This quick + // workaround enables building and ensures that the function is never called. + rustcode = rustcode.replace("::core::ffi::VaList", "::core::convert::Infallible"); + rustcode = rustcode.replace("__arg.as_va_list()", "__arg"); + // Replace the function declarations with ... usually something pub, but special considerations // may apply let mut rustcode_functionsreplaced = String::new();