summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/Makefile b/rust/Makefile
index 5e7612f69cea..a6e80caa42c1 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -264,7 +264,11 @@ else
bindgen_c_flags_lto = $(bindgen_c_flags)
endif
-bindgen_c_flags_final = $(bindgen_c_flags_lto) -D__BINDGEN__
+# `-fno-builtin` is passed to avoid `bindgen` from using `clang` builtin
+# prototypes for functions like `memcpy` -- if this flag is not passed,
+# `bindgen`-generated prototypes use `c_ulong` or `c_uint` depending on
+# architecture instead of generating `usize`.
+bindgen_c_flags_final = $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__
# Each `bindgen` release may upgrade the list of Rust target versions. By
# default, the highest stable release in their list is used. Thus we need to set