View previous topic :: View next topic |
Author |
Message |
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 202
|
Posted: Fri Apr 19, 2019 9:22 am Post subject: Unable to build 5.1-rc* Kernel |
|
|
Hi,
it seems that any Kernel 5.1-rc* won't compile on my current Gentoo:
Code: |
/usr/include/libelf/gelf.h:25:5: error: "__LIBELF_INTERNAL__" is not defined, evaluates to 0 [-Werror=undef]
#if __LIBELF_INTERNAL__
^~~~~~~~~~~~~~~~~~~
In file included from elf.h:22,
from check.h:22,
from orc_gen.c:22:
|
I can work around this with:
Code: |
CFLAGS="-Wno-error=undef"
|
however I cannot install/build Virtualbox:
Code: |
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
|
I suspect the linux-headers is too old (5.0). What can I do?
Cheers |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31463 Location: here
|
Posted: Fri Apr 19, 2019 9:28 am Post subject: Re: Unable to build 5.1-rc* Kernel |
|
|
saski4711 wrote: | What can I do? |
Waiting official release of this kernel version? _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 202
|
Posted: Fri Apr 19, 2019 9:38 am Post subject: Re: Unable to build 5.1-rc* Kernel |
|
|
fedeliallalinea wrote: | saski4711 wrote: | What can I do? |
Waiting official release of this kernel version? |
Yeah I was hoping for a somewhat quicker solution |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3943 Location: Hamburg
|
Posted: Fri Apr 19, 2019 10:41 am Post subject: Re: Unable to build 5.1-rc* Kernel |
|
|
saski4711 wrote: | I suspect the linux-headers is too old (5.0). What can I do? |
Code: | echo "~sys-kernel/linux-headers-5.0" >> /etc/portage/package.accept_keywords/<your file> | ? |
|
Back to top |
|
|
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 202
|
Posted: Sat Apr 20, 2019 12:45 pm Post subject: Re: Unable to build 5.1-rc* Kernel |
|
|
toralf wrote: | saski4711 wrote: | I suspect the linux-headers is too old (5.0). What can I do? |
Code: | echo "~sys-kernel/linux-headers-5.0" >> /etc/portage/package.accept_keywords/<your file> | ? |
Thanks. Switched back to 5.0 official. |
|
Back to top |
|
|
ShinyDoofy n00b
Joined: 22 Jul 2006 Posts: 73
|
Posted: Wed May 15, 2019 9:46 am Post subject: |
|
|
This change was introduced via commit 056d28d1 (via this GitHub issue.
I've had the same initial error message when compiling the 5.1 kernel. A possible solution is indicated here:
Code: | emerge --deselect dev-libs/libelf
emerge -v virtual/libelf |
That did the trick for me to get the kernel compiled. Maybe it helps somebody else as well |
|
Back to top |
|
|
pleasantatk n00b
Joined: 13 Jun 2019 Posts: 1
|
Posted: Thu Jun 13, 2019 7:35 am Post subject: Working fix |
|
|
I temporarily removed pkgconf and it worked.
Rationale / reason this works: https://github.com/NixOS/nixpkgs/issues/59929
tl;dr: recent upstream linux commit switched detection of libelf to pkgconfig, so it's being included via -I instead of -isystem. As a result, certain flags which were previously ignored due to -isystem are now combining with otherwise minor issues in the header file to result in catastrophe.
As I mentioned there, I'm planning on submitting a fix to the broken headers upstream, which will remove the real problem entirely.
Removing pkgconf manually using `emerge -C pkgconf`, building the kernel, and then reinstalling pkgconf seems to be the best solution ATM. |
|
Back to top |
|
|
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 202
|
Posted: Thu Jun 27, 2019 11:15 am Post subject: |
|
|
This issue is still there. I wonder why this isn't hitting more pepole using gentoo. Anyway the best workaround IMHO is to tell GCC not to treat a warning as an error:
Code: | CFLAGS="-Wno-error=undef" make bzImage |
|
|
Back to top |
|
|
risa2000 n00b
Joined: 17 Oct 2004 Posts: 35
|
Posted: Mon Jul 29, 2019 9:32 am Post subject: |
|
|
I just got it when compiling the recent stable vanilla (5.2.4). I used the workaround suggested by @ShinyDoofy above and it went well. |
|
Back to top |
|
|
Mappy n00b
Joined: 21 Jun 2019 Posts: 42
|
Posted: Tue Aug 13, 2019 12:47 am Post subject: |
|
|
I'm getting this error with the 5.2.8 kernel. Temporarily removing pkgconf works but I would rather not do that during every kernel upgrade. |
|
Back to top |
|
|
|