diff mbox series

[v2,1/1] board/qemu/s390x: disable SSP when needed

Message ID 20210509130634.1105988-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [v2,1/1] board/qemu/s390x: disable SSP when needed | expand

Commit Message

Fabrice Fontaine May 9, 2021, 1:06 p.m. UTC
Fix build failure raised since commit
810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed

Fixes:
 - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Romain Naour):
 - Move patch from linux to board/qemu/s390x

 ...01-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++
 configs/qemu_s390x_defconfig                  |  1 +
 2 files changed, 48 insertions(+)
 create mode 100644 board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch

Comments

Romain Naour May 9, 2021, 9:22 p.m. UTC | #1
Hello Fabrice,

Le 09/05/2021 à 15:06, Fabrice Fontaine a écrit :
> Fix build failure raised since commit
> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
> 
> Fixes:
>  - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Reviewed-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain


> ---
> Changes v1 -> v2 (after review of Romain Naour):
>  - Move patch from linux to board/qemu/s390x
> 
>  ...01-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++
>  configs/qemu_s390x_defconfig                  |  1 +
>  2 files changed, 48 insertions(+)
>  create mode 100644 board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> 
> diff --git a/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> new file mode 100644
> index 0000000000..c8199d4fd6
> --- /dev/null
> +++ b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> @@ -0,0 +1,47 @@
> +From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 8 May 2021 22:03:11 +0200
> +Subject: [PATCH] arch/s390: disable SSP when needed
> +
> +Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
> +KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
> +avoid linking errors related to undefined references to
> +'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
> +-fstack-protector.
> +
> +Fixes:
> + - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + arch/s390/Makefile           | 1 +
> + arch/s390/purgatory/Makefile | 1 +
> + 2 files changed, 2 insertions(+)
> +
> +diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> +index e443ed9947bd..098abe3a56f3 100644
> +--- a/arch/s390/Makefile
> ++++ b/arch/s390/Makefile
> +@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
> + KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
> ++KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
> + KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
> +diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
> +index c57f8c40e992..21c4ebe29b9a 100644
> +--- a/arch/s390/purgatory/Makefile
> ++++ b/arch/s390/purgatory/Makefile
> +@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
> + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
> + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
> + KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
> ++KBUILD_CFLAGS += -fno-stack-protector
> + KBUILD_CFLAGS += $(CLANG_FLAGS)
> + KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
> + KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
> +-- 
> +2.30.2
> +
> diff --git a/configs/qemu_s390x_defconfig b/configs/qemu_s390x_defconfig
> index 9b3821f043..4aed9d9ae5 100644
> --- a/configs/qemu_s390x_defconfig
> +++ b/configs/qemu_s390x_defconfig
> @@ -20,6 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
>  BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>  BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches"
>  
>  # host-qemu for gitlab testing
>  BR2_PACKAGE_HOST_QEMU=y
>
Alexander Egorenkov May 15, 2021, 1:58 p.m. UTC | #2
Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

> Fix build failure raised since commit
> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
>
> Fixes:
>  - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2 (after review of Romain Naour):
>  - Move patch from linux to board/qemu/s390x
>
>  ...01-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++
>  configs/qemu_s390x_defconfig                  |  1 +
>  2 files changed, 48 insertions(+)
>  create mode 100644 board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
>
> diff --git a/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> new file mode 100644
> index 0000000000..c8199d4fd6
> --- /dev/null
> +++ b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> @@ -0,0 +1,47 @@
> +From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 8 May 2021 22:03:11 +0200
> +Subject: [PATCH] arch/s390: disable SSP when needed
> +
> +Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
> +KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
> +avoid linking errors related to undefined references to
> +'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
> +-fstack-protector.
> +
> +Fixes:
> + - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + arch/s390/Makefile           | 1 +
> + arch/s390/purgatory/Makefile | 1 +
> + 2 files changed, 2 insertions(+)
> +
> +diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> +index e443ed9947bd..098abe3a56f3 100644
> +--- a/arch/s390/Makefile
> ++++ b/arch/s390/Makefile
> +@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
> + KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
> ++KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
> + KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
> +diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
> +index c57f8c40e992..21c4ebe29b9a 100644
> +--- a/arch/s390/purgatory/Makefile
> ++++ b/arch/s390/purgatory/Makefile
> +@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
> + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
> + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
> + KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
> ++KBUILD_CFLAGS += -fno-stack-protector
> + KBUILD_CFLAGS += $(CLANG_FLAGS)
> + KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
> + KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
> +-- 
> +2.30.2
> +
> diff --git a/configs/qemu_s390x_defconfig b/configs/qemu_s390x_defconfig
> index 9b3821f043..4aed9d9ae5 100644
> --- a/configs/qemu_s390x_defconfig
> +++ b/configs/qemu_s390x_defconfig
> @@ -20,6 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
>  BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>  BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches"
>  
>  # host-qemu for gitlab testing
>  BR2_PACKAGE_HOST_QEMU=y
> -- 
> 2.30.2

Thank you for the fix. Looks good to me.

Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>

Regards
Alex
Yann E. MORIN May 15, 2021, 2:56 p.m. UTC | #3
Fabrice, All,

On 2021-05-09 15:06 +0200, Fabrice Fontaine spake thusly:
> Fix build failure raised since commit
> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
> 
> Fixes:
>  - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to master, thanks.

Alexander, is this something we can expect to land in mainline?

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v2 (after review of Romain Naour):
>  - Move patch from linux to board/qemu/s390x
> 
>  ...01-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++
>  configs/qemu_s390x_defconfig                  |  1 +
>  2 files changed, 48 insertions(+)
>  create mode 100644 board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> 
> diff --git a/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> new file mode 100644
> index 0000000000..c8199d4fd6
> --- /dev/null
> +++ b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
> @@ -0,0 +1,47 @@
> +From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 8 May 2021 22:03:11 +0200
> +Subject: [PATCH] arch/s390: disable SSP when needed
> +
> +Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
> +KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
> +avoid linking errors related to undefined references to
> +'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
> +-fstack-protector.
> +
> +Fixes:
> + - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + arch/s390/Makefile           | 1 +
> + arch/s390/purgatory/Makefile | 1 +
> + 2 files changed, 2 insertions(+)
> +
> +diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> +index e443ed9947bd..098abe3a56f3 100644
> +--- a/arch/s390/Makefile
> ++++ b/arch/s390/Makefile
> +@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
> + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
> + KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
> ++KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
> + KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
> + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
> +diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
> +index c57f8c40e992..21c4ebe29b9a 100644
> +--- a/arch/s390/purgatory/Makefile
> ++++ b/arch/s390/purgatory/Makefile
> +@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
> + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
> + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
> + KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
> ++KBUILD_CFLAGS += -fno-stack-protector
> + KBUILD_CFLAGS += $(CLANG_FLAGS)
> + KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
> + KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
> +-- 
> +2.30.2
> +
> diff --git a/configs/qemu_s390x_defconfig b/configs/qemu_s390x_defconfig
> index 9b3821f043..4aed9d9ae5 100644
> --- a/configs/qemu_s390x_defconfig
> +++ b/configs/qemu_s390x_defconfig
> @@ -20,6 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
>  BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>  BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches"
>  
>  # host-qemu for gitlab testing
>  BR2_PACKAGE_HOST_QEMU=y
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Alexander Egorenkov May 15, 2021, 3:03 p.m. UTC | #4
"Yann E. MORIN" <yann.morin.1998@free.fr> writes:

> Fabrice, All,
>
> On 2021-05-09 15:06 +0200, Fabrice Fontaine spake thusly:
>> Fix build failure raised since commit
>> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
>> 
>> Fixes:
>>  - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
>> 
>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
> Applied to master, thanks.
>
> Alexander, is this something we can expect to land in mainline?
>
> Regards,
> Yann E. MORIN.
>

Hi Yann,

yes, i'm already looking into it.

Regards
Alex
Fabrice Fontaine May 15, 2021, 3:09 p.m. UTC | #5
Hi Alex,

Le sam. 15 mai 2021 à 17:03, Alexander Egorenkov
<egorenar@linux.ibm.com> a écrit :
>
> "Yann E. MORIN" <yann.morin.1998@free.fr> writes:
>
> > Fabrice, All,
> >
> > On 2021-05-09 15:06 +0200, Fabrice Fontaine spake thusly:
> >> Fix build failure raised since commit
> >> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
> >>
> >> Fixes:
> >>  - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
> >>
> >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> >
> > Applied to master, thanks.
> >
> > Alexander, is this something we can expect to land in mainline?
> >
> > Regards,
> > Yann E. MORIN.
> >
>
> Hi Yann,
>
> yes, i'm already looking into it.
If it can helps, I sent the patch on the mailing list as suggested by
Romain: https://marc.info/?l=linux-s390&m=162062472219221&w=2
>
> Regards
> Alex
Best Regards,

Fabrice
Yann E. MORIN May 15, 2021, 3:15 p.m. UTC | #6
Alexander, Fabrice, All,

On 2021-05-15 17:09 +0200, Fabrice Fontaine spake thusly:
> Le sam. 15 mai 2021 à 17:03, Alexander Egorenkov
> <egorenar@linux.ibm.com> a écrit :
> > "Yann E. MORIN" <yann.morin.1998@free.fr> writes:
> > > On 2021-05-09 15:06 +0200, Fabrice Fontaine spake thusly:
> > >> Fix build failure raised since commit
> > >> 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed
> > > Alexander, is this something we can expect to land in mainline?
> > yes, i'm already looking into it.

Awesome; thanks! :-)

> If it can helps, I sent the patch on the mailing list as suggested by
> Romain: https://marc.info/?l=linux-s390&m=162062472219221&w=2

Awesome too; thanks too! :-)

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
new file mode 100644
index 0000000000..c8199d4fd6
--- /dev/null
+++ b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch
@@ -0,0 +1,47 @@ 
+From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 8 May 2021 22:03:11 +0200
+Subject: [PATCH] arch/s390: disable SSP when needed
+
+Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
+KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
+avoid linking errors related to undefined references to
+'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
+-fstack-protector.
+
+Fixes:
+ - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ arch/s390/Makefile           | 1 +
+ arch/s390/purgatory/Makefile | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/arch/s390/Makefile b/arch/s390/Makefile
+index e443ed9947bd..098abe3a56f3 100644
+--- a/arch/s390/Makefile
++++ b/arch/s390/Makefile
+@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
+ KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
+ KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
+ KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
++KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
+ KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
+ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
+ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
+diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
+index c57f8c40e992..21c4ebe29b9a 100644
+--- a/arch/s390/purgatory/Makefile
++++ b/arch/s390/purgatory/Makefile
+@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
+ KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
+ KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
+ KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
++KBUILD_CFLAGS += -fno-stack-protector
+ KBUILD_CFLAGS += $(CLANG_FLAGS)
+ KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+ KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
+-- 
+2.30.2
+
diff --git a/configs/qemu_s390x_defconfig b/configs/qemu_s390x_defconfig
index 9b3821f043..4aed9d9ae5 100644
--- a/configs/qemu_s390x_defconfig
+++ b/configs/qemu_s390x_defconfig
@@ -20,6 +20,7 @@  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
 BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches"
 
 # host-qemu for gitlab testing
 BR2_PACKAGE_HOST_QEMU=y