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)
forget to mention that i used sys-devel/clang-17.0.6 to build kernel
Upgrade util-linux ?
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
(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?
Nevermind, I see it's a genkernel problem. Thanks
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.