Re: [PATCH] kbuild: detect module name collisions between '-' and '_'

From: Nathan Chancellor

Date: Thu Nov 05 2026 - 22:32:15 EST


> Kbuild converts hyphens to underscores in KBUILD_MODNAME, and the module
> loader treats both characters as equivalent. However, modules-check.sh
> compares module basenames without normalization. Consequently, modules
> named foo-bar.o and foo_bar.o pass the conflict check even though they
> have the same effective module name.
>
> Normalize basenames before checking for duplicates, and use awk to show
> the original module paths in diagnostics. Preserve detection of exact
> duplicates and leave distinct names unaffected.
>
> Signed-off-by: Hamdy Abou El Anein <hamdy.aea@xxxxxxxxxxxxxx>

Good catch, I was able to reproduce this type of miss. This resolves it.
I suppose this has been a problem since this patch was first merged?

Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>

--
Cheers,
Nathan