File: makefile-make-compiler-version-comparison-optional.patch

package info (click to toggle)
linux 6.12.38-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-updates
  • size: 1,675,544 kB
  • sloc: ansic: 25,916,840; asm: 269,589; sh: 136,393; python: 65,219; makefile: 55,714; perl: 37,750; xml: 19,284; cpp: 5,894; yacc: 4,927; lex: 2,939; awk: 1,594; sed: 28; ruby: 25
file content (31 lines) | stat: -rw-r--r-- 1,419 bytes parent folder | download | duplicates (13)
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
From: Ben Hutchings <benh@debian.org>
Date: Thu, 15 Sep 2022 02:14:03 +0200
Subject: Makefile: Make compiler version comparison optional
Forwarded: not-needed
Bug-Debian: https://bugs.debian.org/1019749

The top-level Makefile warns if the compiler version string changes at
all between the kernel build and an out-of-tree module build.

We expect that major compiler version changes could introduce ABI
changes, and override the CC variable in out-of-tree module builds to
ensure that the same major compiler version is used.  But minor
version changes should not make a difference, so this exact version
comparison produces false warnings.

Since custom kernel packages don't have that, don't remove the version
comparison.  Instead, skip it if $(DEBIAN_KERNEL_NO_CC_VERSION_CHECK)
is non-empty.

---
--- a/Makefile
+++ b/Makefile
@@ -1753,7 +1753,7 @@ PHONY += prepare
 # now expand this into a simple variable to reduce the cost of shell evaluations
 prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
 prepare:
-	@if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \
+	@if [ -z "$(DEBIAN_KERNEL_NO_CC_VERSION_CHECK)" ] && [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \
 		echo >&2 "warning: the compiler differs from the one used to build the kernel"; \
 		echo >&2 "  The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \
 		echo >&2 "  You are using:           $(CC_VERSION_TEXT)"; \