mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
Makefile: Enable -Wcast-function-type
In order to make sure new function cast mismatches are not introduced in the kernel (to avoid tripping CFI checking), the kernel should be globally built with -Wcast-function-type. Link: https://github.com/KSPP/linux/issues/20 Co-developed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
This commit is contained in:
parent
fa55b7dcdc
commit
552a23a0e5
1 changed files with 5 additions and 0 deletions
5
Makefile
5
Makefile
|
@ -953,6 +953,11 @@ KBUILD_CFLAGS += -Wvla
|
|||
# disable pointer signed / unsigned warnings in gcc 4.0
|
||||
KBUILD_CFLAGS += -Wno-pointer-sign
|
||||
|
||||
# In order to make sure new function cast mismatches are not introduced
|
||||
# in the kernel (to avoid tripping CFI checking), the kernel should be
|
||||
# globally built with -Wcast-function-type.
|
||||
KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type)
|
||||
|
||||
# disable stringop warnings in gcc 8+
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue