Subject: linux-next: build failure after merge of the rust tree

From: Stephen Rothwell <[email-masked]>
Date: Tue, 27 May 2025 19:42:33 +1000

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::alloc::kvec::tests::kunit_rust_wrapper_test_kvec_retain':
(.text+0x1bd7194): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd71a1): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd71ae): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::kunit::tests::kunit_rust_wrapper_rust_test_kunit_in_kunit_test':
(.text+0x1bd75eb): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd75f8): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd7605): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_to_str':
(.text+0x1bd7e01): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd7e0e): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd7e1b): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_to_str_invalid_utf8':
(.text+0x1bd81a0): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd81ad): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd81ba): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_display':
(.text+0x1bd9728): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd9735): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd9742): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_display_all_bytes':
(.text+0x1bda03c): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bda049): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bda056): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_debug':
(.text+0x1bdb598): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bdb5a5): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bdb5b2): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_bstr_display':
(.text+0x1bdcf82): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bdcf8f): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bdcf9c): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_bstr_debug':
(.text+0x1bde962): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bde96f): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bde97c): undefined reference to `__kunit_abort'

Caused by one of the latest commits in the rust tree.

I have used the rust tree from next-20250526 for today.

-- 
Cheers,
Stephen Rothwell