Subject: Re: linux-next: build failure after merge of the char-misc tree

From: Greg KH <[email-masked]>
Date: Thu, 1 May 2025 16:20:45 +0200

On Thu, May 01, 2025 at 07:15:09AM -0300, Thadeu Lima de Souza Cascardo wrote:
> On Thu, May 01, 2025 at 04:45:01PM +1000, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the char-misc tree, today's linux-next build (powerpc
> > ppc64_defconfig) failed like this:
> > 
> > ld: warning: discarding dynamic section .glink
> > ld: warning: discarding dynamic section .plt
> > ld: linkage table error against `__kunit_do_failed_assertion'
> > ld: stubs don't match calculated size
> > ld: can not build stubs: bad value
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_duplicate_minor':
> > misc_minor_kunit.c:(.text+0x180): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0x1e4): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0x240): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_twice':
> > misc_minor_kunit.c:(.text+0x3e8): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0x458): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o:misc_minor_kunit.c:(.text+0x4c4): more undefined references to `__kunit_do_failed_assertion' follow
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_find_minors':
> > misc_minor_kunit.c:(.text+0xb3c): undefined reference to `kunit_log_append'
> > ld: misc_minor_kunit.c:(.text+0xbac): undefined reference to `kunit_log_append'
> > ld: misc_minor_kunit.c:(.text+0xc1c): undefined reference to `kunit_log_append'
> > ld: misc_minor_kunit.c:(.text+0xc88): undefined reference to `kunit_log_append'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_duplicate_name':
> > misc_minor_kunit.c:(.text+0xee4): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0xf40): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0xf90): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_duplicate_error':
> > misc_minor_kunit.c:(.text+0x11b4): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.text+0x1210): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o:misc_minor_kunit.c:(.text+0x1264): more undefined references to `__kunit_do_failed_assertion' follow
> > ld: drivers/misc/misc_minor_kunit.o:(.toc+0x0): undefined reference to `kunit_binary_assert_format'
> > ld: drivers/misc/misc_minor_kunit.o:(.toc+0x8): undefined reference to `kunit_fail_assert_format'
> > ld: drivers/misc/misc_minor_kunit.o:(.toc+0x10): undefined reference to `kunit_unary_assert_format'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_can_open':
> > misc_minor_kunit.c:(.init.text+0xc0): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x134): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_static_basic':
> > misc_minor_kunit.c:(.init.text+0x25c): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x2b4): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_conflict_reverse':
> > misc_minor_kunit.c:(.init.text+0x408): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x414): undefined reference to `__kunit_abort'
> > ld: misc_minor_kunit.c:(.init.text+0x46c): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x4d8): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x530): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x590): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x5e4): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o:misc_minor_kunit.c:(.init.text+0x63c): more undefined references to `__kunit_do_failed_assertion' follow
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_conflict':
> > misc_minor_kunit.c:(.init.text+0x7a0): undefined reference to `__kunit_abort'
> > ld: misc_minor_kunit.c:(.init.text+0x7f8): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x85c): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_dynamic_basic':
> > misc_minor_kunit.c:(.init.text+0x994): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x9ec): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_collision_reverse':
> > misc_minor_kunit.c:(.init.text+0xb20): undefined reference to `kunit_kmalloc_array'
> > ld: misc_minor_kunit.c:(.init.text+0xba8): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0xc00): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0xc64): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0xcc0): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_collision':
> > misc_minor_kunit.c:(.init.text+0xe30): undefined reference to `kunit_kmalloc_array'
> > ld: misc_minor_kunit.c:(.init.text+0xe98): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0xea4): undefined reference to `__kunit_abort'
> > ld: misc_minor_kunit.c:(.init.text+0xf04): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0xfac): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x1058): undefined reference to `__kunit_do_failed_assertion'
> > ld: drivers/misc/misc_minor_kunit.o: in function `miscdev_test_dynamic_only_range':
> > misc_minor_kunit.c:(.init.text+0x1174): undefined reference to `kunit_kmalloc_array'
> > ld: misc_minor_kunit.c:(.init.text+0x1200): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x1248): undefined reference to `__kunit_do_failed_assertion'
> > ld: misc_minor_kunit.c:(.init.text+0x12ec): undefined reference to `__kunit_do_failed_assertion'
> > 
> > Caused by commit
> > 
> >   20acf4dd46e4 ("char: misc: make miscdevice unit test built-in only")
> > 
> > $ grep CONFIG_KUNIT .config
> > CONFIG_KUNIT=m
> > CONFIG_KUNIT_DEBUGFS=y
> > CONFIG_KUNIT_FAULT_TEST=y
> > CONFIG_KUNIT_TEST=m
> > CONFIG_KUNIT_EXAMPLE_TEST=m
> > CONFIG_KUNIT_ALL_TESTS=m
> > CONFIG_KUNIT_DEFAULT_ENABLED=y
> > CONFIG_KUNIT_AUTORUN_ENABLED=y
> > $ grep CONFIG_TEST_MINOR .config
> > $ 
> > 
> > I have used the char-misc tree from next-20250428 again.
> > 
> > -- 
> > Cheers,
> > Stephen Rothwell
> 
> This should fix it. I am sorry for still breaking all these builds. I have
> tested this with the ppc64_defconfig (though that had required me to "fix" a
> couple of warnings-turned-to-errors under arch/powerpc/). As I am trying to fix
> this quickly, I haven't checked other configs. Again, I am sorry for the trouble.
> 
> Greg, I understand this may have caused you concern about merging this. Let
> me know if you want to apply the fix below and have me submit it properly
> or if we should wait for another cycle before applying a v5 after further
> testing.

Let me revert for now and please submit after the next -rc1 is out and
more testing can happen.

thanks,

greg k-h