@@ -242,29 +242,27 @@ bindgen_c_flags_final = $(filter-out -D_TASK_CPU=%, $(bindgen_c_flags_lto))
242
242
243
243
quiet_cmd_bindgen = BINDGEN $@
244
244
cmd_bindgen = \
245
- $(BINDGEN ) $< $(shell grep -v '^\#\|^$$' $( srctree ) /rust/bindgen_parameters ) \
245
+ $(BINDGEN ) $< $(bindgen_target_flags ) \
246
246
--use-core --with-derive-default --ctypes-prefix c_types \
247
247
--no-debug '.*' \
248
- --size_t-is-usize -o $@ -- $(bindgen_c_flags_final ) -DMODULE
248
+ --size_t-is-usize -o $@ -- $(bindgen_c_flags_final ) -DMODULE \
249
+ $(bindgen_target_cflags ) $(bindgen_target_extra )
249
250
251
+ $(objtree ) /rust/bindings_generated.rs : private bindgen_target_flags = \
252
+ $(shell grep -v '^\# \|^$$' $(srctree)/rust/bindgen_parameters)
250
253
$(objtree ) /rust/bindings_generated.rs : $(srctree ) /rust/kernel/bindings_helper.h \
251
- $(srctree ) /rust/bindgen_parameters FORCE
254
+ $(srctree)/rust/bindgen_parameters FORCE
252
255
$(call if_changed_dep,bindgen)
253
256
254
- quiet_cmd_bindgen_helper = BINDGEN $@
255
- cmd_bindgen_helper = \
256
- $(BINDGEN ) $< --blacklist-type '.*' --whitelist-var '' \
257
- --whitelist-function 'rust_helper_.*' \
258
- --use-core --with-derive-default --ctypes-prefix c_types \
259
- --no-debug '.*' \
260
- --size_t-is-usize -o $@ -- $(bindgen_c_flags_final ) \
261
- -I$(objtree ) /rust/ -DMODULE $(bindgen_target_cflags ) ; \
262
- sed -Ei 's/pub fn rust_helper_([a-zA-Z0-9_]*)/\# [link_name="rust_helper_\1"]\n pub fn \1/g' $@
263
-
264
- # See `CFLAGS_REMOVE_helpers.o` above.
265
- $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_cflags = -Wno-missing-prototypes
257
+ # See `CFLAGS_REMOVE_helpers.o` above for `-Wno-missing-prototypes`.
258
+ $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_flags = \
259
+ --blacklist-type '.*' --whitelist-var '' --whitelist-function 'rust_helper_.*'
260
+ $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_cflags = \
261
+ -I$(objtree)/rust/ -Wno-missing-prototypes
262
+ $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_extra = ; \
263
+ sed -Ei 's/pub fn rust_helper_([a-zA-Z0-9_]*)/# [link_name="rust_helper_\1"]\n pub fn \1/g' $@
266
264
$(objtree ) /rust/bindings_helpers_generated.rs : $(srctree ) /rust/helpers.c FORCE
267
- $(call if_changed_dep,bindgen_helper )
265
+ $(call if_changed_dep,bindgen )
268
266
269
267
quiet_cmd_exports = EXPORTS $@
270
268
cmd_exports = \
0 commit comments