Skip to content

Commit 17c1154

Browse files
committed
rust: inhibit all bindgen warnings in GCC builds
After requesting other CIs to start giving a go to the Rust bits, we have got our first report. However, this also means keeping track of the list of warnings to be skipped for `bindgen` (in the case of GCC builds) is more involved. Given that GCC support is very experimental (and a hack), it is simpler to ignore all the warnings. What we need is `bindgen` supporting GCC (or possibly that we check the results of `bindgen` via other means). Link: https://lore.kernel.org/lkml/CAKwvOd=7QTUH69+ZbT7e8einvgcosTbDkyohmPaUBv6_y8RfrQ@mail.gmail.com/ Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/lkml/202201310402.vCWP8CUS-lkp@intel.com/ Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent a012f57 commit 17c1154

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

rust/Makefile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
205205
-fno-partial-inlining -fplugin-arg-arm_ssp_per_task_plugin-% \
206206
-fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=% \
207207
-fzero-call-used-regs=% \
208-
-Wno-packed-not-aligned -Wno-format-truncation -Wno-format-overflow \
209-
-Wno-stringop-truncation -Wno-unused-but-set-variable \
210-
-Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized \
211-
-Werror=designated-init -Wno-zero-length-bounds -Wimplicit-fallthrough=% \
212-
-Wno-alloc-size-larger-than -Wcast-function-type \
213208
--param=% --param asan-%
214209

215210
# Derived from `scripts/Makefile.clang`
@@ -220,9 +215,11 @@ BINDGEN_TARGET_riscv := riscv64-linux-gnu
220215
BINDGEN_TARGET_x86 := x86_64-linux-gnu
221216
BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
222217

223-
bindgen_extra_c_flags = --target=$(BINDGEN_TARGET) \
224-
-Wno-address-of-packed-member \
225-
-Wno-gnu-variable-sized-type-not-at-end
218+
# All warnings are inhibited since GCC builds are very experimental,
219+
# many GCC warnings are not supported by Clang, they may only appear in
220+
# some configurations, with new GCC versions, etc.
221+
bindgen_extra_c_flags = -w --target=$(BINDGEN_TARGET)
222+
226223
bindgen_c_flags = $(filter-out $(bindgen_skip_c_flags), $(c_flags)) \
227224
$(bindgen_extra_c_flags)
228225
endif

0 commit comments

Comments
 (0)