[PATCH] kallsyms: fix build without execinfo

Achill Gilgenast posted 1 patch 8 months, 1 week ago
There is a newer version of this series
tools/include/linux/kallsyms.h | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] kallsyms: fix build without execinfo
Posted by Achill Gilgenast 8 months, 1 week ago
Signed-off-by: Achill Gilgenast <fossdd@pwned.life>
Cc: stable@vger.kernel.org
---
 tools/include/linux/kallsyms.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/include/linux/kallsyms.h b/tools/include/linux/kallsyms.h
index 5a37ccbec54f..f61a01dd7eb7 100644
--- a/tools/include/linux/kallsyms.h
+++ b/tools/include/linux/kallsyms.h
@@ -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
-- 
2.49.0
Re: [PATCH] kallsyms: fix build without execinfo
Posted by Greg KH 8 months, 1 week ago
On Sun, Jun 01, 2025 at 08:32:50PM +0200, Achill Gilgenast wrote:
> Signed-off-by: Achill Gilgenast <fossdd@pwned.life>
> Cc: stable@vger.kernel.org
> ---
>  tools/include/linux/kallsyms.h | 4 ++++
>  1 file changed, 4 insertions(+)

I know I can't take patches without any changelog text, but maybe other
maintainers are more lax.

good luck!

greg k-h
Re: [PATCH] kallsyms: fix build without execinfo
Posted by fossdd 7 months, 3 weeks ago
On Mon Jun 2, 2025 at 7:50 AM CEST, Greg KH wrote:
> On Sun, Jun 01, 2025 at 08:32:50PM +0200, Achill Gilgenast wrote:
>> Signed-off-by: Achill Gilgenast <fossdd@pwned.life>
>> Cc: stable@vger.kernel.org
>> ---
>>  tools/include/linux/kallsyms.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>
> I know I can't take patches without any changelog text, but maybe other
> maintainers are more lax.

Oh right. Added in v2:
https://lore.kernel.org/stable/20250615185821.824140-1-fossdd@pwned.life/

Thanks for the feedback.