diff --git a/.bazelrc b/.bazelrc index 477bc17..85679c4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -22,6 +22,10 @@ build:asan --copt -g build:asan --copt -fno-omit-frame-pointer build:asan --linkopt -fsanitize=address +# Skip ASAN for stuff that doesn't work with it. E.G. the kernel. +# as it requires special treatment. +build:asan --build_tag_filters=^no_asan + # User-specific .bazelrc try-import %workspace%/user.bazelrc diff --git a/kernel/BUILD.bazel b/kernel/BUILD.bazel index eb8ea44..1d54154 100644 --- a/kernel/BUILD.bazel +++ b/kernel/BUILD.bazel @@ -71,6 +71,9 @@ nasm_cc_binary( r"$(location x86_64-unknown-elf.ld)", ], linkstatic = True, + tags = [ + "no_asan", + ], target_compatible_with = [ # The kernel can only be built on a linux machine (or cross-compiled from macos) "@platforms//os:linux",