]> git.ipfire.org Git - thirdparty/bind9.git/commit
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)
commit7c60b7da8ac18fac33b1c0b049c13c57dcb7d2ff
tree35385f57889babbad3e6d3313246545ee4243f31
parent175b121bc3ee666f4d3a2ea684b67c0c7d3e615e
parente16a3d7a8e82b79296feac31c18dbfd52761a0ad
chg: dev: embed default sanitizer flags in executables

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