File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,6 +278,11 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
278278 -fno-inline-functions-called-once \
279279 --param=% --param asan-%
280280
281+ # Ignore RISC-V extensions that Clang does not recognize.
282+ bindgen_c_flags_patsubst2 = $(patsubst -march=rv% _zihintpause,-march=rv% ,$(c_flags ) )
283+ bindgen_c_flags_patsubst1 = $(patsubst -march=rv% _zicbom,-march=rv% ,$(bindgen_c_flags_patsubst2 ) )
284+ bindgen_c_flags_patsubst = $(patsubst -march=rv% _zicsr_zifencei,-march=rv% ,$(bindgen_c_flags_patsubst1 ) )
285+
281286# Derived from `scripts/Makefile.clang`.
282287BINDGEN_TARGET_arm := arm-linux-gnueabi
283288BINDGEN_TARGET_arm64 := aarch64-linux-gnu
@@ -291,7 +296,7 @@ BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
291296# some configurations, with new GCC versions, etc.
292297bindgen_extra_c_flags = -w --target=$(BINDGEN_TARGET )
293298
294- bindgen_c_flags = $(filter-out $(bindgen_skip_c_flags ) , $(c_flags ) ) \
299+ bindgen_c_flags = $(filter-out $(bindgen_skip_c_flags ) , $(bindgen_c_flags_patsubst ) ) \
295300 $(bindgen_extra_c_flags )
296301endif
297302
You can’t perform that action at this time.
0 commit comments