Skip to content

fix: propagate implicit target to macro fallback#3382

Open
zRedShift wants to merge 1 commit into
rust-lang:mainfrom
zRedShift:fix-macro-fallback-implicit-target
Open

fix: propagate implicit target to macro fallback#3382
zRedShift wants to merge 1 commit into
rust-lang:mainfrom
zRedShift:fix-macro-fallback-implicit-target

Conversation

@zRedShift
Copy link
Copy Markdown

Summary

Fixes #3352.

When bindgen infers a non-host --target= from Cargo TARGET, it inserts that target into the main clang arguments, but fallback_clang_args has already been copied. clang_macro_fallback() can then evaluate macros with the host target instead of the effective target.

Copy the inferred target into fallback_clang_args at the same time, and add a regression test that evaluates __SIZEOF_POINTER__ through the fallback translation unit under an armv7 Cargo target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clang_macro_fallback doesn't propagate implicit --target to fallback translation unit

1 participant