File: kernel-flags.patch

package info (click to toggle)
nvidia-open-gpu-kernel-modules 555.58.02-2
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 89,204 kB
  • sloc: ansic: 1,149,014; cpp: 23,369; sh: 3,639; makefile: 607; python: 315
file content (40 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Author: Andreas Beckmann <anbe@debian.org>
Description: build with more kernel hardening flags
 fixes objtool warning "'naked' return found in MITIGATION_RETHUNK build"

--- a/src/nvidia-modeset/Makefile
+++ b/src/nvidia-modeset/Makefile
@@ -90,6 +90,7 @@ ifeq ($(TARGET_ARCH),x86_64)
   CFLAGS += -mno-sse
   CFLAGS += -mno-sse2
   CFLAGS += -mno-3dnow
+  CFLAGS += -mno-avx
 endif
 
 ifeq ($(TARGET_ARCH),aarch64)
@@ -144,6 +145,7 @@ ifeq ($(TARGET_ARCH),x86_64)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
 endif
 
 CFLAGS += $(CONDITIONAL_CFLAGS)
--- a/src/nvidia/Makefile
+++ b/src/nvidia/Makefile
@@ -85,6 +85,7 @@ ifeq ($(TARGET_ARCH),x86_64)
   CFLAGS += -mno-sse
   CFLAGS += -mno-sse2
   CFLAGS += -mno-3dnow
+  CFLAGS += -mno-avx
 endif
 
 ifeq ($(TARGET_ARCH),aarch64)
@@ -178,6 +179,7 @@ ifeq ($(TARGET_ARCH),x86_64)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
 endif
 
 CFLAGS += $(CONDITIONAL_CFLAGS)