Lines Matching +full:- +full:- +full:enable +full:- +full:asan
5 CWARNFLAGS?= -Wall -Wstrict-prototypes \
6 -Wmissing-prototypes -Wpointer-arith -Wcast-qual \
7 -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \
8 -Wmissing-include-dirs -fdiagnostics-show-option \
9 -Wno-unknown-pragmas -Wswitch \
13 # -Wextra
19 NO_WCONSTANT_CONVERSION= -Wno-error=constant-conversion
20 NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative
21 NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow
22 NO_WSELF_ASSIGN= -Wno-self-assign
23 NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration
24 NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized
25 NO_WCAST_QUAL= -Wno-error=cast-qual
26 NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
28 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation
31 NO_WUNUSED_BUT_SET_VARIABLE= -Wno-unused-but-set-variable
34 NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical
37 NO_WSTRICT_PROTOTYPES= -Wno-strict-prototypes
38 NO_WDEPRECATED_NON_PROTOTYPE= -Wno-deprecated-non-prototype
43 CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \
44 -Wno-error=parentheses-equality -Wno-error=unused-function \
45 -Wno-error=pointer-sign
46 CWARNEXTRA+= -Wno-error=shift-negative-value
47 CWARNEXTRA+= -Wno-address-of-packed-member
51 # Catch-all for all the things that are in our tree, but for which we're
53 NO_WUNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
54 CWARNEXTRA?= -Wno-error=address \
55 -Wno-error=aggressive-loop-optimizations \
56 -Wno-error=array-bounds \
57 -Wno-error=attributes \
58 -Wno-error=cast-qual \
59 -Wno-error=enum-compare \
60 -Wno-error=maybe-uninitialized \
61 -Wno-error=misleading-indentation \
62 -Wno-error=nonnull-compare \
63 -Wno-error=overflow \
64 -Wno-error=sequence-point \
65 -Wno-error=shift-overflow \
66 -Wno-error=tautological-compare \
67 -Wno-error=unused-function
69 CWARNEXTRA+= -Wno-error=stringop-overflow
72 CWARNEXTRA+= -Wno-error=memset-elt-size
75 CWARNEXTRA+= -Wno-error=packed-not-aligned
78 CWARNEXTRA+= -Wno-address-of-packed-member \
79 -Wno-alloc-size-larger-than \
80 -Wno-error=alloca-larger-than=
82 CWARNEXTRA+= -Wno-error=nonnull \
83 -Wno-dangling-pointer \
84 -Wno-zero-length-bounds
85 NO_WINFINITE_RECURSION= -Wno-infinite-recursion
86 NO_WSTRINGOP_OVERREAD= -Wno-stringop-overread
92 CWARNFLAGS+= -Wno-return-type
96 CWARNFLAGS+= -Wno-format-zero-length
101 FORMAT_EXTENSIONS= -Wno-format
104 FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__
106 FORMAT_EXTENSIONS= -fformat-extensions
110 # On i386, do not align the stack to 16-byte boundaries. Otherwise GCC 2.95
112 # stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
113 # per function call. While the 16-byte alignment may benefit micro benchmarks,
121 # Setting -mno-mmx implies -mno-3dnow
122 # Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3
125 # Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa
126 # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
129 CFLAGS.gcc+= -mpreferred-stack-boundary=2
130 CFLAGS.clang+= -mno-aes -mno-avx
131 CFLAGS+= -mno-mmx -mno-sse -msoft-float
141 CFLAGS += -mgeneral-regs-only
143 CFLAGS += -ffixed-x18
145 CFLAGS += -mbranch-protection=standard
146 .if ${LINKER_FEATURES:Mbti-report}
147 LDFLAGS += -Wl,-zbti-report=error
150 CFLAGS += -mno-outline-atomics
155 # For RISC-V we specify the soft-float ABI (lp64) to avoid the use of floating
157 # in -march so we can have limited floating point support in context switching
158 # code. This is different than userland where we use a hard-float ABI (lp64d).
162 # anywhere in the 64-bit address space. Note that clang and GCC refer to this
166 CFLAGS+= -march=rv64imafdch
167 CFLAGS+= -mabi=lp64
168 CFLAGS.clang+= -mcmodel=medium
169 CFLAGS.gcc+= -mcmodel=medany
172 .if ${LINKER_FEATURES:Mriscv-relaxations} == ""
173 CFLAGS+= -mno-relax
183 # Setting -mno-mmx implies -mno-3dnow
184 # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387
187 # Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa
188 # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
189 # (-mfpmath= is not supported)
192 CFLAGS.clang+= -mno-aes -mno-avx
193 CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float \
194 -fno-asynchronous-unwind-tables
204 CFLAGS+= -mno-altivec -msoft-float
209 CFLAGS.gcc+= -mno-spe
218 CFLAGS+= -mabi=elfv2
225 CFLAGS+= -ffreestanding
233 CFLAGS+= -fwrapv
239 CFLAGS+= -fstack-protector
243 # Retpoline speculative execution vulnerability mitigation (CVE-2017-5715)
247 CFLAGS+= -mretpoline
254 SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
255 -fsanitize=kernel-address
257 SAN_CFLAGS+= -mllvm -asan-stack=true \
258 -mllvm -asan-instrument-dynamic-allocas=true \
259 -mllvm -asan-globals=true \
260 -mllvm -asan-use-after-scope=true \
261 -mllvm -asan-instrumentation-with-call-threshold=0 \
262 -mllvm -asan-instrument-byval=false
266 # KASAN/ARM64 TODO: -asan-mapping-offset is calculated from:
274 SAN_CFLAGS+= -mllvm -asan-mapping-offset=0xdfff208000000000
276 SAN_CFLAGS+= -fasan-shadow-offset=0xdfff208000000000
280 # Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
281 # an assertion failure compiling dtrace.c with asan enabled.
282 SAN_CFLAGS+= -mllvm -asan-use-stack-safety=0
290 SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kcsan \
291 -fsanitize=thread
298 # Disable -fno-sanitize-memory-param-retval until interceptors have been
300 MSAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \
301 -fsanitize=kernel-memory
303 MSAN_CFLAGS+= -fno-sanitize-memory-param-retval
312 SAN_CFLAGS+= -fsanitize=undefined
321 SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp
323 SAN_CFLAGS+= -fsanitize-coverage=trace-pc
334 .if ${COMPILER_FEATURES:Minit-all}
335 CFLAGS+= -ftrivial-auto-var-init=${OPT_INIT_ALL}
337 CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
348 .if (${CFLAGS:M-g} != "" || ${CFLAGS:M-g[0-3]} != "") && ${CFLAGS:M-gdwarf*} == ""
349 CFLAGS+= -gdwarf-4
357 # or expect to ever be up-to-date.
359 beforelinking build build-tools buildfiles buildincludes \
377 CFLAGS+= -std=${CSTD}
380 NOSAN_CFLAGS= ${CFLAGS:N-fsanitize*:N-fno-sanitize*:N-fasan-shadow-offset*}
384 # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld".
386 # Note: Clang does not like relative paths for ld so we map ld.lld -> lld.
388 CCLDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W}
390 CCLDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W}
393 # GCC does not support an absolute path for -fuse-ld so we just print this
395 # However, we can avoid this warning if -B is set appropriately (e.g. for
396 # CROSS_TOOLCHAIN=...-gcc).
397 .if !(${LD:[1]:T} == "ld" && ${CC:tw:M-B${LD:[1]:H}/})
398 .warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported
403 # Set target-specific linker emulation name.