diff options
author | Patrick Steinhardt <ps@pks.im> | 2025-03-07 11:41:18 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-03-09 18:06:14 -0400 |
commit | 43ea11ea49948635b1d672fef1bd397233b65b19 (patch) | |
tree | e1fa9be70e178fb12d6d01ca8c07d3d4fa437ab9 /docs/markdown/snippets | |
parent | e629d191b99119c360605b056b954fff0905c83f (diff) | |
download | meson-43ea11ea49948635b1d672fef1bd397233b65b19.zip meson-43ea11ea49948635b1d672fef1bd397233b65b19.tar.gz meson-43ea11ea49948635b1d672fef1bd397233b65b19.tar.bz2 |
compilers: convert `b_sanitize` to a free-form array option
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.
Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.
A couple of notes regarding backwards compatibility:
- All previous values of `b_sanitize` will remain valid as the syntax
for free-form array values and valid combo choices is the same. We
also treat 'none' specially so that we know to convert it into an
empty array.
- Even though the option has been converted into a free-form array,
callers of `get_option('b_sanitize')` continue to get a string as
value. We may eventually want to introduce a kwarg to alter this
behaviour, but for now it is expected to be good enough for most use
cases.
Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/b_sanitizer_changes.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/markdown/snippets/b_sanitizer_changes.md b/docs/markdown/snippets/b_sanitizer_changes.md new file mode 100644 index 0000000..f726d70 --- /dev/null +++ b/docs/markdown/snippets/b_sanitizer_changes.md @@ -0,0 +1,17 @@ +## Changes to the b_sanitize option + +Before 1.8 the `b_sanitize` option was a combo option, which is an enumerated +set of values. In 1.8 this was changed to a free-form array of options where +available sanitizers are not hardcoded anymore but instead verified via a +compiler check. + +This solves a number of longstanding issues such as: + + - Sanitizers may be supported by a compiler, but not on a specific platform + (OpenBSD). + - New sanitizers are not recognized by Meson. + - Using sanitizers in previously-unsupported combinations. + +To not break backwards compatibility, calling `get_option('b_sanitize')` +continues to return the configured value as a string, with a guarantee that +`address,undefined` remains ordered. |