Skip to content

fix: propagate implicit target to macro fallback#3382

Merged
emilio merged 1 commit into
rust-lang:mainfrom
zRedShift:fix-macro-fallback-implicit-target
Jul 6, 2026
Merged

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

Conversation

@zRedShift

Copy link
Copy Markdown
Contributor

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.

@emilio emilio added this pull request to the merge queue Jul 6, 2026
Merged via the queue into rust-lang:main with commit 4609f3f Jul 6, 2026
51 checks passed
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

2 participants