Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926895 - sys-kernel/gentoo-sources fails to build with LLVM/CLANG >15
Summary: sys-kernel/gentoo-sources fails to build with LLVM/CLANG >15
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-13 10:48 UTC by gt_amd64
Modified: 2024-03-13 15:41 UTC (History)
1 user (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 gt_amd64 2024-03-13 10:48:44 UTC
building sys-kernel/gentoo-sources-6.8.0 with LLVM/CLANG fails with errors


Reproducible: Always

Steps to Reproduce:
1.setup genkernel.conf as described in wiki.gentoo.org/wiki/Clang#Kernel
2.build kernel: LLVM=1 genkernel --menuconfig all
3.
Actual Results:  
misc-utils/kill.c:397:13: error: call to undeclared function 'pidfd_open'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  397 |         if ((pfd = pidfd_open(ctl->pid, 0)) < 0)
      |                    ^
misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  402 |         if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)
      |             ^
2 errors generated.
make[2]: *** [Makefile:9703: misc-utils/kill.o] Error 1
make[2]: Leaving directory '/tmp/genkernel/gk_quzJd4L9/util-linux/util-linux-2.38.1'
make[1]: *** [Makefile:15064: all-recursive] Error 1
make[1]: Leaving directory '/tmp/genkernel/gk_quzJd4L9/util-linux/util-linux-2.38.1'
make: *** [Makefile:6466: all] Error 2
* ERROR: Command 'nice -n10 make LLVM=1 LLVM_IAS=1 V=1' failed!

* ERROR: create_initramfs(): append_data(): append_util-linux(): populate_binpkg(): gkbuild(): Failed to create binpkg of util-linux-2.38.1!

Expected Results:  
no errors

it seems a patch already exists!
check out the note in this patch:

patchwork.yoctoproject.org/project/oe-core/patch/20230731075903.1003460-1-alex@linutronix.de/

-This header in newer glibc defines the signatures of functions
-pidfd_send_signal() and pidfd_open() and when these functions are
-defined by libc then we need to include the relevant header to get
-the definitions. Clang 15+ has started to error out when function
-signatures are missing.
-
-Fixes errors like
-misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
-        if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)
Comment 1 gt_amd64 2024-03-13 10:52:08 UTC
forget to mention that i used sys-devel/clang-17.0.6 to build kernel
Comment 2 Mike Pagano gentoo-dev 2024-03-13 12:48:13 UTC
Upgrade util-linux ?
Comment 3 gt_amd64 2024-03-13 13:15:35 UTC
on my system sys-apps/util-linux-2.39.3-r2 is installed (compiled with clang - no issues)

so yes, either the inclided util-linux in sys-kernel/gentoo-sources needs an upgrade or a patch like the one from patchwork.yoctoproject.org is required.

i think at the moment all gentoo-sources versions will fail to build, if clang >15 is used to compile the kernel and not only 6.8.0
Comment 4 Mike Pagano gentoo-dev 2024-03-13 14:56:01 UTC
(In reply to gt_amd64 from comment #3)
> on my system sys-apps/util-linux-2.39.3-r2 is installed (compiled with clang
> - no issues)
> 
> so yes, either the inclided util-linux in sys-kernel/gentoo-sources needs an
> upgrade or a patch like the one from patchwork.yoctoproject.org is required.
> 
> i think at the moment all gentoo-sources versions will fail to build, if
> clang >15 is used to compile the kernel and not only 6.8.0

Sorry not following.

"either the inclided util-linux in sys-kernel/gentoo-sources needs an
 upgrade"


util-linux is included in gentoo-sources?
Comment 5 Mike Pagano gentoo-dev 2024-03-13 15:01:52 UTC
Nevermind, I see it's a genkernel problem.


Thanks
Comment 6 gt_amd64 2024-03-13 15:41:57 UTC
sorry, i was just guessing that util-linux is part of gentoo-sources, because
i have installed sys-apps/util-linux-2.39.3-r2, but if i try to build the kernel util-linux-2.38.1 is used which causes the error.

now i have checked the genkernel-4.3.10.ebuild and there is an entry

VERSION_UTIL_LINUX="2.38.1"

so, i agree and think genkernel is the problem and using a higher version of util-linux in genkernel.ebuild may fix this bug.