kconfig/randconfig: enable UBSAN for randconfig

Introduce an additional Kconfig check to only offer the option if the
compiler supports -fsanitize=undefined.

We no longer use Travis CI, so the original motivation for not enabling
UBSAN might no longer present.  Regardless, the option won't be present in
the first place if the compiler doesn't support -fsanitize=undefined.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Roger Pau Monne committed 2025-03-20 17:16:18 +01:00
1 parent 1ca5f69e35
commit 6a804ff8b4
3 files changed
+5 -2

No files matched your search

+4
View File
@@ -37,6 +37,10 @@ config CC_HAS_VISIBILITY_ATTRIBUTE
config CC_SPLIT_SECTIONS
bool
# Compiler supports -fsanitize=undefined
config CC_HAS_UBSAN
def_bool $(cc-option,-fsanitize=undefined)
# Set code alignment.
#
# Allow setting on a boolean basis, and then convert such selection to an
+1 -1
View File
@@ -98,7 +98,7 @@ config SCRUB_DEBUG
config UBSAN
bool "Undefined behaviour sanitizer"
depends on HAS_UBSAN
depends on HAS_UBSAN && CC_HAS_UBSAN
help
Enable undefined behaviour sanitizer. It uses compiler to insert code
snippets so that undefined behaviours in C are detected during runtime.
-1
View File
@@ -1,4 +1,3 @@
# Explicit option choices not subject to regular RANDCONFIG
CONFIG_GCOV_FORMAT_AUTODETECT=y
CONFIG_UBSAN=n
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.