Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 888829

Summary: sys-boot/gnu-efi not installing efi apps with standard use flags
Product: Gentoo Linux Reporter: razamatan
Component: Current packagesAssignee: Viorel Munteanu <ceamac>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, gentoo_bugs
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to compile gnu-efi apps in gentoo
remove LINUX_HEADERS

Description razamatan 2022-12-29 07:09:07 UTC
the default ebuild for gnu-efi skips compiling and installing the example efi apps, some of which are very helpful (modelist.efi).
Comment 1 David Seifert gentoo-dev 2023-09-06 07:55:31 UTC
3.0.17 installs the efi apps.
Comment 2 Martin Filo 2024-05-29 20:59:07 UTC
3.0.17 and higher are crashing during compilation of the efi apps with error:

make[1]: Entering directory '/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18/x86_64/apps'
x86_64-pc-linux-gnu-gcc -I/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps -I/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps/../inc -I/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps/../inc/x86_64 -I/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps/../inc/protocol -Wno-error=pragmas -mno-red-zone -mno-avx -fPIE  -g -O2 -Wall -Wextra -Wno-pointer-sign -funsigned-char -fshort-wchar -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check -fno-merge-all-constants -DCONFIG_x86_64 -std=c11 -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args -D__KERNEL__ -I/usr/src/sys/build/include -c /tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps/t.c -o t.o
cc1: error: /usr/src/sys/build/include: Permission denied
make[1]: *** [/tmp/portage/sys-boot/gnu-efi-3.0.18-r1/work/gnu-efi-3.0.18//apps/../Make.rules:54: t.o] Error 1

due this code in apps/Makefile:
LINUX_HEADERS	= /usr/src/sys/build
...
CPPFLAGS	+= -D__KERNEL__ -I$(LINUX_HEADERS)/include

In Gentoo linux headers are installed into /usr/include directory. After modification of path in LINUX_HEADERS to correct value for Gentoo, apps are compiled successfully.
Comment 3 Martin Filo 2024-05-31 20:13:48 UTC
Created attachment 894756 [details, diff]
patch to compile gnu-efi apps in gentoo
Comment 4 Viorel Munteanu gentoo-dev 2024-07-18 04:58:10 UTC
Created attachment 897911 [details, diff]
remove LINUX_HEADERS

Normally if /usr/src/sys/build/include does not exist, it is harmless.  You have something along that path that crashes your compilation.

Your patch adds /usr/include to the include dirs, which is the default anyway.  I think a better patch would be to simply remove LINUX_HEADERS altogether.  Can you try this one?
Comment 5 Martin Filo 2024-07-29 21:29:23 UTC
You are right, removing LINUX_HEADERS solved the problem. CPPFLAGS can remain.
Comment 6 Larry the Git Cow gentoo-dev 2024-08-02 04:53:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a27c3eccc447347e96c31fd03795f3ee354c2f65

commit a27c3eccc447347e96c31fd03795f3ee354c2f65
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2024-08-02 04:49:29 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2024-08-02 04:53:06 +0000

    sys-boot/gnu-efi: fix building efi apps
    
    Remove an include directory missing on most systems.
    
    Closes: https://bugs.gentoo.org/888829
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 .../files/gnu-efi-3.0.18-remove-linux-headers.patch        | 14 ++++++++++++++
 sys-boot/gnu-efi/gnu-efi-3.0.18-r3.ebuild                  |  1 +
 2 files changed, 15 insertions(+)