Skip to content

Commit 3cf0b9b

Browse files
committed
mk: Don't install host rlibs
You rarely want to statically link against librustc and friends, so there's no real reason to install the rlib version of these libraries, especially because the rlibs are massive.
1 parent 991d466 commit 3cf0b9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mk/prepare.mk

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# It requires the following variables to be set:
1818
#
19-
# PREPARE_HOST - the host triple
19+
# PREPARE_HOST - the host triple
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

@@ -172,7 +172,10 @@ prepare-target-$(2)-host-$(3)-$(1): \
172172
$$(if $$(findstring $(2),$$(CFG_HOST)), \
173173
$$(foreach crate,$$(HOST_CRATES), \
174174
$$(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.
176179
$$(if $$(findstring $(1), $$(PREPARE_STAGE)),\
177180
$$(if $$(findstring $(2), $$(PREPARE_TARGETS)),\
178181
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
@@ -182,8 +185,7 @@ prepare-target-$(2)-host-$(3)-$(1): \
182185
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate))))\
183186
$$(if $$(findstring $(2),$$(CFG_HOST)),\
184187
$$(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)))),)\
187189
$$(call PREPARE_LIB,libmorestack.a) \
188190
$$(call PREPARE_LIB,libcompiler-rt.a),),),)
189191
endef

0 commit comments

Comments
 (0)