0001-Allow-access-to-low-addresses-with-gcc-12.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 4796a1eacc6a5ccb623e7d2e46a5196f8335e496 Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Fri, 11 Aug 2023 11:19:49 +0300
  4. Subject: [PATCH] Allow access to low addresses with gcc 12
  5. gcc 12 added a warning that triggers on access to low addresses. Add a
  6. compile option that allows access to lower addresses.
  7. Add the 'cc_option' macro to avoid the compile option when the compiler
  8. does not support it.
  9. This fixes build with TF-A. TF-A added a similar fix in commit
  10. dea23e245fb89.
  11. See some more details in
  12. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
  13. Upstream: https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/42
  14. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  15. ---
  16. Makefile | 5 +++++
  17. 1 file changed, 5 insertions(+)
  18. diff --git a/Makefile b/Makefile
  19. index 3f0dd89a7381..045284c30cbc 100644
  20. --- a/Makefile
  21. +++ b/Makefile
  22. @@ -108,6 +108,10 @@ MV_DDR_VER_CSRC = mv_ddr_build_message.c
  23. # create mv_ddr build message and version string source file
  24. $(shell $(MV_DDR_ROOT)/scripts/localversion.sh $(MV_DDR_ROOT) $(MV_DDR_VER_CSRC) 2> /dev/null)
  25. +define cc_option
  26. + $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1; then echo $(1); fi )
  27. +endef
  28. +
  29. # ******************
  30. # U-BOOT SPL SUPPORT
  31. # ******************
  32. @@ -331,6 +335,7 @@ OBJ_DIR ?= $(MV_DDR_ROOT)
  33. CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
  34. CFLAGS += -Wall -Werror -Os -ffreestanding -mlittle-endian -g -gdwarf-2 -nostdinc
  35. CFLAGS += -march=armv8-a -fpie
  36. +CFLAGS += $(call cc_option, --param=min-pagesize=0)
  37. # PLATFORM is set in ble/ble.mk
  38. ifneq ($(findstring a80x0,$(PLATFORM)),)
  39. --
  40. 2.40.1