-
Notifications
You must be signed in to change notification settings - Fork 674
Ltp linux kernel testcases build and running support #3336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
extinguish
wants to merge
5
commits into
apache:master
Choose a base branch
from
extinguish:ltp_linux_kernel_build_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Ltp linux kernel testcases build and running support #3336
extinguish
wants to merge
5
commits into
apache:master
from
extinguish:ltp_linux_kernel_build_support
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Major enhancements to LTP build system: - Split CMakeLists.txt into shared/posix/kernel sections with unified blacklisting - Add header stubs (linux/*.h, asm/*.h, lapi/*.h) for kernel test dependencies - Implement syscalls.h generation via regen.sh for NuttX syscall mapping - Define feature macros (HAVE_*, UNIT_TEST) and compiler flags for kernel tests - Resolve naming conflicts (safe_* functions) with macro renaming This enables LTP kernel test execution on NuttX, covering syscalls, filesystem, device drivers, and scheduler tests. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Define the complete loop_info structure and LOOP_* ioctl command constants in testing/ltp/include/linux/loop.h, matching Linux kernel's loop device interface. This allows LTP loop device testcases to build and execute when NuttX loop device support (CONFIG_DEV_LOOP) is available. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
For the NuttX platform, the system call numbers themselves are independent of the architecture(arm/x86/risc-v). Therefore, there is no need to consider the differences between different architectures(arm/x86/risc-v). As a result, we can directly maintain them manually instead of relying on the regen.sh script to generate them dynamically. This makes it easier for maintenance, upgrading, and modification. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
for kernel testcases that using main() method to execute, when invoke tst_exit() on execute finished, will report " executed from newlib!" error, this is caused by two kinds kernel testcases are forbidded linked together, in Linux this is OK, but for NuttX, this is necssary, so we choose to modify the NO_NEWLIB_ASSERT macro's implementation, thus to make kernel testcases can work in NuttX Signed-off-by: guoshichao <guoshichao@xiaomi.com>
blacklist nftw64 to resolve symbol duplication errors, the following are the detailed link error info: ``` /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.next_fd+0x0): multiple definition of `__odr_asan.next_fd'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.next_fd+0x0): first defined here /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.visit+0x0): multiple definition of `__odr_asan.visit'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.visit+0x0): first defined here /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.dirlist+0x0): multiple definition of `__odr_asan.dirlist'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.dirlist+0x0): first defined here /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.ebuf+0x0): multiple definition of `__odr_asan.ebuf'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.ebuf+0x0): first defined here /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.s2+0x0): multiple definition of `__odr_asan.s2'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.s2+0x0): first defined here /usr/bin/ld: /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw64.a(nftw64.c.o):(.bss.__odr_asan.temp+0x0): multiple definition of `__odr_asan.temp'; /home/testing/vela/cmake_out/vela_vela/apps/testing/ltp/libapps_ltp_syscalls_nftw_nftw.a(nftw.c.o):(.bss.__odr_asan.temp+0x0): first defined here ``` Signed-off-by: guoshichao <guoshichao@xiaomi.com>
xiaoxiang781216
approved these changes
Jan 16, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Extend LTP (Linux Test Project) support on NuttX to enable compilation and execution of Linux kernel testcases, adding necessary infrastructure for kernel‑level API validation:
struct loop_infoandLOOP_* ioctlconstants intesting/ltp/include/linux/loop.h, allowing LTP loop‑device testcases to build and run whenCONFIG_DEV_LOOP=y.CMakeinfrastructure with proper header stubs,syscall mapping, and feature configuration to support kernel‑level test execution.Impact
Testing