Page MenuHomeFreeBSD

features: Add support to enable sanitizers
ClosedPublic

Authored by olivier on Jan 18 2024, 4:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 4, 8:46 AM
Unknown Object (File)
Mon, Jun 3, 1:46 PM
Unknown Object (File)
Mon, Jun 3, 1:46 PM
Unknown Object (File)
Mon, Jun 3, 1:46 PM
Unknown Object (File)
Mon, Jun 3, 10:25 AM
Unknown Object (File)
Sun, Jun 2, 9:52 PM
Unknown Object (File)
Tue, May 28, 8:33 PM
Unknown Object (File)
Sun, May 26, 8:55 PM
Subscribers
None

Details

Summary

Allow to enable the asan (default) ,ubsan,tsan and msan.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olivier created this revision.
This revision is now accepted and ready to land.Jan 18 2024, 4:56 PM

At least meson does have a special flag(s) for enabling sanitizer(s). I suppose they should be used if we detect USES=meson in the works.

Mk/bsd.port.mk
1019

The list grows. Should we sort its items?

This revision now requires review to proceed.Jan 18 2024, 6:19 PM

Thank you. Now, how about adding support for requesting several sanitizers at the same time? Let SANITIZE_FLAGS accept a list of values like SANITIZE_FLAGS= memory thread and then iterate over it with .for?

Let me know if you don't want to do this. Your change is already pretty useful.

Thank you. Now, how about adding support for requesting several sanitizers at the same time? Let SANITIZE_FLAGS accept a list of values like SANITIZE_FLAGS= memory thread and then iterate over it with .for?

Let me know if you don't want to do this. Your change is already pretty useful.

some are incompatible between them, but you can already enable multiples of them with SANITIZE_FLAGS="address,undefined"

Whoa, didn't know that. That's great, can you please expand the comment section then? Something like

# Variables affecting the feature:
#  SANITIZE_FLAGS	Comma-separated list of sanitizers to be enabled during the build
#					default: memory

Take a look at Mk/Uses/cabal.mk for a more elaborate example.

Add variables usage description

arrowd added inline comments.
Mk/Features/sanitize.mk
7

Typo: for each bug detected

This revision is now accepted and ready to land.Jan 18 2024, 7:28 PM
This revision now requires review to proceed.Jan 18 2024, 7:42 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 18 2024, 8:15 PM
This revision was automatically updated to reflect the committed changes.