libunwind: fix compile failures on 32-bit arm with Clang 16

(From OE-Core rev: 47a43ea98dc6cae67730866c47090900572ea6b0)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2023-03-27 12:53:38 +01:00
committed by Richard Purdie
parent 985f1b883f
commit 22286ed02d
2 changed files with 53 additions and 0 deletions

View File

@@ -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

View File

@@ -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"