Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 644500 - sys-kernel/gentoo-sources-4.14.13: Kernel build fails without virtual/libelf on amd64
Summary: sys-kernel/gentoo-sources-4.14.13: Kernel build fails without virtual/libelf ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
: 646426 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-14 01:05 UTC by Teika kazura
Modified: 2018-02-07 07:37 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Teika kazura 2018-01-14 01:05:38 UTC
$ cd /usr/src/linux ; make
 emits the message:
---------------------------------
scripts/kconfig/conf  --silentoldconfig Kconfig
Makefile:942: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
---------------------------------

Notice that even if I unset CONFIG_UNWINDER_ORC, (this option is found under "kernel hacking") I received the above error too.

I emerged virtual/libelf (in my case dev-libs/elfutils was installed) and the kernel was built.

Bug 627778 says libelf is necessary to build nvidia driver, but I don't have an nvidia card, so it is a different report.

Regards.
Comment 1 Brian Evans (RETIRED) gentoo-dev 2018-01-14 01:33:14 UTC
I bet you have the minimal USE in make.conf.  This will bring in virtual/libelf for most people via the system package iproute2.

I agree the dependency is necessary.  Impact is minor as it will only impact those who set minimal in make.conf at this immediate time.
Comment 2 Teika kazura 2018-01-14 04:37:51 UTC
(A bit off-topic) Thanks. You're right, except a minor point: My iproute2 is a bit old, being 4.4.0, which is still in the portage tree. Its ebuild doesn't pull in libelf, unlike newer ones.
Comment 3 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2018-01-14 13:50:08 UTC
is this still a problem ?
Comment 4 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2018-01-14 13:52:39 UTC
you could solve it by installing virtual/libelf ?

probably this is to deal with iproute2 not kernel.
Comment 5 Brian Evans (RETIRED) gentoo-dev 2018-01-15 14:20:33 UTC
(In reply to Alice Ferrazzi from comment #4)
> you could solve it by installing virtual/libelf ?
> 
> probably this is to deal with iproute2 not kernel.

If someone is to set minimal USE in make.conf they negate pulling in virtual/libelf with that system package. The next depclean could remove it breaking kernel builds.
Comment 6 Teika kazura 2018-01-16 00:01:10 UTC
> you could solve it by installing virtual/libelf ?
> 
> probably this is to deal with iproute2 not kernel.

Anyway, assuming indirect dependency is bad. What happens when the situation with iproute2 changes? Please, be simple. Avoid hidden intention, and be clear to others. If you assume something, at least document it the ebuild.

Still, my bug report is yet to be confirmed by others.
Comment 7 Brian Evans (RETIRED) gentoo-dev 2018-02-02 19:14:13 UTC
*** Bug 646426 has been marked as a duplicate of this bug. ***
Comment 8 edes 2018-02-02 22:02:09 UTC
(In reply to Teika kazura from comment #6)

> Still, my bug report is yet to be confirmed by others.

i confirm that building the kernel fails if you don't have virtual/libelf installed. i had to install it manually, and then the kernel compiled without problems.

it's gentoo-sources-4.15.0 in my case.

BTW, without installing virtual/libelf, app-emulation/virtualbox-modules also fails.
Comment 9 Nikos Chantziaras 2018-02-04 12:50:14 UTC
I was just hit by this.

I do *NOT* have "minimal" set in make.conf. Nor anywhere else.

libelf was unmerged yesterday on a depclean. Whatever package was pulling it in, it seems to have dropped it.

Btw, if gentoo-sources would end up depending on libelf, it should probably depend on dev-libs/libelf, not the virtual. Unless you can build gentoo-sources on freebsd?
Comment 10 Guillaume Castagnino 2018-02-05 09:29:56 UTC
Same thing here. virtual/libelf and dev-libs/elfutils where unmerged by depclean. This was previously pulled by sys-apps/iproute2, but it’s now hidden behind the "elf" USE flag, not enabled by default.

Anyway, kernel packages should depend directly on libelf, and not rely on second level dependencies on random system profile packages that can change anytime (just like we saw here).
Comment 11 Bertrand 2018-02-05 14:25:32 UTC
Can confirm it on 4.15.1 also. Depclean removed libelf after upgrades to iproute2-4.15.0. 
No minimal USE flag set, on default/linux/amd64/17.0/desktop/gnome/systemd profile.
Comment 12 edes 2018-02-05 14:29:24 UTC
(In reply to Guillaume Castagnino from comment #10)
 
> Anyway, kernel packages should depend directly on libelf, and not rely on
> second level dependencies on random system profile packages that can change
> anytime (just like we saw here).

I agree completely and I can imagine everyone would agree with that. 

As a simple user, I would think that the obvious thing to do is simply add libelf as a dependency for the kernel. Am I missing something?
Comment 13 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2018-02-07 07:37:50 UTC
From f9b2693b32b7c7c7c561ae417cbd757624184327 Mon Sep 17 00:00:00 2001
From: Alice Ferrazzi <alicef@gentoo.org>
Date: Thu, 18 Jan 2018 15:41:17 +0000
Subject: [PATCH] Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y

New 4.14 kernel is using CONFIG_UNWINDER_ORC=y by default
but having USE="minimal" is removing virtual/libelf,
this is breaking the Kernel compilation.
Closes: https://github.com/gentoo/gentoo/pull/6898