Skip to content

__mulodi4 from u32_u32__int_overflow_test in lib/overflow_kunit.c #1711

@nathanchance

Description

@nathanchance

Reported by CI with LLVM 11 (newer versions do not show this):

https://builds.tuxbuild.com/2EqpS04tCKn154FmyeYYpl7WJJ2/build.log

$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KCONFIG_ALLCONFIG=<(echo CONFIG_WERROR=n) LLVM=1 LLVM_IAS=0 allmodconfig all
...
ERROR: modpost: "__mulodi4" [lib/overflow_kunit.ko] undefined!
...

"Caused" by commit d219d2a9a92e ("overflow: Allow mixed type arguments") (cc @kees). A simplified reproducer on top of allnoconfig:

$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 LLVM_IAS=0 allnoconfig

$ scripts/config -e KUNIT -e RUNTIME_TESTING_MENU -e OVERFLOW_KUNIT_TEST

$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 LLVM_IAS=0 olddefconfig all
ld.lld: error: undefined symbol: __mulodi4
>>> referenced by overflow_kunit.c
>>>               lib/overflow_kunit.o:(u32_u32__int_overflow_test) in archive vmlinux.a
>>> referenced by overflow_kunit.c
>>>               lib/overflow_kunit.o:(u32_u32__int_overflow_test) in archive vmlinux.a

My reverse bisect of LLVM shows commit 3203143f1356 ("CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)") resolved this, which appears to be this exact case. I wonder if it is worth bumping the minimum version of LLVM to 12.0.0 over this?

Metadata

Metadata

Labels

[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] development cycleThis bug was only present and fixed in a -next or -rc cycle

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions