Skip to content

Commit c2618dc

Browse files
committed
---
yaml --- r: 207418 b: refs/heads/tmp c: 64412a4 h: refs/heads/master v: v3
1 parent 1e62548 commit c2618dc

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: cd7d89af9169885642d43597302af69f842bbd78
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: ee64bab76cdaa375cc015a5eb3e3fd7581d2a7b3
35+
refs/heads/tmp: 64412a49bed9d6a743ed4d9108fc2da49ed5e9a9
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 704c2ee730d2e948d11a2edd77e3f35de8329a6e
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/mk/rt.mk

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,32 @@ COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
226226
COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
227227
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
228228

229+
# Note that on MSVC-targeting builds we hardwire CC/AR to gcc/ar even though
230+
# we're targeting MSVC. This is because although compiler-rt has a CMake build
231+
# config I can't actually figure out how to use it, so I'm not sure how to use
232+
# cl.exe to build the objects. Additionally, the compiler-rt library when built
233+
# with gcc has the same ABI as cl.exe, so they're largely compatible
234+
COMPRT_CC_$(1) := $$(CC_$(1))
235+
COMPRT_AR_$(1) := $$(AR_$(1))
236+
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1))
237+
ifeq ($$(findstring msvc,$(1)),msvc)
238+
COMPRT_CC_$(1) := gcc
239+
COMPRT_AR_$(1) := ar
240+
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m64
241+
endif
242+
229243
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
230244
@$$(call E, make: compiler-rt)
231245
$$(Q)$$(MAKE) -C "$(S)src/compiler-rt" \
232246
ProjSrcRoot="$(S)src/compiler-rt" \
233247
ProjObjRoot="$$(abspath $$(COMPRT_BUILD_DIR_$(1)))" \
234-
CC="$$(CC_$(1))" \
235-
AR="$$(AR_$(1))" \
236-
RANLIB="$$(AR_$(1)) s" \
237-
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
248+
CC='$$(COMPRT_CC_$(1))' \
249+
AR='$$(COMPRT_AR_$(1))' \
250+
RANLIB='$$(COMPRT_AR_$(1)) s' \
251+
CFLAGS="$$(COMPRT_CFLAGS_$(1))" \
238252
TargetTriple=$(1) \
239253
triple-builtins
240-
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
254+
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$@
241255

242256
################################################################################
243257
# libbacktrace

0 commit comments

Comments
 (0)