@@ -72,16 +72,16 @@ RUNTIME_CXXFLAGS_$(1)_$(2) = -D_RUST_STAGE1
7272endif
7373endif
7474
75- RUNTIME_CXXS_$(1 ) _$(2 ) := \
76- rt/rust_cxx_glue.cpp
77-
7875RUNTIME_CS_$(1 ) _$(2 ) := \
7976 rt/rust_builtin.c \
8077 rt/rust_upcall.c \
8178 rt/miniz.c \
8279 rt/rust_android_dummy.c \
8380 rt/rust_test_helpers.c
8481
82+ RUNTIME_LL_$(1 ) _$(2 ) := \
83+ rt/rust_try.ll
84+
8585# stage0 remove this after the next snapshot
8686%.cpp:
8787 @touch tmp/foo.o
@@ -94,19 +94,16 @@ RT_BUILD_DIR_$(1)_$(2) := $$(RT_OUTPUT_DIR_$(1))/stage$(2)
9494RUNTIME_DEF_$(1 ) _$(2 ) := $$(RT_OUTPUT_DIR_$(1 ) ) /rustrt$$(CFG_DEF_SUFFIX_$(1 ) )
9595RUNTIME_INCS_$(1 ) _$(2 ) := -I $$(S ) src/rt -I $$(S ) src/rt/isaac -I $$(S ) src/rt/uthash \
9696 -I $$(S ) src/rt/arch/$$(HOST_$(1 ) )
97- RUNTIME_OBJS_$(1 ) _$(2 ) := $$( RUNTIME_CXXS_ $( 1 ) _ $( 2 ) :rt/%.cpp= $$( RT_BUILD_DIR_ $( 1 ) _ $( 2 ) ) /%.o ) \
97+ RUNTIME_OBJS_$(1 ) _$(2 ) := \
9898 $$(RUNTIME_CS_$(1 ) _$(2 ) :rt/%.c=$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o ) \
99- $$(RUNTIME_S_$(1 ) _$(2 ) :rt/%.S=$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o )
99+ $$(RUNTIME_S_$(1 ) _$(2 ) :rt/%.S=$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o ) \
100+ $$(RUNTIME_LL_$(1 ) _$(2 ) :rt/%.ll=$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o )
101+
100102ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1 ) _$(2 ) )
101103
102104MORESTACK_OBJS_$(1 ) _$(2 ) := $$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /arch/$$(HOST_$(1 ) ) /morestack.o
103105ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1 ) _$(2 ) )
104106
105- $$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS )
106- @$$(call E, compile: $$@ )
107- $$(Q )$$(call CFG_COMPILE_CXX_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) _$(2 ) ) \
108- $$(SNAP_DEFINES ) $$(RUNTIME_CXXFLAGS_$(1 ) _$(2 ) ) ) $$<
109-
110107$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o: rt/%.c $$(MKFILE_DEPS )
111108 @$$(call E, compile: $$@ )
112109 $$(Q )$$(call CFG_COMPILE_C_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) _$(2 ) ) \
@@ -117,6 +114,11 @@ $$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.S $$(MKFILE_DEPS) \
117114 @$$(call E, compile: $$@ )
118115 $$(Q )$$(call CFG_ASSEMBLE_$(1 ) ,$$@ ,$$< )
119116
117+ $$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /%.o: rt/%.ll $$(MKFILE_DEPS ) \
118+ $$(LLVM_CONFIG_$$(CFG_BUILD ) )
119+ @$$(call E, compile: $$@ )
120+ $$(Q )$(LLC_$(CFG_BUILD ) ) -filetype=obj -mtriple=$(1 ) -relocation-model=pic -o $$@ $$<
121+
120122$$(RT_BUILD_DIR_$(1 ) _$(2 ) ) /arch/$$(HOST_$(1 ) ) /libmorestack.a: $$(MORESTACK_OBJS_$(1 ) _$(2 ) )
121123 @$$(call E, link: $$@ )
122124 $$(Q )$(AR_$(1 ) ) rcs $$@ $$^
0 commit comments