-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
features: Add support to enable sanitizers
Can be activated/deactivated globally via WITH_SANITIZE Can be activated individualy via WITH_SANITIZE_PORTS Each port can individually mark itself as not supporting the feature via SANITIZE_UNSAFE= Approved by: bapt, arrowd Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43497
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Sanitize Support | ||
# | ||
# Variables that can be used: | ||
# | ||
# WITH_SANITIZE Enable for all ports. | ||
# Sanitizer exits for each bug detected, so it is not | ||
# advisable to enable it globally. | ||
# WITH_SANITIZE_PORTS Enable for specified category/port-name | ||
# SANITIZE_FLAGS Comma-separated list of sanitizers to be enabled | ||
# Default: address | ||
# | ||
|
||
.if !defined(_SANITIZE_MK_INCLUDED) | ||
_SANITIZE_MK_INCLUDED= yes | ||
SANITIZE_Include_MAINTAINER= portmgr@FreeBSD.org | ||
|
||
. if !defined(SANITIZE_UNSAFE) | ||
SANITIZE_FLAGS?= address | ||
. if defined(_INCLUDE_USES_MESON_MK) | ||
MESON_ARGS+= -Db_sanitize=${SANITIZE_FLAGS} | ||
. else | ||
CFLAGS+= -fsanitize=${SANITIZE_FLAGS} | ||
CXXFLAGS+= -fsanitize=${SANITIZE_FLAGS} | ||
LDFLAGS+= -fsanitize=${SANITIZE_FLAGS} | ||
. endif | ||
. endif | ||
.endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters