[PATCH v1 03/22] selftests/nolibc: allow use x86_64 toolchain for i386

Zhangjin Wu posted 22 patches 2 years, 7 months ago
There is a newer version of this series
[PATCH v1 03/22] selftests/nolibc: allow use x86_64 toolchain for i386
Posted by Zhangjin Wu 2 years, 7 months ago
Add extra '-m32 -Wl,-melf_i386' flags to tell x86_64 toolchains to
generate i386 executable.

This allows to use the same x86_64 toolchain for i386 architecture.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 tools/testing/selftests/nolibc/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 3300b5ab7de3..f8be0de0ce0e 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -89,6 +89,7 @@ else
 Q=@
 endif
 
+CFLAGS_i386 = -m32 -Wl,-melf_i386
 CFLAGS_riscv32 = -march=rv32im -mabi=ilp32
 CFLAGS_s390 = -m64
 CFLAGS_mips = -EL
-- 
2.25.1