Skip to content

Commit 150663c

Browse files
committed
mk: Correct names of installed libs on windows
Previously libmorestack.a and libcompiler-rt.a were installed, but link.exe looks for morestack.lib and compiler-rt.lib by default, so we need to install these with the correct name
1 parent eb5bf15 commit 150663c

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

mk/crates.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ ONLY_RLIB_rustc_bitflags := 1
125125
# Documented-by-default crates
126126
DOC_CRATES := std alloc collections core libc rustc_unicode
127127

128-
# Installed objects/libraries by default
129-
INSTALLED_OBJECTS := libmorestack.a libcompiler-rt.a
130-
131128
################################################################################
132129
# You should not need to edit below this line
133130
################################################################################

mk/main.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ endif
396396
# Prerequisites for using the stageN compiler to build target artifacts
397397
TSREQ$(1)_T_$(2)_H_$(3) = \
398398
$$(HSREQ$(1)_H_$(3)) \
399-
$$(foreach obj,$$(INSTALLED_OBJECTS),\
400-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) \
401399
$$(foreach obj,$$(INSTALLED_OBJECTS_$(2)),\
402400
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj))
403401

mk/platform.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ CFG_RLIB_GLOB=lib$(1)-*.rlib
112112

113113
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
114114

115+
define ADD_INSTALLED_OBJECTS
116+
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),morestack) \
117+
$$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
118+
endef
119+
120+
$(foreach target,$(CFG_TARGET), \
121+
$(eval $(call ADD_INSTALLED_OBJECTS,$(target))))
122+
115123
# The -Qunused-arguments sidesteps spurious warnings from clang
116124
define FILTER_FLAGS
117125
ifeq ($$(CFG_USING_CLANG),1)

mk/prepare.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
140140
$$(if $$(findstring $(2),$$(CFG_HOST)), \
141141
$$(foreach crate,$$(HOST_CRATES), \
142142
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),) \
143-
$$(foreach object,$$(INSTALLED_OBJECTS) $$(INSTALLED_OBJECTS_$(2)),\
143+
$$(foreach object,$$(INSTALLED_OBJECTS_$(2)),\
144144
$$(call PREPARE_LIB,$$(object))),),),)
145145
endef
146146

mk/rt.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
111111
@$$(call E, link: $$@)
112112
$$(Q)$$(AR_$(1)) rcs $$@ $$^
113113

114-
ifeq ($$(findstring windows,$(1)),windows)
115-
$$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1))
116-
$$(Q)cp $$^ $$@
117-
endif
118-
119114
endef
120115

121116
$(foreach target,$(CFG_TARGET), \
@@ -227,7 +222,7 @@ COMPRT_DEPS := $(wildcard \
227222
$(S)src/compiler-rt/*/*/*/*)
228223
endif
229224

230-
COMPRT_NAME_$(1) := libcompiler-rt.a
225+
COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
231226
COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
232227
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
233228

0 commit comments

Comments
 (0)