Re: [PATCH V11 1/4] rust: Fix "multiple candidates for rmeta dependency core" error

Link Mauve
2026-04-21T17:10:41Z

On Tue, Apr 21, 2026 at 05:51:42PM +0100, Gary Guo wrote:
> On Tue Apr 21, 2026 at 5:36 PM BST, Link Mauve wrote:
>
> > This works fine for the core crate, but now panic_qr also gets the same
> > issue, here it is with V=1:
> > ```
> > + powerpc-linux-musl-ld -EB -m elf32ppc -z noexecstack --no-warn-rwx-segments -Bstatic --build-id=sha1 --orphan-handling=warn --script=./arch/powerpc/kernel/vmlinux.lds --strip-debug -o .tmp_vmlinux1 --whole-archive vmlinux.a .vmlinux.export.o init/version-timestamp.o --no-whole-archive --start-group --end-group .tmp_vmlinux0.kallsyms.o
> > powerpc-linux-musl-ld: drivers/gpu/drm/drm_panic_qr.o: in function `<drm_panic_qr::SegmentIterator as core::iter::traits::iterator::Iterator>::next':
> > drm_panic_qr.f39a15fa3c72e9fe-cgu.0:(.text+0x200c): undefined reference to `__udivdi3'
> > ```
> >
> > From a cursory look at the SegmentIterator::next() function I don’t
> > understand where the division could come up, but it’s actually nice to
> > get an error when operations which shouldn’t happen happen anyway, it
> > makes it more likely to get them fixed.
>
> There is divide / modular by 10 code. Although, this shouldn't really cause
> __udivdi3 to be generated for constant divisor, unless `-C opt-level=s` is used.
> Do you happen to use that opt-level?

Indeed that was it!

With CONFIG_CC_OPTIMIZE_FOR_SIZE=y the kernel is 4 MiB large, and with
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y it is 4.9 MiB large, but
CONFIG_DRM_PANIC_SCREEN_QR_CODE=y works.

As I target the Wii which has only 88 MiB of RAM, a difference of
920 KiB is actually quite important, and someone[1] is even making it
work on the GameCube and its 24 MiB of RAM where it becomes critical.

>
> Best,
> Gary
>

[1] https://github.com/Wii-Linux/wii-linux-ngx/pull/13#issuecomment-4233447365

--
Link Mauve