Skip to content

Commit 12749fc

Browse files
committed
mk/rt: use CFG_LLVM_TARGET instead of plain target when calling llc
We add CFG_LLVM_TARGET_$(target) (which can be defined in any of the mk/cfg/* files) and supply a default to the plain target name CFG_LLVM_TARGET mirrors the value of llvm_target (aka llvm-target) in the librustc_back runtime target specification.
1 parent 9c320dd commit 12749fc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

mk/main.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ endif
190190
# Target-and-rule "utility variables"
191191
######################################################################
192192

193-
define DEF_X
193+
define DEF_FOR_TARGET
194194
X_$(1) := $(CFG_EXE_SUFFIX_$(1))
195+
ifndef CFG_LLVM_TARGET_$(1)
196+
CFG_LLVM_TARGET_$(1) := $(1)
197+
endif
195198
endef
196199
$(foreach target,$(CFG_TARGET), \
197-
$(eval $(call DEF_X,$(target))))
200+
$(eval $(call DEF_FOR_TARGET,$(target))))
198201

199202
# "Source" files we generate in builddir along the way.
200203
GENERATED :=

mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
7575
@mkdir -p $$(@D)
7676
@$$(call E, compile: $$@)
7777
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
78-
-filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
78+
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
7979

8080
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
8181
@mkdir -p $$(@D)

0 commit comments

Comments
 (0)