[LTP] ltp build broken on Fedora 40?

Petr Vorel pvorel@suse.cz
Thu Aug 29 00:48:50 CEST 2024


Hi Chuck,

> Hi-

> I'm finding that ltp 20240524 does not build on Fedora 40 due
> to a missing header:

I guess you need to backport gcc-14 fix b0ae1ee239 ("rpc_svc_1: Fix incompatible
pointer type error") [1] (or build with older gcc).

> ltp/testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c:46:10: fatal error: linux/genhd.h: No such file or directory
>    46 | #include <linux/genhd.h>
>       |          ^~~~~~~~~~~~~~~
> compilation terminated.

Yes, <linux/genhd.h> was removed back then in v5.18-rc1 [2] (we should use
<linux/blkdev.h>). But that should not cause your build fail. But because we
don't maintain these kernel drivers (there was a plan to move them to kunit
anyway), the build error is ignored [3]:

	# Ignoring the exit status of commands is done to be forward compatible with
	# kernel internal API changes. The user-space test will return TCONF, if it
	# doesn't find the module (i.e. it wasn't built either due to kernel-devel
	# missing or module build failure).
	%.ko: %.c .dep_modules ;

With properly installed kernel headers (WITH_MODULES = yes in
include/mk/config.mk) I get:

$ cd testcases/kernel/device-drivers/acpi
$ make; echo $?
make -C "ltp/lib" -f "ltp/lib/Makefile" all
make[1]: Entering directory 'ltp/lib'
GEN ltp-version.h
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make[1]: Leaving directory 'ltp/lib'
CC testcases/kernel/device-drivers/acpi/ltp_acpi
Building modules: ltp_acpi_cmds.c
make -C /lib/modules/6.10.6-amd64/build M=ltp/testcases/kernel/device-drivers/acpi
make[1]: Entering directory '/usr/src/linux-headers-6.10.6-amd64'
  CC [M]  ltp/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.o
ltp/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.c:39:10: fatal error: linux/genhd.h: No such file or directory
   39 | #include <linux/genhd.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-6.10.6-common/scripts/Makefile.build:249: ltp/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.10.6-common/Makefile:1943: ltp/testcases/kernel/device-drivers/acpi] Error 2
make[1]: *** [/usr/src/linux-headers-6.10.6-common/Makefile:252: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.10.6-amd64'
make: [../../../../include/mk/module.mk:62: .dep_modules] Error 2 (ignored)
=> note "ignored"
rm -rf *.mod.c *.o *.ko.unsigned modules.order .tmp* .*.ko .*.cmd Module.symvers
0

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/commit/b0ae1ee2392d0612cce7d61842b78640a04b26f0
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=322cbb50de711814c42fb088f6d31901502c711a
[3] https://github.com/linux-test-project/ltp/blob/master/include/mk/module.mk#L54-L58

> However the ltp build works on Fedora 39. I'm not sure why
> because I cannot find a linux/genhd.h on that system.


More information about the ltp mailing list