Skip to content

Commit ee05f7d

Browse files
committed
patches/powerpc-utils-1.3.5/0001-fix-rtas-function-pointer-signatures-gcc15.patch: function pointers need proper signatures to match their actual usage
modules/powerpc-utils contains docs traces in regard of gcc15 requirements Signed-off-by: Thierry Laurion <[email protected]>
1 parent ba7f8e7 commit ee05f7d

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

modules/powerpc-utils

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils
22

3+
# GCC_15_POWERPC_UTILS: Function pointer signature compatibility for GCC 15.1
4+
# powerpc-utils 1.3.5 uses generic void (*)() function pointers for RTAS calls
5+
# but passes functions with specific signatures. GCC 15.1 C23 standard compliance
6+
# rejects these implicit conversions as incompatible function pointer types.
7+
# Fixed via patches/powerpc-utils-1.3.5/0001-fix-rtas-function-pointer-signatures-gcc15.patch
8+
# - Converts void (*)() to properly typed function pointers:
9+
# * int (*)(int, int, ...) for variadic RTAS calls
10+
# * int (*)(int, int, int, int *, int *, int *) for specific RTAS calls
11+
# Critical for PowerPC hardware abstraction (RTAS runtime services).
12+
# Monitor upstream powerpc-utils for similar fixes that could replace this patch.
13+
314
powerpc-utils_version := 1.3.5
415
powerpc-utils_dir := powerpc-utils-$(powerpc-utils_version)
516
powerpc-utils_tar := powerpc-utils-$(powerpc-utils_version).tar.gz
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Fix function pointer declarations for GCC 15.1 C23 compatibility
2+
3+
GCC 15.1 with C23 standard is stricter about function pointer type
4+
mismatches. The RTAS event function pointers need proper signatures
5+
to match their actual usage.
6+
7+
diff --git a/src/nvram.c b/src/nvram.c
8+
index a7be3ee95c..74aade323b 100644
9+
--- a/src/nvram.c
10+
+++ b/src/nvram.c
11+
@@ -900,9 +900,9 @@ dump_rtas_event_entry(char *data, int len)
12+
{
13+
void *rtas_event;
14+
void *handle;
15+
- void *(*parse_rtas_event)();
16+
- void (*rtas_print_event)();
17+
- void (*cleanup_rtas_event)();
18+
+ void *(*parse_rtas_event)(char *, int);
19+
+ void (*rtas_print_event)(FILE *, void *, int);
20+
+ void (*cleanup_rtas_event)(void *);
21+
22+
handle = dlopen("/usr/lib/librtasevent.so", RTLD_LAZY);
23+
if (handle == NULL)

0 commit comments

Comments
 (0)