summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2020-11-10 19:15:13 +0000
committerBrooks Davis <brooks@FreeBSD.org>2020-11-10 19:15:13 +0000
commite268fd0a029e620a0cc85c9437ae5dc35a00c699 (patch)
tree46ba7bf0f2d8c42e2827359200519c2ac2474af2 /tools
parent9ebe945bd791f25fe5f4774205cbf07eabca348b (diff)
downloadsrc-test2-e268fd0a029e620a0cc85c9437ae5dc35a00c699.tar.gz
src-test2-e268fd0a029e620a0cc85c9437ae5dc35a00c699.zip
Support initializing stack variables on function entry
There are two options: - WITH_INIT_ALL_ZERO: Zero all variables on the stack. - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. The exact pattern are a compiler implementation detail and vary by type. They are somewhat documented in the LLVM commit message: https://reviews.llvm.org/rL349442 I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather than naming them after the LLVM specific compiler flags. In a range of consumer products, options like these are used in both debug and production builds with debugs builds using patterns (intended to provoke crashes on use of uninitialized values) and production using zeros (deemed more likely to lead to harmless misbehavior or NULL-pointer dereferences). Reviewed by: emaste Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27131
Notes
Notes: svn path=/head/; revision=367577
Diffstat (limited to 'tools')
-rw-r--r--tools/build/options/WITH_INIT_ALL_PATTERN5
-rw-r--r--tools/build/options/WITH_INIT_ALL_ZERO4
2 files changed, 9 insertions, 0 deletions
diff --git a/tools/build/options/WITH_INIT_ALL_PATTERN b/tools/build/options/WITH_INIT_ALL_PATTERN
new file mode 100644
index 000000000000..9908477b0983
--- /dev/null
+++ b/tools/build/options/WITH_INIT_ALL_PATTERN
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to build the base system or kernel with stack variables initialized to
+.Pq compiler defined
+debugging patterns on function entry.
+This option requires the clang compiler.
diff --git a/tools/build/options/WITH_INIT_ALL_ZERO b/tools/build/options/WITH_INIT_ALL_ZERO
new file mode 100644
index 000000000000..4e824c4f8bed
--- /dev/null
+++ b/tools/build/options/WITH_INIT_ALL_ZERO
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to build the base system or kernel with stack variables initialized
+to zero on function entry.
+This option requires that the clang compiler be used.