Skip to contentSkip to conversation

v6.12.35: (build) kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory

REGRESSION Natanael Copa 4 participants 8 messages Jul 1, 2025 – Jul 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Thanks!

-nc

#1 lore raw
Quoted 50 lines · Natanael Copa

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

Quoted 5 lines

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Please get the fix in Linus's tree first and then we can backport it as needed.

thanks,

greg k-h

#5 lore raw
In reply to Natanael Copa

Hello,

Thanks for pointing that out. I was not aware of it.

Quoted 60 lines · Natanael Copa

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Thanks!

-nc

#6 lore raw
Quoted 1 line · On Tue, 1 Jul 2025 19:07:32 +0200 Sergio González Collado…

Hello,

Hi Sergio,

Quoted 1 line

Thanks for pointing that out. I was not aware of it.

No worries. It happens. Just slightly unfortunate that it tickled down to stable branches before it got fixed.

It is trivial to fix but I wonder what is the best way though. Achill proposed to use #ifdef HAVE_BACKTRACE_SUPPORT in tools/include/linux/kallsyms.h but it appears that this was included only for KSYM_NAME_LEN.

KSYM_NAME_LEN appears to be defined multiple places:

$ rg 'KSYM_NAME_LEN\s+512'
include/linux/kallsyms.h
18:#define KSYM_NAME_LEN 512

tools/include/linux/kallsyms.h
9:#define KSYM_NAME_LEN 512

tools/lib/perf/include/perf/event.h
107:#define KSYM_NAME_LEN 512

tools/lib/symbol/kallsyms.h
10:#define KSYM_NAME_LEN 512

scripts/kallsyms.c
34:#define KSYM_NAME_LEN 512

So I wonder if it would be acceptable to simply:

arch/x86/tools/insn_decoder_test.c +1 -1
index 08cd913cbd4e..7916bf487ed2 100644
@@ -10,7 +10,6 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
-#include <linux/kallsyms.h>
 
 #include <asm/insn.h>
 #include <inat.c>
@@ -105,6 +104,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
+#define KSYM_NAME_LEN 512
 #define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)

I am also confused with who should be in the CC list.

Thanks!
-nc

Quoted 61 lines · Natanael Copa
Quoted 60 lines

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h> 
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Thanks!

-nc

#7 lore raw
Quoted 9 lines · Natanael Copa
Quoted 1 line · On Tue, 1 Jul 2025 19:07:32 +0200 Sergio González Collado…

Hello,

Hi Sergio,

Quoted 1 line

Thanks for pointing that out. I was not aware of it.

Quoted 7 lines

No worries. It happens. Just slightly unfortunate that it tickled down to stable branches before it got fixed.

It is trivial to fix but I wonder what is the best way though. Achill proposed to use #ifdef HAVE_BACKTRACE_SUPPORT in tools/include/linux/kallsyms.h but it appears that this was included only for KSYM_NAME_LEN.

This would still not resolve the actual issue that execinfo.h is included if built without backtrace support and kallsyms.h gets included.

#ifdef HAVE_BACKTRACE_SUPPORT can be seen in other places in tools/, where it is used exactly like I did in
https://lore.kernel.org/stable/[email protected]/.

#2 lore raw
In reply to Greg Kroah-Hartman
Quoted 51 lines · Greg Kroah-Hartman
Quoted 50 lines · Natanael Copa

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

Quoted 8 lines
Quoted 5 lines

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Please get the fix in Linus's tree first and then we can backport it as needed.

The patch now landed in Linus's tree as a95743b53031 ("kallsyms: fix build without execinfo"). Please backport it into the stable trees.

#3 lore raw
Quoted 55 lines · Achill Gilgenast
Quoted 54 lines · Greg Kroah-Hartman
Quoted 53 lines · Natanael Copa

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Please get the fix in Linus's tree first and then we can backport it as needed.

The patch now landed in Linus's tree as a95743b53031 ("kallsyms: fix build without execinfo"). Please backport it into the stable trees.

Already all queued up!

Thanks for letting us know.

greg k-h

#4 lore raw
Quoted 62 lines · Greg Kroah-Hartman
Quoted 61 lines · Achill Gilgenast
Quoted 59 lines · Greg Kroah-Hartman
Quoted 50 lines · Natanael Copa

Hi!

I bumped into a build regression when building Alpine Linux kernel 6.12.35 on x86_64:

In file included from ../arch/x86/tools/insn_decoder_test.c:13:
../tools/include/linux/kallsyms.h:21:10: fatal error: execinfo.h: No such file or directory
21 | #include <execinfo.h>

      |          ^~~~~~~~~~~~

compilation terminated.

The 6.12.34 kernel built just fine.

I bisected it to:

commit b8abcba6e4aec53868dfe44f97270fc4dee0df2a (HEAD)

Author: Sergio Gonz_lez Collado <[email protected]>
Date:   Sun Mar 2 23:15:18 2025 +0100

Kunit to check the longest symbol length

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f upstream.

which has this hunk:

arch/x86/tools/insn_decoder_test.c +2 -1
index 472540aeabc2..6c2986d2ad11 100644
@@ -10,6 +10,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <linux/kallsyms.h>
 
 #define unlikely(cond) (cond)
 
@@ -106,7 +107,7 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-#define BUFSIZE 256
+#define BUFSIZE (256 + KSYM_NAME_LEN)
 
 int main(int argc, char **argv)
 {

It looks like the linux/kallsyms.h was included to get KSYM_NAME_LEN. Unfortunately it also introduced the include of execinfo.h, which does not exist on musl libc.

Quoted 5 lines

This has previously been reported to and tried fixed:
https://lore.kernel.org/stable/[email protected]/T/#t

Would it be an idea to revert commit b8abcba6e4ae til we have a proper solution for this?

Please get the fix in Linus's tree first and then we can backport it as needed.

Quoted 6 lines
Quoted 2 lines

The patch now landed in Linus's tree as a95743b53031 ("kallsyms: fix build without execinfo"). Please backport it into the stable trees.

Already all queued up!

Thanks for letting us know.

Nice, thanks!