Skip to content

Core: Restructure sanitizers #108111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Jun 29, 2025

Reworks the build and implementation logic for sanitizers, making them more clearly and universally defined where relevant:

  • typedefs.h now contains the checks/defines for sanitizers, and includes the relevant headers.
  • SANITIZERS_ENABLED now automatically inferred from the previous point, no longer explicitly assigned in SCons files.
  • Added convenience fallback for __has_feature, removing the need for nested define chains on unsupported compilers.

@Repiteo Repiteo added this to the 4.x milestone Jun 29, 2025
@Repiteo Repiteo requested review from a team as code owners June 29, 2025 15:41
@Repiteo Repiteo requested a review from a team as a code owner June 29, 2025 15:41
@Repiteo Repiteo removed the request for review from a team June 29, 2025 18:49
Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

One note; we don't need to include the sanitizer interfaces everywhere. It would be possible to require sanitizer users to explicitly include when needed:

#ifdef TSAN_ENABLED
#include <sanitizer/tsan_interface.h>
#endif

@akien-mga brought this up in #106867 discussions.
I personally don't have a strong opinion on this issue since it's sanitizer-build only.

@Ivorforce Ivorforce requested a review from akien-mga July 2, 2025 18:53
@Repiteo Repiteo modified the milestones: 4.x, 4.6 Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants