Fix s390x build without debugger (#6316)

* Fix s390x build without debugger

From: Andreas Schneider <asn@cryptomilk.org>
Date: Wed, 23 Apr 2026 11:35:00 +0200
Subject: [PATCH] Fix s390x link error when debugger is disabled

When the debugger is disabled (-Ddebugger=false), debug_native.c is not
compiled, so rz_debug_get_tls() and rz_debug_native_threads() are never
defined. However, linux_heap_glibc.c (part of librz_core) calls both
functions unconditionally, causing a link failure on s390x.

Add stub implementations in debug.c guarded by #if !DEBUGGER so the
symbols are always present in librz_debug regardless of the debugger
option.

* Fix formatting

---------

Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
This commit is contained in:
Michal Ambroz 2026-05-10 12:55:47 +02:00 committed by GitHub
parent fe524a30e8
commit d3a51fd7b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1800,3 +1800,14 @@ RZ_API RzDebugPid *rz_debug_get_thread(RzList /*<RzList *>*/ *th_list, int tid)
}
return (RzDebugPid *)rz_list_val(it);
}
#if !DEBUGGER
// Empty stubs are needed for compilation on s390x platform when debugger is disabled
RZ_API ut64 rz_debug_get_tls(RZ_NONNULL RzDebug *dbg, int tid) {
return 0;
}
RZ_API RZ_OWN RzList /*<RzDebugPid *>*/ *rz_debug_native_threads(RzDebug *dbg, int pid) {
return rz_list_new();
}
#endif