mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-16 12:06:08 +10:00
kallsyms: fix build without execinfo
commita95743b530
upstream. Some libc's like musl libc don't provide execinfo.h since it's not part of POSIX. In order to fix compilation on musl, only include execinfo.h if available (HAVE_BACKTRACE_SUPPORT) This was discovered withc104c16073
("Kunit to check the longest symbol length") which starts to include linux/kallsyms.h with Alpine Linux' configs. Link: https://lkml.kernel.org/r/20250622014608.448718-1-fossdd@pwned.life Fixes:c104c16073
("Kunit to check the longest symbol length") Signed-off-by: Achill Gilgenast <fossdd@pwned.life> Cc: Luis Henriques <luis@igalia.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8842fa503c
commit
7837fb8e97
@ -18,6 +18,7 @@ static inline const char *kallsyms_lookup(unsigned long addr,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BACKTRACE_SUPPORT
|
||||
#include <execinfo.h>
|
||||
#include <stdlib.h>
|
||||
static inline void print_ip_sym(const char *loglvl, unsigned long ip)
|
||||
@ -30,5 +31,8 @@ static inline void print_ip_sym(const char *loglvl, unsigned long ip)
|
||||
|
||||
free(name);
|
||||
}
|
||||
#else
|
||||
static inline void print_ip_sym(const char *loglvl, unsigned long ip) {}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user