Skip to content

Conversation

@ddiss
Copy link

@ddiss ddiss commented Jun 26, 2025

The following changes since commit ac5cde6a24d2b7fa8613ca3bd51e6a5567fb5adc:

  Merge pull request #609 from ddiss/lklfuse_rst_manpage (2025-06-24 10:36:25 -0700)

are available in the Git repository at:

  https://github.com/ddiss/linux minor_test_changes

for you to fetch changes up to bd30a15647247495b9b472b2a05c23e007e1a32a:

  lkl: hijack: explicitly build with -std=gnu11 (2025-06-26 20:30:37 +1000)

----------------------------------------------------------------
David Disseldorp (4):
      lkl: tests: drop unused lkl_test.fn() parameters
      lkl: define LKL_CONFIG_KASAN_KUNIT_TEST and use for test
      lkl: tests: minor lkl_test_kasan changes
      lkl: hijack: explicitly build with -std=gnu11

 arch/lkl/Makefile           |  1 +
 tools/lkl/Makefile.autoconf |  2 --
 tools/lkl/lib/hijack/Build  |  3 +++
 tools/lkl/tests/boot.c      | 22 +++++++++++++---------
 tools/lkl/tests/test.c      |  2 +-
 tools/lkl/tests/test.h      |  8 +++-----
 6 files changed, 21 insertions(+), 17 deletions(-)

ddiss added 3 commits June 26, 2025 16:22
The existing t.fn(t->arg1, t->arg2, t->arg3) call can lead to build
failures:
  tests/test.c: In function ‘lkl_test_run’:
  tests/test.c:93:23: error: too many arguments to function ‘t->fn’;
                             expected 0, have 3

The parameters don't appear to be used, so can be removed.

Signed-off-by: David Disseldorp <ddiss@suse.de>
CONFIG_KASAN_KUNIT_TEST is a kernel specific build option, so expose it
via the arch config.h instead of the tools-generated lkl_autoconf.h.
Both LKL_HOST_CONFIG_KASAN and LKL_HOST_CONFIG_KASAN_KUNIT_TEST are now
unused so can be removed.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Grep for the kunit kasan group summary so that we can log the test +
fail count.
Use a common exit path to ensure log is always freed.

Signed-off-by: David Disseldorp <ddiss@suse.de>
@ddiss
Copy link
Author

ddiss commented Jun 26, 2025

regarding lkl: tests: drop unused lkl_test.fn() parameters: we can't satisfy -Wstrict-prototypes everywhere yet, as hijack HOST_CALL() uses a (*host_##name)() function pointer.
I'll add an extra hijack/Build change to set CFLAGS_hijack.o += -Wno-strict-prototypes for tracking this. The open build service uses -Wstrict-prototypes by default.

Copy link
Member

@tavip tavip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleaning up work @ddiss, thank you!

@ddiss
Copy link
Author

ddiss commented Jun 26, 2025

regarding lkl: tests: drop unused lkl_test.fn() parameters: we can't satisfy -Wstrict-prototypes everywhere yet, as hijack HOST_CALL() uses a (*host_##name)() function pointer. I'll add an extra hijack/Build change to set CFLAGS_hijack.o += -Wno-strict-prototypes for tracking this. The open build service uses -Wstrict-prototypes by default.

The change in fn() vs call->fn(arg1, arg2, arg3) behavior is actually due to -std=gnu23/c23. -std=gnu11 doesn't complain so we can use that for now.

HOST_CALL() uses a (*host_##name)() function pointer while callers
provide regular syscall parameters. With gcc -std=gnu23 this results in:
lib/hijack/hijack.c: In function ‘hijack_setsockopt’:
lib/hijack/hijack.c:176:24: error: too many arguments to function ‘host_setsockopt’; expected 0, have 5
  176 |                 return host_setsockopt(fd, level, optname, optval, optlen);
      |                        ^~~~~~~~~~~~~~~ ~~

Signed-off-by: David Disseldorp <ddiss@suse.de>
@ddiss
Copy link
Author

ddiss commented Jun 26, 2025

v2:

  • add patch to build hijack.c with -std=gnu11, fixing the build where gcc -std=gnu23 is default

checkpatch failure is due to inclusion of raw compiler output (lines exceeding 72 chars) in commit message. IMO it can be ignored.

@tavip tavip merged commit 46f599b into lkl:master Jul 3, 2025
12 of 13 checks passed
@tavip
Copy link
Member

tavip commented Jul 3, 2025

Thanks @ddiss, sorry for the merge delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants