Skip to content

Commit 268264f

Browse files
jeplerdpgeorge
authored andcommitted
tools/ci.sh: Add functions for sanitizer builds.
Includes both undefined and address sanitizer configurations. Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent 2c8ccd3 commit 268264f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tools/ci.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,18 @@ CI_UNIX_OPTS_QEMU_RISCV64=(
512512
MICROPY_STANDALONE=1
513513
)
514514

515+
CI_UNIX_OPTS_SANITIZE_ADDRESS=(
516+
VARIANT=coverage
517+
CFLAGS_EXTRA="-fsanitize=address"
518+
LDFLAGS_EXTRA="-fsanitize=address"
519+
)
520+
521+
CI_UNIX_OPTS_SANITIZE_UNDEFINED=(
522+
VARIANT=coverage
523+
CFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute"
524+
LDFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute"
525+
)
526+
515527
function ci_unix_build_helper {
516528
make ${MAKEOPTS} -C mpy-cross
517529
make ${MAKEOPTS} -C ports/unix "$@" submodules
@@ -742,6 +754,28 @@ function ci_unix_settrace_stackless_run_tests {
742754
ci_unix_run_tests_full_helper standard "${CI_UNIX_OPTS_SYS_SETTRACE_STACKLESS[@]}"
743755
}
744756

757+
function ci_unix_sanitize_undefined_build {
758+
make ${MAKEOPTS} -C mpy-cross
759+
make ${MAKEOPTS} -C ports/unix submodules
760+
make ${MAKEOPTS} -C ports/unix "${CI_UNIX_OPTS_SANITIZE_UNDEFINED[@]}"
761+
ci_unix_build_ffi_lib_helper gcc
762+
}
763+
764+
function ci_unix_sanitize_undefined_run_tests {
765+
ci_unix_run_tests_full_helper coverage "${CI_UNIX_OPTS_SANITIZE_UNDEFINED[@]}"
766+
}
767+
768+
function ci_unix_sanitize_address_build {
769+
make ${MAKEOPTS} -C mpy-cross
770+
make ${MAKEOPTS} -C ports/unix submodules
771+
make ${MAKEOPTS} -C ports/unix "${CI_UNIX_OPTS_SANITIZE_ADDRESS[@]}"
772+
ci_unix_build_ffi_lib_helper gcc
773+
}
774+
775+
function ci_unix_sanitize_address_run_tests {
776+
ci_unix_run_tests_full_helper coverage "${CI_UNIX_OPTS_SANITIZE_ADDRESS[@]}"
777+
}
778+
745779
function ci_unix_macos_build {
746780
make ${MAKEOPTS} -C mpy-cross
747781
make ${MAKEOPTS} -C ports/unix submodules

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy