0001-arch-s390-disable-SSP-when-needed.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 8 May 2021 22:03:11 +0200
  4. Subject: [PATCH] arch/s390: disable SSP when needed
  5. Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
  6. KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
  7. avoid linking errors related to undefined references to
  8. '__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
  9. -fstack-protector.
  10. Fixes:
  11. - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. ---
  14. arch/s390/Makefile | 1 +
  15. arch/s390/purgatory/Makefile | 1 +
  16. 2 files changed, 2 insertions(+)
  17. diff --git a/arch/s390/Makefile b/arch/s390/Makefile
  18. index e443ed9947bd..098abe3a56f3 100644
  19. --- a/arch/s390/Makefile
  20. +++ b/arch/s390/Makefile
  21. @@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
  22. KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
  23. KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
  24. KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
  25. +KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
  26. KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
  27. KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
  28. KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
  29. diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
  30. index c57f8c40e992..21c4ebe29b9a 100644
  31. --- a/arch/s390/purgatory/Makefile
  32. +++ b/arch/s390/purgatory/Makefile
  33. @@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
  34. KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
  35. KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
  36. KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
  37. +KBUILD_CFLAGS += -fno-stack-protector
  38. KBUILD_CFLAGS += $(CLANG_FLAGS)
  39. KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
  40. KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
  41. --
  42. 2.30.2