From bd14175de49eba1c4151e75c7032e0e3dc122460 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Thu, 30 Mar 2023 14:55:07 +0800 Subject: [PATCH] boards/sim: Export LLVM style arch info Signed-off-by: Huang Qi --- boards/sim/sim/sim/scripts/Make.defs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index b0ecfb931c..8c12d60947 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -20,7 +20,6 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -include $(TOPDIR)/tools/Zig.defs # NuttX is sometimes built as a native target. # In that case, the __NuttX__ macro is predefined by the compiler. @@ -125,8 +124,15 @@ endif ifeq ($(CONFIG_SIM_M32),y) ARCHCFLAGS += -m32 ARCHCXXFLAGS += -m32 + LLVM_ARCHTYPE := x86 + LLVM_CPUTYPE := i686 +else + LLVM_ARCHTYPE := x86_64 + LLVM_CPUTYPE := native endif +LLVM_ABITYPE := gnu + ARCHPICFLAGS = -fpic CC = $(CROSSDEV)cc @@ -144,7 +150,10 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump RUSTC = rustc --edition 2021 -ZIG = zig + +# Zig toolchain + +include $(TOPDIR)/tools/Zig.defs CFLAGS := $(ARCHOPTIMIZATION) $(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe CXXFLAGS := $(ARCHOPTIMIZATION) $(ARCHCXXFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe