summarylogtreecommitdiffstats
path: root/140-nvidia-open-gcc-ibt-sls.patch
blob: 7c70d26f557bc4ec87112542551faa7bce557906 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/src/nvidia-modeset/Makefile
+++ b/src/nvidia-modeset/Makefile
@@ -96,7 +96,8 @@ CFLAGS += -ffunction-sections
 CFLAGS += -fdata-sections
 CFLAGS += -ffreestanding
 
-CONDITIONAL_CFLAGS := $(call TEST_CC_ARG, -fcf-protection=none)
+CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch)
+CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
 CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -Wformat-overflow=2)
 CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -Wformat-truncation=1)
 ifeq ($(TARGET_ARCH),x86_64)
--- a/src/nvidia/Makefile
+++ b/src/nvidia/Makefile
@@ -120,7 +120,8 @@ CFLAGS += -fdata-sections
 NV_KERNEL_O_LDFLAGS += --gc-sections
 EXPORTS_LINK_COMMAND = exports_link_command.txt
 
-CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=none)
+CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch -mindirect-branch-register)
+CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
 
 ifeq ($(TARGET_ARCH),x86_64)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)