Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Unable to build 5.1-rc* Kernel

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
saski4711
Apprentice
Apprentice
Posts: 214
Joined: Thu Jun 24, 2004 8:23 am

Unable to build 5.1-rc* Kernel

  • Quote

Post by saski4711 » Fri Apr 19, 2019 9:22 am

Hi,

it seems that any Kernel 5.1-rc* won't compile on my current Gentoo:

Code: Select all

/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: Select all

CFLAGS="-Wno-error=undef"
however I cannot install/build Virtualbox:

Code: Select all

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
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31988
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

Re: Unable to build 5.1-rc* Kernel

  • Quote

Post by fedeliallalinea » Fri Apr 19, 2019 9:28 am

saski4711 wrote:What can I do?
Waiting official release of this kernel version?
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
saski4711
Apprentice
Apprentice
Posts: 214
Joined: Thu Jun 24, 2004 8:23 am

Re: Unable to build 5.1-rc* Kernel

  • Quote

Post by saski4711 » Fri Apr 19, 2019 9:38 am

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:
Top
toralf
Developer
Developer
User avatar
Posts: 3944
Joined: Sun Feb 01, 2004 2:58 pm
Location: Hamburg
Contact:
Contact toralf
Website

Re: Unable to build 5.1-rc* Kernel

  • Quote

Post by toralf » Fri Apr 19, 2019 10:41 am

saski4711 wrote:I suspect the linux-headers is too old (5.0). What can I do?

Code: Select all

echo "~sys-kernel/linux-headers-5.0" >> /etc/portage/package.accept_keywords/<your file>
?
Top
saski4711
Apprentice
Apprentice
Posts: 214
Joined: Thu Jun 24, 2004 8:23 am

Re: Unable to build 5.1-rc* Kernel

  • Quote

Post by saski4711 » Sat Apr 20, 2019 12:45 pm

toralf wrote:
saski4711 wrote:I suspect the linux-headers is too old (5.0). What can I do?

Code: Select all

echo "~sys-kernel/linux-headers-5.0" >> /etc/portage/package.accept_keywords/<your file>
?
Thanks. Switched back to 5.0 official.
Top
ShinyDoofy
n00b
n00b
Posts: 73
Joined: Sat Jul 22, 2006 2:38 am

  • Quote

Post by ShinyDoofy » Wed May 15, 2019 9:46 am

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: Select all

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 :)
Top
pleasantatk
n00b
n00b
Posts: 1
Joined: Thu Jun 13, 2019 7:28 am

Working fix

  • Quote

Post by pleasantatk » Thu Jun 13, 2019 7:35 am

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.
Top
saski4711
Apprentice
Apprentice
Posts: 214
Joined: Thu Jun 24, 2004 8:23 am

  • Quote

Post by saski4711 » Thu Jun 27, 2019 11:15 am

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: Select all

CFLAGS="-Wno-error=undef" make bzImage
Top
risa2000
n00b
n00b
Posts: 35
Joined: Sun Oct 17, 2004 3:34 pm

  • Quote

Post by risa2000 » Mon Jul 29, 2019 9:32 am

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.
Top
Mappy
n00b
n00b
Posts: 42
Joined: Fri Jun 21, 2019 8:53 pm

  • Quote

Post by Mappy » Tue Aug 13, 2019 12:47 am

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.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic