File: u-boot-sam460ex-gcc.patch

package info (click to toggle)
qemu 1%3A10.2.0~rc1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 394,528 kB
  • sloc: ansic: 4,571,775; pascal: 114,931; python: 110,734; sh: 53,524; asm: 50,205; makefile: 26,349; perl: 17,092; cpp: 11,455; xml: 3,635; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; sed: 35; awk: 8; javascript: 7
file content (32 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download
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
From: Michael Tokarev <mjt@tls.msk.ru>
Subject: u-boot-sam460ex: remove compiler-gccN.h #include
Date: Wed, 19 Nov 2025 23:30:38 +0300

include/linux/compiler*.h are taken from old linux, and
only supports gcc4.  However, the gcc-version-dependent
definitions in there aren't actually used in the code,
except of uninitialized_var macro - which is defined in
the fallback case to the same value.  So there's no
point in including the gcc-version-specific header,
which fails when building this code with a more recent
version of gcc.

This patch removes just the #include statement
(and the helper definitions), but not compiler-gcc4.h
header itself.  This makes the change small, and allows
compilation of u-boot-sam460ex code by something more
recent than ancient gcc.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/roms/u-boot-sam460ex/include/linux/compiler-gcc.h b/roms/u-boot-sam460ex/include/linux/compiler-gcc.h
--- a/roms/u-boot-sam460ex/include/linux/compiler-gcc.h
+++ b/roms/u-boot-sam460ex/include/linux/compiler-gcc.h
@@ -81,7 +81,2 @@
 #define __maybe_unused			__attribute__((unused))
 #define __always_unused			__attribute__((unused))
-
-#define __gcc_header(x) #x
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
-#define gcc_header(x) _gcc_header(x)
-#include gcc_header(__GNUC__)