0001-powerpc-Fix-mcpu-options-for-SPE-only-compiler.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 44e3424424b447b00fbe1f10ddba81b55817e970 Mon Sep 17 00:00:00 2001
  2. From: Ben Hutchings <ben@decadent.org.uk>
  3. Date: Wed, 26 Dec 2018 00:00:40 +0000
  4. Subject: [PATCH] powerpc: Fix -mcpu= options for SPE-only compiler
  5. GCC for Debian's "powerpcspe" architecture only supports 32-bit
  6. SPE targets, and using -mcpu=powerpc or -mcpu=powerpc64 is a fatal
  7. error.
  8. * Change the test for a biarch compiler to pass both the -m32 and -m64
  9. options, so that it doesn't catch 32-bit-only compilers
  10. * Add an ifdef CONFIG_PPC64 around the 64-bit CPU option definitions
  11. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  12. [Romain: Patch from Debian repository:
  13. https://salsa.debian.org/kernel-team/linux/-/blob/buster/debian/patches/bugfix/powerpc/powerpc-fix-mcpu-options-for-spe-only-compiler.patch]
  14. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  15. ---
  16. arch/powerpc/Makefile | 4 +++-
  17. 1 file changed, 3 insertions(+), 1 deletion(-)
  18. diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
  19. index 37ac731a556b..5211ea4f48b1 100644
  20. --- a/arch/powerpc/Makefile
  21. +++ b/arch/powerpc/Makefile
  22. @@ -12,7 +12,7 @@
  23. # Rewritten by Cort Dougan and Paul Mackerras
  24. #
  25. -HAS_BIARCH := $(call cc-option-yn, -m32)
  26. +HAS_BIARCH := $(call cc-option-yn, -m32 -m64)
  27. # Set default 32 bits cross compilers for vdso and boot wrapper
  28. CROSS32_COMPILE ?=
  29. @@ -166,6 +166,7 @@ CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD))
  30. CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata)
  31. +ifdef CONFIG_PPC64
  32. ifdef CONFIG_PPC_BOOK3S_64
  33. ifdef CONFIG_CPU_LITTLE_ENDIAN
  34. CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8
  35. @@ -177,6 +178,7 @@ endif
  36. else
  37. CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
  38. endif
  39. +endif
  40. ifdef CONFIG_FUNCTION_TRACER
  41. CC_FLAGS_FTRACE := -pg
  42. --
  43. 2.25.4