[PATCH 3/3] kbuild: compile *.mod.c files with -fshort-wchar

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Mar 28 01:35:49 PDT 2025


We use wchar_t in USB and EFI code, both of which expect 2-byte wide
strings. Thus, like Linux, we set -fshort-wchar in KBUILD_CFLAGS.

This flag is not passed through to the build of *.mod.c files that are
generated in a module build, leading to a linker warning.

Add it to fix this.

Cc: David Dgien <dgienda125 at gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5c9fce83123c..4ee9780abeac 100644
--- a/Makefile
+++ b/Makefile
@@ -459,7 +459,7 @@ XZ		= xz
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF)
 CFLAGS_KERNEL	=
 AFLAGS_KERNEL	=
-CFLAGS_MODULE	=
+CFLAGS_MODULE	= -fshort-wchar
 AFLAGS_MODULE	=
 
 LDFLAGS_MODULE  = -T common/module.lds
-- 
2.39.5




More information about the barebox mailing list