Skip to content

Commit 31d383f

Browse files
committed
Remove STARTUP_OBJS from Makefile deps for non win-gnu targets.
The `rsbegin.o` and `rsend.o` build products should not be generated on non WinGnu platforms. This is another path to resolving #30063 for non win-gnu targets. (And it won't require a snapshot, unlike PR #30208.)
1 parent 4dbdfb4 commit 31d383f

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

mk/cfg/i686-pc-windows-gnu.mk

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ CFG_RUN_TARG_i686-pc-windows-gnu=$(call CFG_RUN_i686-pc-windows-gnu,,$(2))
2424
CFG_GNU_TRIPLE_i686-pc-windows-gnu := i686-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
27+
CFG_RUSTRT_HAS_STARTUP_OBJS_i686-pc-windows-gnu := 1

mk/cfg/x86_64-pc-windows-gnu.mk

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ CFG_RUN_TARG_x86_64-pc-windows-gnu=$(call CFG_RUN_x86_64-pc-windows-gnu,,$(2))
2424
CFG_GNU_TRIPLE_x86_64-pc-windows-gnu := x86_64-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
27+
CFG_RUSTRT_HAS_STARTUP_OBJS_x86_64-pc-windows-gnu := 1

mk/target.mk

+2
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(4).o: \
152152
@$$(call E, rustc: $$@)
153153
$$(STAGE$(1)_T_$(2)_H_$(3)) --emit=obj -o $$@ $$<
154154

155+
ifeq ($$(CFG_RUSTRT_HAS_STARTUP_OBJS_$(2)), 1)
155156
# Add dependencies on Rust startup objects to all crates that depend on core.
156157
# This ensures that they are built after core (since they depend on it),
157158
# but before everything else (since they are needed for linking dylib crates).
158159
$$(foreach crate, $$(TARGET_CRATES), \
159160
$$(if $$(findstring core,$$(DEPS_$$(crate))), \
160161
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))) : $$(TLIB$(1)_T_$(2)_H_$(3))/$(4).o
162+
endif
161163

162164
endef
163165

0 commit comments

Comments
 (0)