Skip to content

Commit cd91c6d

Browse files
committed
rt: Build __morestack as a static library and copy it to the right places
1 parent 3a80d7b commit cd91c6d

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ HOST_SREQ$(1) = \
281281
TARGET_SREQ$(1)$(2) = \
282282
$$(HOST_SREQ$(1)) \
283283
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUNTIME) \
284-
$$(TARGET_LIB$(1)$(2))/intrinsics.bc
284+
$$(TARGET_LIB$(1)$(2))/intrinsics.bc \
285+
$$(TARGET_LIB$(1)$(2))/libmorestack.a
285286

286287
# Prerequisites for complete stageN targets
287288
SREQ$(1)$(2) = \

mk/install.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ install-target$(1): $$(SREQ$$(ISTAGE)$(1))
4343
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),$$(CFG_RUNTIME))
4444
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),$$(CFG_STDLIB))
4545
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),intrinsics.bc)
46+
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),libmorestack.a)
4647
endef
4748

4849
$(foreach target,$(CFG_TARGET_TRIPLES), \

mk/rt.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ rt/$(1)/%.o: rt/%.S $$(MKFILES)
139139
@$$(call E, compile: $$@)
140140
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1))) $$<
141141

142+
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: rt/$(1)/arch/$$(HOST_$(1))/morestack.o
143+
@$$(call E, link: $$@)
144+
$$(Q)ar rcs $$@ $$<
145+
142146
rt/$(1)/$(CFG_RUNTIME): $$(RUNTIME_OBJS_$(1)) $$(MKFILES) \
143147
$$(RUNTIME_HDR_$(1)) \
144148
$$(RUNTIME_DEF_$(1)) \

mk/target.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ $$(TARGET_LIB$(1)$(2))/intrinsics.bc: $$(TARGET_LIB$(1)$(2))/intrinsics.ll \
1717
@$$(call E, llvms-as: $$@)
1818
$$(Q)$$(LLVM_AS_$(2)) -o $$@ $$<
1919

20+
$$(TARGET_LIB$(1)$(2))/libmorestack.a: rt/$(2)/arch/$$(HOST_$(2))/libmorestack.a
21+
@$$(call E, cp: $$@)
22+
$$(Q)cp $$< $$@
23+
2024
$$(TARGET_LIB$(1)$(2))/$$(CFG_STDLIB): \
2125
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
2226
$$(TARGET_SREQ$(1)$(2))

0 commit comments

Comments
 (0)