new file mode 100644
@@ -0,0 +1,100 @@
+From 1a84b72df8e749665733c3489f605264ccc63d73 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 22 Sep 2022 19:13:49 -0700
+Subject: [PATCH] Fix build with clang-15
+
+Clang-15 warns about prototypes a bit harder
+Remove unused variable suites_in_image
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/hftest/common.c | 2 --
+ test/vmapi/arch/aarch64/gicv3/gicv3.c | 2 +-
+ test/vmapi/arch/aarch64/gicv3/inc/gicv3.h | 2 +-
+ test/vmapi/arch/aarch64/gicv3/timer_secondary.c | 2 +-
+ test/vmapi/el0_partitions/services/interruptible.c | 2 +-
+ test/vmapi/el0_partitions/services/interruptible_echo.c | 2 +-
+ 6 files changed, 5 insertions(+), 7 deletions(-)
+
+--- a/test/hftest/common.c
++++ b/test/hftest/common.c
+@@ -67,7 +67,6 @@ void hftest_json(void)
+ {
+ const char *suite = NULL;
+ size_t i;
+- size_t suites_in_image = 0;
+ size_t tests_in_suite = 0;
+
+ HFTEST_LOG("{");
+@@ -81,7 +80,6 @@ void hftest_json(void)
+ HFTEST_LOG(" },");
+ }
+ /* Move onto new suite. */
+- ++suites_in_image;
+ suite = test->suite;
+ tests_in_suite = 0;
+ HFTEST_LOG(" {");
+--- a/test/vmapi/arch/aarch64/gicv3/gicv3.c
++++ b/test/vmapi/arch/aarch64/gicv3/gicv3.c
+@@ -42,7 +42,7 @@ static void irq(void)
+ dlog("primary IRQ %d ended\n", interrupt_id);
+ }
+
+-void system_setup()
++void system_setup(void)
+ {
+ const uint32_t mode = MM_MODE_R | MM_MODE_W | MM_MODE_D;
+ hftest_mm_identity_map((void *)GICD_BASE, PAGE_SIZE, mode);
+--- a/test/vmapi/arch/aarch64/gicv3/inc/gicv3.h
++++ b/test/vmapi/arch/aarch64/gicv3/inc/gicv3.h
+@@ -30,4 +30,4 @@ extern void *recv_buffer;
+
+ extern volatile uint32_t last_interrupt_id;
+
+-void system_setup();
++void system_setup(void);
+--- a/test/vmapi/arch/aarch64/gicv3/timer_secondary.c
++++ b/test/vmapi/arch/aarch64/gicv3/timer_secondary.c
+@@ -55,7 +55,7 @@ TEAR_DOWN(timer_secondary_ffa)
+ EXPECT_FFA_ERROR(ffa_rx_release(), FFA_DENIED);
+ }
+
+-static void timer_busywait_secondary()
++static void timer_busywait_secondary(void)
+ {
+ const char message[] = "loop 0099999";
+ const char expected_response[] = "Got IRQ 03.";
+--- a/test/vmapi/el0_partitions/services/interruptible.c
++++ b/test/vmapi/el0_partitions/services/interruptible.c
+@@ -43,7 +43,7 @@ static void irq(void)
+ * Try to receive a message from the mailbox, blocking if necessary, and
+ * retrying if interrupted.
+ */
+-static struct ffa_value mailbox_receive_retry()
++static struct ffa_value mailbox_receive_retry(void)
+ {
+ struct ffa_value received;
+
+--- a/test/vmapi/el0_partitions/services/interruptible_echo.c
++++ b/test/vmapi/el0_partitions/services/interruptible_echo.c
+@@ -32,7 +32,7 @@ static void irq(void)
+ * Try to receive a message from the mailbox, blocking if necessary, and
+ * retrying if interrupted.
+ */
+-static struct ffa_value mailbox_receive_retry()
++static struct ffa_value mailbox_receive_retry(void)
+ {
+ struct ffa_value received;
+
+--- a/test/vmapi/primary_with_secondaries/services/interruptible.c
++++ b/test/vmapi/primary_with_secondaries/services/interruptible.c
+@@ -40,7 +40,7 @@ static void irq(void)
+ * Try to receive a message from the mailbox, blocking if necessary, and
+ * retrying if interrupted.
+ */
+-struct ffa_value mailbox_receive_retry()
++struct ffa_value mailbox_receive_retry(void)
+ {
+ struct ffa_value received;
+
@@ -7,12 +7,17 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=782b40c14bad5294672c500501edc103"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-inherit deploy python3native pkgconfig
+
+CLANGNATIVE = ""
+CLANGNATIVE:runtime-llvm = "clang-native"
+
+inherit deploy python3native pkgconfig ${CLANGNATIVE}
SRC_URI = "gitsm://git.trustedfirmware.org/hafnium/hafnium.git;protocol=https;branch=master \
file://0001-define-_Noreturn-if-needed.patch \
file://host-ld.patch \
file://pkg-config-native.patch;patchdir=third_party/linux \
+ file://0001-Fix-build-with-clang-15.patch \
"
SRCREV = "79e9522d26fc2a88a44af149034acc27312b73a1"
S = "${WORKDIR}/git"
Signed-off-by: Khem Raj <raj.khem@gmail.com> --- .../0001-Fix-build-with-clang-15.patch | 100 ++++++++++++++++++ meta-arm/recipes-bsp/hafnium/hafnium_2.7.bb | 7 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 meta-arm/recipes-bsp/hafnium/hafnium/0001-Fix-build-with-clang-15.patch