* [RESEND PATCH v2] kallsyms: fix build without execinfo
@ 2025-06-22 1:45 Achill Gilgenast
2025-06-22 18:36 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Achill Gilgenast @ 2025-06-22 1:45 UTC (permalink / raw)
To: Greg Kroah-Hartman, Linus Torvalds, Shuah Khan, Andrew Morton
Cc: linux-kselftest, linux-kernel, Achill Gilgenast, stable
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 with c104c16073b7 ("Kunit to check the longest symbol length")
which starts to include linux/kallsyms.h with Alpine Linux' configs.
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.50.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [RESEND PATCH v2] kallsyms: fix build without execinfo
2025-06-22 1:45 [RESEND PATCH v2] kallsyms: fix build without execinfo Achill Gilgenast
@ 2025-06-22 18:36 ` Andrew Morton
2025-06-23 11:53 ` Achill Gilgenast
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2025-06-22 18:36 UTC (permalink / raw)
To: Achill Gilgenast
Cc: Greg Kroah-Hartman, Linus Torvalds, Shuah Khan, linux-kselftest,
linux-kernel, stable
On Sun, 22 Jun 2025 03:45:49 +0200 Achill Gilgenast <fossdd@pwned.life> wrote:
> 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 with c104c16073b7 ("Kunit to check the longest symbol length")
> which starts to include linux/kallsyms.h with Alpine Linux' configs.
>
> ...
>
> --- 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)
I'm not seeing anything in there which needs execinfo.h. Can we simply
remove the inclusion?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RESEND PATCH v2] kallsyms: fix build without execinfo
2025-06-22 18:36 ` Andrew Morton
@ 2025-06-23 11:53 ` Achill Gilgenast
2025-07-01 11:37 ` Achill Gilgenast
0 siblings, 1 reply; 6+ messages in thread
From: Achill Gilgenast @ 2025-06-23 11:53 UTC (permalink / raw)
To: Andrew Morton
Cc: Greg Kroah-Hartman, Linus Torvalds, Shuah Khan, linux-kselftest,
linux-kernel, stable
On Sun Jun 22, 2025 at 8:36 PM CEST, Andrew Morton wrote:
> On Sun, 22 Jun 2025 03:45:49 +0200 Achill Gilgenast <fossdd@pwned.life> wrote:
>
>> 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 with c104c16073b7 ("Kunit to check the longest symbol length")
>> which starts to include linux/kallsyms.h with Alpine Linux' configs.
>>
>> ...
>>
>> --- 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)
>
> I'm not seeing anything in there which needs execinfo.h. Can we simply
> remove the inclusion?
No, since backtrace_symbols is provided by execinfo.h.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RESEND PATCH v2] kallsyms: fix build without execinfo
2025-06-23 11:53 ` Achill Gilgenast
@ 2025-07-01 11:37 ` Achill Gilgenast
2025-07-01 16:19 ` Luis Henriques
0 siblings, 1 reply; 6+ messages in thread
From: Achill Gilgenast @ 2025-07-01 11:37 UTC (permalink / raw)
To: Andrew Morton
Cc: Greg Kroah-Hartman, Linus Torvalds, Shuah Khan, linux-kselftest,
linux-kernel, stable, Achill Gilgenast
On Mon Jun 23, 2025 at 1:53 PM CEST, Achill Gilgenast wrote:
> On Sun Jun 22, 2025 at 8:36 PM CEST, Andrew Morton wrote:
>> On Sun, 22 Jun 2025 03:45:49 +0200 Achill Gilgenast <fossdd@pwned.life> wrote:
>>
>>> 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 with c104c16073b7 ("Kunit to check the longest symbol length")
>>> which starts to include linux/kallsyms.h with Alpine Linux' configs.
>>>
>>> ...
>>>
>>> --- 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)
>>
>> I'm not seeing anything in there which needs execinfo.h. Can we simply
>> remove the inclusion?
>
> No, since backtrace_symbols is provided by execinfo.h.
Is there some status on it? I saw you picked it in mm-hotfixes-unstable,
but it got dropped out again.
Is there something I can do to push it?
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RESEND PATCH v2] kallsyms: fix build without execinfo
2025-07-01 11:37 ` Achill Gilgenast
@ 2025-07-01 16:19 ` Luis Henriques
2025-07-01 19:09 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Luis Henriques @ 2025-07-01 16:19 UTC (permalink / raw)
To: Achill Gilgenast
Cc: Andrew Morton, Greg Kroah-Hartman, Linus Torvalds, Shuah Khan,
linux-kselftest, linux-kernel, stable
On Tue, Jul 01 2025, Achill Gilgenast wrote:
> On Mon Jun 23, 2025 at 1:53 PM CEST, Achill Gilgenast wrote:
>> On Sun Jun 22, 2025 at 8:36 PM CEST, Andrew Morton wrote:
>>> On Sun, 22 Jun 2025 03:45:49 +0200 Achill Gilgenast <fossdd@pwned.life> wrote:
>>>
>>>> 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 with c104c16073b7 ("Kunit to check the longest symbol length")
>>>> which starts to include linux/kallsyms.h with Alpine Linux' configs.
>>>>
>>>> ...
>>>>
>>>> --- 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)
>>>
>>> I'm not seeing anything in there which needs execinfo.h. Can we simply
>>> remove the inclusion?
>>
>> No, since backtrace_symbols is provided by execinfo.h.
>
> Is there some status on it? I saw you picked it in mm-hotfixes-unstable,
> but it got dropped out again.
>
> Is there something I can do to push it?
FWIW I can confirm this is indeed a regression. And specially annoying
because it has been backported into stable kernels (even if having kunit
tests backported sounds odd to me).
It would be great to have this fixed, or reverted.
Cheers,
--
Luís
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RESEND PATCH v2] kallsyms: fix build without execinfo
2025-07-01 16:19 ` Luis Henriques
@ 2025-07-01 19:09 ` Andrew Morton
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2025-07-01 19:09 UTC (permalink / raw)
To: Luis Henriques
Cc: Achill Gilgenast, Greg Kroah-Hartman, Linus Torvalds, Shuah Khan,
linux-kselftest, linux-kernel, stable
On Tue, 01 Jul 2025 17:19:51 +0100 Luis Henriques <luis@igalia.com> wrote:
> >> No, since backtrace_symbols is provided by execinfo.h.
> >
> > Is there some status on it? I saw you picked it in mm-hotfixes-unstable,
> > but it got dropped out again.
> >
> > Is there something I can do to push it?
>
> FWIW I can confirm this is indeed a regression. And specially annoying
> because it has been backported into stable kernels (even if having kunit
> tests backported sounds odd to me).
>
> It would be great to have this fixed, or reverted.
OK, thanks for the reminder, I restored this.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-07-01 19:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-22 1:45 [RESEND PATCH v2] kallsyms: fix build without execinfo Achill Gilgenast
2025-06-22 18:36 ` Andrew Morton
2025-06-23 11:53 ` Achill Gilgenast
2025-07-01 11:37 ` Achill Gilgenast
2025-07-01 16:19 ` Luis Henriques
2025-07-01 19:09 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox