Hi,
while testing a new patch on the livepatch kselftests, I was testing the gen_tar target and I figured that we only copy the resulting binaries to the final tar file.
Per the kselftests documentation[1], the gen_tar target is used to package the tests to run "on different systems". But what if the different system has different libraries/library versions? Wouldn't it be a problem?
This question came when I was working to build the livepatch modules as part of the kselftests testing suit. The plan was to just package the test scripts/programs/modules and then run the tests on a different system, likewise a different SLE version. Since the kernel would be different in this case, I expected that gen_tar would copy the module source files so they can be compiled on the target system.
While the current approach can work when the selftests rely solely on shell scripts(cpufreq, kexec), those who compile userspace binaries (cgroup, alsa, sched, ...) may not work.
Am I missing something? Is gen_tar only meant to copy the tests to be run on systems with the same libraries or with the libraries with the exactly the same version?
Thanks in advance, Marcos
[1]: https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html
-----Original Message----- From: Marcos Paulo de Souza mpdesouza@suse.de
...
Per the kselftests documentation[1], the gen_tar target is used to package the tests to run "on different systems". But what if the different system has different libraries/library versions? Wouldn't it be a problem?
...
While the current approach can work when the selftests rely solely on shell scripts(cpufreq, kexec), those who compile userspace binaries (cgroup, alsa, sched, ...) may not work.
Am I missing something? Is gen_tar only meant to copy the tests to be run on systems with the same libraries or with the libraries with the exactly the same version?
gen_tar was originally intended (I believe) for developers doing cross-compilation. The SDK used for cross-compilation of the executables should handle issues such as library versions (and of course, CPU architecture and endian-ness).
I've never done cross-compilation for the same architecture, so I don't know how that would work, but I presume there is some way to compile code for another system with the same architecture but different libraries. -- Tim
On 10/24/23 12:34, Bird, Tim wrote:
-----Original Message----- From: Marcos Paulo de Souza mpdesouza@suse.de
...
Per the kselftests documentation[1], the gen_tar target is used to package the tests to run "on different systems". But what if the different system has different libraries/library versions? Wouldn't it be a problem?
...
While the current approach can work when the selftests rely solely on shell scripts(cpufreq, kexec), those who compile userspace binaries (cgroup, alsa, sched, ...) may not work.
Am I missing something? Is gen_tar only meant to copy the tests to be run on systems with the same libraries or with the libraries with the exactly the same version?
gen_tar was originally intended (I believe) for developers doing cross-compilation. The SDK used for cross-compilation of the executables should handle issues such as library versions (and of course, CPU architecture and endian-ness).
I've never done cross-compilation for the same architecture, so I don't know how that would work, but I presume there is some way to compile code for another system with the same architecture but different libraries.
Right. gen_tar was intended to be used when a user wants to generate tar archive of all the complied tests/installed tests. Running kselftest_install creates a directory with artifacts necessary to execute tests.
This functionality is now part of the selftests Makefile - gen_tar target will do the same.
thanks, -- Shuah
linux-kselftest-mirror@lists.linaro.org