On Fri, Nov 26, 2021 at 04:00PM +0800, Kefeng Wang wrote:I only have gcc10, will try gcc 11.
This patch enables KCSAN for arm64, with updates to build rulesNice! Although I think Mark (Cc'd) also had been working on this and
to not use KCSAN for several incompatible compilation units.
Tested selftest and kcsan_test, and all passed.
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
probably knows what, if anything, is still missing.
For one, have you tested gcc 11? To make it work with gcc 11, my
preferred solution is that you simply squash this:
Thanks for your infos, I will try to test it.
---
diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile
index c2bb07f5bcc7..d7d0b51b79f5 100644
--- a/kernel/kcsan/Makefile
+++ b/kernel/kcsan/Makefile
@@ -8,6 +8,7 @@ CFLAGS_REMOVE_debugfs.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
CFLAGS_core.o := $(call cc-option,-fno-conserve-stack) \
+ $(call cc-option,-mno-outline-atomics) \
-fno-stack-protector -DDISABLE_BRANCH_PROFILING
obj-y := core.o debugfs.o report.o
---
[ I have changes to kernel/kcsan/Makefile that I expect to land in -next
soon'ish, the above is small enough that git can auto-merge. ]
gcc somehow made outline-atomics the default (unlike clang), which will
cause linker errors for kernel/kcsan/core.o. While the support for
builtin atomics shouldn't be required on arm64, I want it to be
(compile-)testable on all architectures. Although there's an exception
that certain compiler instrumentation actually require working builtin
atomics support, specifically GCOV_KERNEL.
Thanks,
-- Marco