summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-03-27 12:53:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-28 22:27:15 +0100
commit47a43ea98dc6cae67730866c47090900572ea6b0 (patch)
tree8078dcef67439ccdb9a2afdd3efc6743d2a9302c /meta/recipes-support
parent06df8350c3bc6f56013a0bff20b64cfdbb81cfca (diff)
downloadopenembedded-core-47a43ea98dc6cae67730866c47090900572ea6b0.tar.gz
libunwind: fix compile failures on 32-bit arm with Clang 16
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch52
-rw-r--r--meta/recipes-support/libunwind/libunwind_1.6.2.bb1
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch b/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch
new file mode 100644
index 0000000000..fdadcd3b25
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch
@@ -0,0 +1,52 @@
+From 87d24ee47fd0e0461fca32d17564f21d76cbcb92 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Fri, 24 Mar 2023 16:18:44 +0000
+Subject: [PATCH] src/Gtrace: remove unguarded print() calls
+
+There is a use of printf() without #include stdio.h in src/arm/Gtrace.c,
+which results in a compiler error if clang 16 is used:
+
+src/arm/Gtrace.c:529:7: error: call to undeclared library function
+'printf' with type 'int (const char *, ...)'; ISO C99 and later do not
+support implicit function declarations [-Wimplicit-function-declaration]
+
+Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in
+unless in a debug build, and reword the message to be clearer.
+
+Also there is another printf("XXX") inside a FreeBSD-specific block in
+the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code
+needs to be implemented.
+
+Fixes #482.
+
+Upstream-Status: Submitted [https://github.com/libunwind/libunwind/pull/483]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ src/arm/Gtrace.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/arm/Gtrace.c b/src/arm/Gtrace.c
+index 51fc281d..9e0f25af 100644
+--- a/src/arm/Gtrace.c
++++ b/src/arm/Gtrace.c
+@@ -514,7 +514,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
+ if (likely(ret >= 0))
+ ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_LR_OFF, lr);
+ #elif defined(__FreeBSD__)
+- printf("XXX\n");
++ #error implement UNW_ARM_FRAME_SIGRETURN on FreeBSD
+ #endif
+
+ /* Resume stack at signal restoration point. The stack is not
+@@ -526,7 +526,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
+ break;
+
+ case UNW_ARM_FRAME_SYSCALL:
+- printf("XXX1\n");
++ Dprintf ("%s: implement me\n", __FUNCTION__);
+ break;
+
+ default:
+--
+2.34.1
+
diff --git a/meta/recipes-support/libunwind/libunwind_1.6.2.bb b/meta/recipes-support/libunwind/libunwind_1.6.2.bb
index 716be9a452..d67862608c 100644
--- a/meta/recipes-support/libunwind/libunwind_1.6.2.bb
+++ b/meta/recipes-support/libunwind/libunwind_1.6.2.bb
@@ -5,6 +5,7 @@ SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV
file://0004-Fix-build-on-mips-musl.patch \
file://0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
file://0006-Fix-for-X32.patch \
+ file://0001-src-Gtrace-remove-unguarded-print-calls.patch \
"
SRC_URI:append:libc-musl = " file://musl-header-conflict.patch"