ci: add -fno-builtin to bindgen builder#695
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
gurry
June 30, 2026 11:39
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates wdk-build’s bindgen configuration to avoid Clang substituting certain standard-library function declarations (e.g., memcpy, strlen) with builtin signatures, which can cause bindgen to emit Rust bindings with u64/c_ulonglong sizes and trip the new rustc lint suspicious_runtime_symbol_definitions.
Changes:
- Add
-fno-builtinto the bindgen Clang invocation so function signatures retainsize_t(and therefore bindgen’s expected Rust mapping). - Document the rationale for the flag directly in the builder configuration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
-fno-builtin to bindgen builder
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #695 +/- ##
=======================================
Coverage 79.78% 79.78%
=======================================
Files 26 26
Lines 5590 5590
Branches 5590 5590
=======================================
Hits 4460 4460
Misses 1001 1001
Partials 129 129 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wmmc88
approved these changes
Jun 30, 2026
gurry
approved these changes
Jun 30, 2026
svasista-ms
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a build failure caused by a newly introduced rustc lint
suspicious_runtime_symbol_definitions.The lint fails because bindgen maps
size_ttoc_ulonglong/u64instead ofusizefor functions likememcpy,strlenetc. The reason bindgen behaves like this is because clang silently replaces any declarations of such functions in the input C code with its own builtins with the same names. Since the builtins useunsigned long longinstead ofsize_tbindgen emitsc_ulonglonginstead ofusize.The fix is to pass
-fno-builtinto clang which ensures it does not replace aforesaid functions with builtins.