]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
chg: dev: embed default sanitizer flags in executables
authorAydın Mercan <aydin@isc.org>
Sun, 5 Apr 2026 10:25:31 +0000 (13:25 +0300)
committerAydın Mercan <aydin@isc.org>
Sun, 5 Apr 2026 10:25:31 +0000 (13:25 +0300)
Replicating CI failures requires the developer to piece together the
sanitizer flags by hand, reducing ergonomics.

Fix this problem by embedding the relevant settings to the executables.
Symbol resolution still needs manual intervention by setting the env
variable `*SAN_SYMBOLIZER_PATH`. However, this doesn't affect any behavior.

The flags are passed though a meson-configured `sanitize.c.in` template file
to toggle which flags are included for the executable. Using the built-in
`__SANITIZE_XXX__` or `__has_feature` for this task is more trouble than it's
worth because only one of the two is available in most GCC/clang versions,
alongside the lack of `__SANITIZE_UNDEFINED__` from GCC.

Meson's own unit test execution sets its own `ASAN_OPTIONS` etc. To prevent it
from overriding the default options, we also pass the same options to unit tests
environment variables.

A new script `ci/sanitizer-default-check.py` is used in CI to detect if
a build directory with sanitizers enabled has a meson `executable` definition
that doesn't include the sanitizer flag source file.

Closes #5469

Merge branch '5469-embed-default-sanitizer-flags-in-the-executable' into 'main'

See merge request isc-projects/bind9!10919


Trivial merge