Skip to contentSkip to conversation

hafnium: Fix build when _Noreturn is not available

PATCH Applied Khem Raj 3 participants 4 messages Apr 21, 2022 – May 11, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 hafnium: Fix build when _Noreturn is not available

Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 .../0001-define-_Noreturn-if-needed.patch     | 33 +++++++++++++++++++
 meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch
meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch new file +33 -0
new file mode 100644
index 0000000..b73c533
@@ -0,0 +1,33 @@
+From 0d941ba32a082023575fd0d14d52a12b7547b367 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 19 Apr 2022 22:32:56 -0700
+Subject: [PATCH] define _Noreturn if needed
+
+The new _Noreturn function specifier is not recognized by the parser and shows as a syntax error:
+
+Fixes
+../git/inc/hf/panic.h:13:1: error: '_Noreturn' is a C11 extension [-Werror,-Wc11-extensions]
+noreturn void panic(const char *fmt, ...);
+^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ inc/hf/panic.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/inc/hf/panic.h b/inc/hf/panic.h
+index ec864e4f..588f1193 100644
+--- a/inc/hf/panic.h
++++ b/inc/hf/panic.h
+@@ -10,4 +10,8 @@
+ 
+ #include <stdnoreturn.h>
+ 
++#ifndef _Noreturn
++#define _Noreturn __attribute__ ((noreturn))
++#endif
++
+ noreturn void panic(const char *fmt, ...);
+-- 
+2.36.0
+
meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb +1 -0
index 96e455f..a9f41b9 100644
@@ -10,6 +10,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 inherit deploy python3native pkgconfig
 
 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 \
            file://native-dtc.patch"
Signature · 1 line
2.36.0
#1 lore raw

Missing Upstream-Status.

However, I'd prefer to understand what the actual problem is first, as this feels like a workaround not a fix.

Ross

Quoted 73 lines · Khem Raj
Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 .../0001-define-_Noreturn-if-needed.patch     | 33 +++++++++++++++++++
 meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch
meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch new file +33 -0
new file mode 100644
index 0000000..b73c533
@@ -0,0 +1,33 @@
+From 0d941ba32a082023575fd0d14d52a12b7547b367 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 19 Apr 2022 22:32:56 -0700
+Subject: [PATCH] define _Noreturn if needed
+
+The new _Noreturn function specifier is not recognized by the parser and shows as a syntax error:
+
+Fixes
+../git/inc/hf/panic.h:13:1: error: '_Noreturn' is a C11 extension [-Werror,-Wc11-extensions]
+noreturn void panic(const char *fmt, ...);
+^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ inc/hf/panic.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/inc/hf/panic.h b/inc/hf/panic.h
+index ec864e4f..588f1193 100644
+--- a/inc/hf/panic.h
++++ b/inc/hf/panic.h
+@@ -10,4 +10,8 @@
+
+ #include <stdnoreturn.h>
+
++#ifndef _Noreturn
++#define _Noreturn __attribute__ ((noreturn))
++#endif
++
+ noreturn void panic(const char *fmt, ...);
+--
+2.36.0
+
meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb +1 -1
index 96e455f..a9f41b9 100644
@@ -10,6 +10,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 inherit deploy python3native pkgconfig
 
 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 \
            file://native-dtc.patch"
--

2.36.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#3278): https://lists.yoctoproject.org/g/meta-arm/message/3278
Mute This Topic: https://lists.yoctoproject.org/mt/90578787/1676615
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw
Quoted 5 lines · Ross Burton

Missing Upstream-Status.

However, I'd prefer to understand what the actual problem is first, as this feels like a workaround not a fix.

ping, now that gcc12 is in master, it should be reproducible for you.

Quoted 77 lines

Ross

Quoted 73 lines · Khem Raj
Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 .../0001-define-_Noreturn-if-needed.patch     | 33 +++++++++++++++++++
 meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch
meta-arm/recipes-bsp/hafnium/hafnium/0001-define-_Noreturn-if-needed.patch new file +33 -0
new file mode 100644
index 0000000..b73c533
@@ -0,0 +1,33 @@
+From 0d941ba32a082023575fd0d14d52a12b7547b367 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 19 Apr 2022 22:32:56 -0700
+Subject: [PATCH] define _Noreturn if needed
+
+The new _Noreturn function specifier is not recognized by the parser and shows as a syntax error:
+
+Fixes
+../git/inc/hf/panic.h:13:1: error: '_Noreturn' is a C11 extension [-Werror,-Wc11-extensions]
+noreturn void panic(const char *fmt, ...);
+^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ inc/hf/panic.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/inc/hf/panic.h b/inc/hf/panic.h
+index ec864e4f..588f1193 100644
+--- a/inc/hf/panic.h
++++ b/inc/hf/panic.h
+@@ -10,4 +10,8 @@
+
+ #include <stdnoreturn.h>
+
++#ifndef _Noreturn
++#define _Noreturn __attribute__ ((noreturn))
++#endif
++
+ noreturn void panic(const char *fmt, ...);
+--
+2.36.0
+
meta-arm/recipes-bsp/hafnium/hafnium_2.6.bb +1 -1
index 96e455f..a9f41b9 100644
@@ -10,6 +10,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 inherit deploy python3native pkgconfig
 
 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 \
            file://native-dtc.patch"
--

2.36.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#3278): https://lists.yoctoproject.org/g/meta-arm/message/3278
Mute This Topic: https://lists.yoctoproject.org/mt/90578787/1676615
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Applied
#3 lore raw
In reply to Khem Raj
Quoted 1 line · Khem Raj

Applied, thanks!

[1/1] hafnium: Fix build when _Noreturn is not available

      commit: cb2eb8e3736be072735d35bb69f0e3be8432843c

Best regards,

Signature · 1 line
Jon Mason <[email protected]>