buildroot/board/technexion/imx8mmpico/patches/arm-trusted-firmware/0001-fix-build-allow-lower-...

63 lines
2.3 KiB
Diff

From 078cbf942c86d77775a26d83fc87ca244de02d4c Mon Sep 17 00:00:00 2001
From: Govindraj Raja <govindraj.raja@arm.com>
Date: Fri, 5 May 2023 09:09:36 -0500
Subject: [PATCH] fix(build): allow lower address access with gcc-12
With gcc-12 any lower address access can trigger a warning/error
this would be useful in other parts of system but in TF-A
there are various reasons to access to the lower address ranges,
example using mmio_read_*/writes_*
So setup to allow access to lower addresses while using gcc-12
Change-Id: Id1b4012b13bc6876d83b90a347fee12478a1921d
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/dea23e245fb890c6c06eff7d1aed8fffa981fc05
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
Makefile | 4 ++++
make_helpers/build_macros.mk | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/Makefile b/Makefile
index dccf0121d..edd7f5886 100644
--- a/Makefile
+++ b/Makefile
@@ -385,6 +385,10 @@ ifeq ($(findstring clang,$(notdir $(CC))),)
WARNINGS += -Wunused-but-set-variable -Wmaybe-uninitialized \
-Wpacked-bitfield-compat -Wshift-overflow=2 \
-Wlogical-op
+
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
+TF_CFLAGS += $(call cc_option, --param=min-pagesize=0)
+
else
# using clang
WARNINGS += -Wshift-overflow -Wshift-sign-overflow \
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 12aaee684..3a54bf67c 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -86,6 +86,18 @@ define assert_numerics
$(foreach num,$1,$(eval $(call assert_numeric,$(num))))
endef
+# Convenience function to check for a given linker option. An call to
+# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
+define ld_option
+ $(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi )
+endef
+
+# Convenience function to check for a given compiler option. A call to
+# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler
+define cc_option
+ $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1; then echo $(1); fi )
+endef
+
# CREATE_SEQ is a recursive function to create sequence of numbers from 1 to
# $(2) and assign the sequence to $(1)
define CREATE_SEQ
--
2.41.0