]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/nolibc: allow building i386 with multiarch compiler
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 17 Sep 2023 15:36:16 +0000 (17:36 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Thu, 12 Oct 2023 19:14:09 +0000 (21:14 +0200)
When building with a multiarch-capable compiler, like those provided by
common distributions the -m32 argument is required to build 32bit code.

Wrap it in cc-option in case the compiler is not multiarch-capable.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-1-03863d509b9a@weissschuh.net
tools/testing/selftests/nolibc/Makefile

index ee6a9ad28cfdcfdb7b2d59631a3a9766f72b15f5..891aa396163d2c5fe367c5eb3613a5a445104d7f 100644 (file)
@@ -113,6 +113,7 @@ else
 Q=@
 endif
 
+CFLAGS_i386 = $(call cc-option,-m32)
 CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2)