Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to build 5.1-rc* Kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
saski4711
Apprentice
Apprentice


Joined: 24 Jun 2004
Posts: 202

PostPosted: Fri Apr 19, 2019 9:22 am    Post subject: Unable to build 5.1-rc* Kernel Reply with quote

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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31463
Location: here

PostPosted: Fri Apr 19, 2019 9:28 am    Post subject: Re: Unable to build 5.1-rc* Kernel Reply with quote

saski4711 wrote:
What can I do?

Waiting official release of this kernel version?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
saski4711
Apprentice
Apprentice


Joined: 24 Jun 2004
Posts: 202

PostPosted: Fri Apr 19, 2019 9:38 am    Post subject: Re: Unable to build 5.1-rc* Kernel Reply with quote

fedeliallalinea wrote:
saski4711 wrote:
What can I do?

Waiting official release of this kernel version?


Yeah I was hoping for a somewhat quicker solution :oops:
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Fri Apr 19, 2019 10:41 am    Post subject: Re: Unable to build 5.1-rc* Kernel Reply with quote

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
View user's profile Send private message
saski4711
Apprentice
Apprentice


Joined: 24 Jun 2004
Posts: 202

PostPosted: Sat Apr 20, 2019 12:45 pm    Post subject: Re: Unable to build 5.1-rc* Kernel Reply with quote

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
View user's profile Send private message
ShinyDoofy
n00b
n00b


Joined: 22 Jul 2006
Posts: 73

PostPosted: Wed May 15, 2019 9:46 am    Post subject: Reply with quote

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
View user's profile Send private message
pleasantatk
n00b
n00b


Joined: 13 Jun 2019
Posts: 1

PostPosted: Thu Jun 13, 2019 7:35 am    Post subject: Working fix Reply with quote

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
View user's profile Send private message
saski4711
Apprentice
Apprentice


Joined: 24 Jun 2004
Posts: 202

PostPosted: Thu Jun 27, 2019 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message
risa2000
n00b
n00b


Joined: 17 Oct 2004
Posts: 35

PostPosted: Mon Jul 29, 2019 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Mappy
n00b
n00b


Joined: 21 Jun 2019
Posts: 42

PostPosted: Tue Aug 13, 2019 12:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum