linux-valve-jupiter: fix build with GCC 15
Signed-off-by: Jens Reidel <adrian@postmarketos.org> Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7440>
This commit is contained in:
parent
e3e4459e7a
commit
30f790e67e
3 changed files with 103 additions and 1 deletions
|
|
@ -0,0 +1,49 @@
|
|||
From ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7 Mon Sep 17 00:00:00 2001
|
||||
From: Nathan Chancellor <nathan@kernel.org>
|
||||
Date: Tue, 21 Jan 2025 18:11:33 -0700
|
||||
Subject: [PATCH] x86/boot: Use '-std=gnu11' to fix build with GCC 15
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
GCC 15 changed the default C standard version to C23, which should not
|
||||
have impacted the kernel because it requests the gnu11 standard via
|
||||
'-std=' in the main Makefile. However, the x86 compressed boot Makefile
|
||||
uses its own set of KBUILD_CFLAGS without a '-std=' value (i.e., using
|
||||
the default), resulting in errors from the kernel's definitions of bool,
|
||||
true, and false in stddef.h, which are reserved keywords under C23.
|
||||
|
||||
./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
|
||||
11 | false = 0,
|
||||
./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
|
||||
35 | typedef _Bool bool;
|
||||
|
||||
Set '-std=gnu11' in the x86 compressed boot Makefile to resolve the
|
||||
error and consistently use the same C standard version for the entire
|
||||
kernel.
|
||||
|
||||
Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
|
||||
Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
|
||||
Reported-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com>
|
||||
Reported-by: Jakub Jelinek <jakub@redhat.com>
|
||||
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
|
||||
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
|
||||
Cc:stable@vger.kernel.org
|
||||
Link: https://lore.kernel.org/all/20250121-x86-use-std-consistently-gcc-15-v1-1-8ab0acf645cb%40kernel.org
|
||||
---
|
||||
arch/x86/boot/compressed/Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
|
||||
index f2051644de9432..606c74f274593e 100644
|
||||
--- a/arch/x86/boot/compressed/Makefile
|
||||
+++ b/arch/x86/boot/compressed/Makefile
|
||||
@@ -25,6 +25,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
|
||||
# avoid errors with '-march=i386', and future flags may depend on the target to
|
||||
# be valid.
|
||||
KBUILD_CFLAGS := -m$(BITS) -O2 $(CLANG_FLAGS)
|
||||
+KBUILD_CFLAGS += -std=gnu11
|
||||
KBUILD_CFLAGS += -fno-strict-aliasing -fPIE
|
||||
KBUILD_CFLAGS += -Wundef
|
||||
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
From 8ba14d9f490aef9fd535c04e9e62e1169eb7a055 Mon Sep 17 00:00:00 2001
|
||||
From: Nathan Chancellor <nathan@kernel.org>
|
||||
Date: Tue, 21 Jan 2025 18:11:34 -0700
|
||||
Subject: [PATCH] efi: libstub: Use '-std=gnu11' to fix build with GCC 15
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
GCC 15 changed the default C standard version to C23, which should not
|
||||
have impacted the kernel because it requests the gnu11 standard via
|
||||
'-std=' in the main Makefile. However, the EFI libstub Makefile uses its
|
||||
own set of KBUILD_CFLAGS for x86 without a '-std=' value (i.e., using
|
||||
the default), resulting in errors from the kernel's definitions of bool,
|
||||
true, and false in stddef.h, which are reserved keywords under C23.
|
||||
|
||||
./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
|
||||
11 | false = 0,
|
||||
./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
|
||||
35 | typedef _Bool bool;
|
||||
|
||||
Set '-std=gnu11' in the x86 cflags to resolve the error and consistently
|
||||
use the same C standard version for the entire kernel. All other
|
||||
architectures reuse KBUILD_CFLAGS from the rest of the kernel, so this
|
||||
issue is not visible for them.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Reported-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com>
|
||||
Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
|
||||
Reported-by: Jakub Jelinek <jakub@redhat.com>
|
||||
Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
|
||||
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
||||
---
|
||||
drivers/firmware/efi/libstub/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
|
||||
index ed4e8ddbe76a50..1141cd06011ff4 100644
|
||||
--- a/drivers/firmware/efi/libstub/Makefile
|
||||
+++ b/drivers/firmware/efi/libstub/Makefile
|
||||
@@ -11,7 +11,7 @@ cflags-y := $(KBUILD_CFLAGS)
|
||||
|
||||
cflags-$(CONFIG_X86_32) := -march=i386
|
||||
cflags-$(CONFIG_X86_64) := -mcmodel=small
|
||||
-cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
|
||||
+cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -std=gnu11 \
|
||||
-fPIC -fno-strict-aliasing -mno-red-zone \
|
||||
-mno-mmx -mno-sse -fshort-wchar \
|
||||
-Wno-pointer-sign \
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Maintainer: Clayton Craft <clayton@craftyguy.net>
|
||||
pkgname=linux-valve-jupiter
|
||||
pkgver=6.13
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Valve Steam Deck kernel fork"
|
||||
arch="x86_64"
|
||||
_flavor="valve-jupiter"
|
||||
|
|
@ -58,6 +58,8 @@ source="
|
|||
0019-usb-dwc3-Fix-linux-extcon-name.patch
|
||||
0020-pinctrl-amd-Add-quirk-to-timeout-irq-pin-reconfigura.patch
|
||||
0021-mmc-core-add-safe_trim_quirk-attribute.patch
|
||||
0022-x86-boot-Use-std-gnu11-to-fix-build.patch
|
||||
0023-efi-libstub-Use-std-gnu11-to-fix-build.patch
|
||||
"
|
||||
builddir="$srcdir/linux-${_kernver//_/-}"
|
||||
|
||||
|
|
@ -109,4 +111,6 @@ c8367ceeb6df3c1e16adc437d9391b1ebbda3226d56e3024d7d88efc1607d69c2e1920893da8cf99
|
|||
f35bec00711a5ed0328f2f55123cf1423dfe99fc3cfae38cc2963bf282f7b9150c0a6ff9903cba084b23a1ada0ca3f649e248a0564392fd7bf732e37f0c5e417 0019-usb-dwc3-Fix-linux-extcon-name.patch
|
||||
d2f8604f6ac7570639d6b59d0cb4f82adf75fd717233199dead881de8e5d485777a832f1f13b28bdadac318b00c89c221bbf8e252207df35b6e9b6579fa1ece3 0020-pinctrl-amd-Add-quirk-to-timeout-irq-pin-reconfigura.patch
|
||||
d32dd802487c9fefa7a822946289d069f867eb4ce5e3c11805f1c8b6285b4f9062555d0ce33fb4311633a52390e4adeee56e3e69da29bc4868935e3641a54558 0021-mmc-core-add-safe_trim_quirk-attribute.patch
|
||||
399083930ce457481cd229ca2fe3bb92c62bf9f76e6a2c1325e8af252f55b3908a129c3971593ecccc6e7248b96339310dff370c74be3fc06675c2805ed47e73 0022-x86-boot-Use-std-gnu11-to-fix-build.patch
|
||||
b1679d49fa914f70f82ab40ce7cfb6ccd8a5515e72a644320d128def8683a2d034baa84cae3fecf1971a227dcac087521d7e877be17f37956c1aaa8ceab0c3f4 0023-efi-libstub-Use-std-gnu11-to-fix-build.patch
|
||||
"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue