Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177893916
D43497.1795534561.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D43497.1795534561.diff
View Options
diff --git a/Mk/Features/sanitize.mk b/Mk/Features/sanitize.mk
new file mode 100644
--- /dev/null
+++ b/Mk/Features/sanitize.mk
@@ -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
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1016,7 +1016,7 @@
# These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden
# by individual Makefiles or local system make configuration.
-_LIST_OF_WITH_FEATURES= debug lto ssp pie relro bind_now
+_LIST_OF_WITH_FEATURES= bind_now debug lto pie relro sanitize ssp
_DEFAULT_WITH_FEATURES= ssp
PORTSDIR?= /usr/ports
LOCALBASE?= /usr/local
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 3:36 PM (1 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41957054
Default Alt Text
D43497.1795534561.diff (1 KB)
Attached To
Mode
D43497: features: Add support to enable sanitizers
Attached
Detach File
Event Timeline