Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

gentoo-kernel compile fails without binutils-libs

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
grant123
Veteran
Veteran
Posts: 1109
Joined: Wed Mar 23, 2005 1:48 am

gentoo-kernel compile fails without binutils-libs

  • Quote

Post by grant123 » Tue Feb 17, 2026 6:23 pm

Compiling gentoo-kernel-6.19.2 fails with 'fatal error: bfd.h: No such file or directory' unless I install binutils-libs.
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

Re: gentoo-kernel compile fails without binutils-libs

  • Quote

Post by turtles » Tue Feb 17, 2026 9:30 pm

grant123 wrote:Compiling gentoo-kernel-6.19.2 fails with 'fatal error: bfd.h: No such file or directory' unless I install binutils-libs.
seems like a bug if binutils-libs is needed for Binary File Descriptor (BFD) library then I think it would be in the kernel-build eclass
What does

Code: Select all

grep -n "BDEPEND=" /usr/portage/eclass/kernel-build.eclass -A 15
give you?
Donate to Gentoo
Top
beastrabban
n00b
n00b
Posts: 10
Joined: Wed Feb 18, 2026 4:34 pm

Re: gentoo-kernel compile fails without binutils-libs

  • Quote

Post by beastrabban » Wed Feb 18, 2026 4:42 pm

turtles wrote:
grant123 wrote:Compiling gentoo-kernel-6.19.2 fails with 'fatal error: bfd.h: No such file or directory' unless I install binutils-libs.
seems like a bug if binutils-libs is needed for Binary File Descriptor (BFD) library then I think it would be in the kernel-build eclass
What does

Code: Select all

grep -n "BDEPEND=" /usr/portage/eclass/kernel-build.eclass -A 15
give you?
Hi, I'm not OP but I'm having the exact same issue. I noticed it when I tried to switch from gentoo-kernel-bin to gentoo-kernel. In my case, it compiled successfully the first time, but warned me about preserved libraries. When I tried to run

Code: Select all

emerge -aqv @preserved-rebuild
, it failed with the same message as OP.

The

Code: Select all

/usr/portage/
directory does not seem to exist on my system. Is there any other information that I can provide to troubleshoot the issue?
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

Re: gentoo-kernel compile fails without binutils-libs

  • Quote

Post by turtles » Wed Feb 18, 2026 6:15 pm

beastrabban wrote: The

Code: Select all

/usr/portage/
directory does not seem to exist on my system. Is there any other information that I can provide to troubleshoot the issue?
Interesting, my system is old what does this give you?:

Code: Select all

find $(portageq get_repo_path / gentoo) -name "kernel-build.eclass" 
Donate to Gentoo
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4696
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Wed Feb 18, 2026 6:29 pm

/usr/portage/ has been deprecated... While onyone can still use that location or any other location, the default is now /var/db/repos/gentoo/.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

  • Quote

Post by turtles » Wed Feb 18, 2026 6:32 pm

Ahh ok actually run this:

Code: Select all

grep -n -A 15 "BDEPEND=" $(find $(portageq get_repo_path / gentoo) -name "kernel-build.eclass")
sys-libs/binutils-libs should probably be in that list.
Looking at https://www.kernel.org/pub/linux/kernel ... geLog-6.19
objtool was significantly rewritten to support late-linked objects (LTO/IBT compatible) and to perform "binary diffing" between kernel objects.
so sys-libs/binutils-libs most likely needs to be in the kernel-build.eclass
There might be a bug on bugzilla if not one of you could report it;
I would suggest this patch to resolve the bug, if its a bug.

Code: Select all

diff -u /usr/portage/eclass/kernel-build.eclass /usr/portage/eclass/kernel-build.eclass.new 
--- /usr/portage/eclass/kernel-build.eclass     2025-11-23 11:42:32.000000000 -0800
+++ /usr/portage/eclass/kernel-build.eclass.new 2026-02-18 10:18:44.649954771 -0800
@@ -52,6 +52,7 @@
        sys-devel/bison
        sys-devel/flex
        virtual/libelf
+       sys-libs/binutils-libs
        arm? ( sys-apps/dtc )
        arm64? ( sys-apps/dtc )
        riscv? ( sys-apps/dtc )
Last edited by turtles on Wed Feb 18, 2026 7:14 pm, edited 1 time in total.
Donate to Gentoo
Top
grknight
Retired Dev
Retired Dev
Posts: 2565
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Wed Feb 18, 2026 6:53 pm

Take note of Bug 970027 - sys-kernel/gentoo-sources-6.19.0 is missing headers for objtool build with gcc
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

  • Quote

Post by turtles » Wed Feb 18, 2026 7:46 pm

grknight wrote:Take note of Bug 970027 - sys-kernel/gentoo-sources-6.19.0 is missing headers for objtool build with gcc
Thanks I don't have a up to date system to reproduce and test on but I added my suggested patch idea to that bug.
The manual solution is simply emerge sys-libs/binutils-libs
Donate to Gentoo
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Wed Feb 18, 2026 7:48 pm

binutils produces bfd.h file but its buried under /usr/lib64/binutils/x86_64-pc-linux-gnu/<binutil version>/include

binutils-libs also produces bfd.h file and buries it too, BUT also produces a shim /usr/include/bfd.h that points to the real one
depending on the cpu arch.

And yes the one produce by binutils is the same as the one from binutils-libs, they just go in different places and one produces a shim.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
Post Reply

9 posts • Page 1 of 1

Return to “Installing Gentoo”

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