16
16
#
17
17
# It requires the following variables to be set:
18
18
#
19
- # PREPARE_HOST - the host triple
19
+ # PREPARE_HOST - the host triple
20
20
# PREPARE_TARGETS - the target triples, space separated
21
21
# PREPARE_DEST_DIR - the directory to put the image
22
22
@@ -172,7 +172,10 @@ prepare-target-$(2)-host-$(3)-$(1): \
172
172
$$(if $$(findstring $(2 ) ,$$(CFG_HOST ) ) , \
173
173
$$(foreach crate,$$(HOST_CRATES ) , \
174
174
$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /stamp.$$(crate ) ) ,)
175
- # Only install if this host and target combo is being prepared
175
+ # Only install if this host and target combo is being prepared. Also be sure to
176
+ # *not* install the rlibs for host crates because there's no need to statically
177
+ # link against most of them. They just produce a large amount of extra size
178
+ # bloat.
176
179
$$(if $$(findstring $(1 ) , $$(PREPARE_STAGE ) ) ,\
177
180
$$(if $$(findstring $(2 ) , $$(PREPARE_TARGETS ) ) ,\
178
181
$$(if $$(findstring $(3 ) , $$(PREPARE_HOST ) ) ,\
@@ -182,8 +185,7 @@ prepare-target-$(2)-host-$(3)-$(1): \
182
185
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate ) ) ) ) \
183
186
$$(if $$(findstring $(2 ) ,$$(CFG_HOST ) ) ,\
184
187
$$(foreach crate,$$(HOST_CRATES ) ,\
185
- $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2 ) ,$$(crate ) ) ) \
186
- $$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate ) ) ) ) ,) \
188
+ $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2 ) ,$$(crate ) ) ) ) ,) \
187
189
$$(call PREPARE_LIB,libmorestack.a) \
188
190
$$(call PREPARE_LIB,libcompiler-rt.a) ,) ,) ,)
189
191
endef
0 commit comments