Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for VaList being generated in v(f)printf #40

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading