summaryrefslogtreecommitdiff
path: root/scripts/package-build/linux-kernel/patches/intel-qat/0003-qat-kbuild-map-extra_cflags-to-ccflags-y.patch
blob: acdd0c68b74d18fbeb76280d54d704a45e3096a6 (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
25
26
From: Christian Breunig <christian@breunig.cc>
Subject: [PATCH] qat: map EXTRA_CFLAGS into ccflags-y for Linux 6.x kbuild

Linux kbuild no longer applies EXTRA_CFLAGS for out-of-tree module builds the
way older kernels did. Intel QAT's build system still funnels include paths and
defines through EXTRA_CFLAGS (via env_files/linux_2.6_kernel_space.mk), which
results in missing vendor headers (qae_mem.h, Osal.h, etc.) when building
against newer kernels.

Mirror EXTRA_CFLAGS into ccflags-y after including OS-specific rules so the
flags reach the compiler.

--- a/quickassist/build_system/build_files/rules.mk
+++ b/quickassist/build_system/build_files/rules.mk
@@ -121,3 +121,11 @@
 
 #include specific rules according to $(PROG_ACY)_OS and $(PROG_ACY)_OS_LEVEL
 include $($(PROG_ACY)_BUILDSYSTEM_PATH)/build_files/OS/$($(PROG_ACY)_OS)_$($(PROG_ACY)_OS_LEVEL)_rules.mk
+
+# Linux kbuild (v6.x+) no longer honors EXTRA_CFLAGS for out-of-tree modules.
+# Intel QAT historically routes include paths and defines through EXTRA_CFLAGS via
+# env_files/linux_2.6_kernel_space.mk. Mirror those flags into ccflags-y so they
+# actually reach the compiler when invoking the kernel build system.
+ifdef KERNELRELEASE
+ccflags-y += $(EXTRA_CFLAGS)
+endif