Skip to content

Commit 4bced5f

Browse files
committed
---
yaml --- r: 225070 b: refs/heads/stable c: 7cf0b17 h: refs/heads/master v: v3
1 parent 4709a7d commit 4bced5f

File tree

3 files changed

+84
-12
lines changed

3 files changed

+84
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: ee258c548f0303b8d1e315b0c9cb54fa59ad25d1
32+
refs/heads/stable: 7cf0b1798bddad33876258d6715b363896252e40
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/configure

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,65 @@ do
10841084
err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found"
10851085
fi
10861086
;;
1087+
1088+
x86_64-*-msvc)
1089+
# Currently the build system is not configured to build jemalloc
1090+
# with MSVC, so we omit this optional dependency.
1091+
step_msg "targeting MSVC, disabling jemalloc"
1092+
CFG_DISABLE_JEMALLOC=1
1093+
putvar CFG_DISABLE_JEMALLOC
1094+
1095+
# There are some MSYS python builds which will auto-translate
1096+
# windows-style paths to MSYS-style paths in Python itself.
1097+
# Unfortunately this breaks LLVM's build system as somewhere along
1098+
# the line LLVM prints a path into a file from Python and then CMake
1099+
# later tries to interpret that path. If Python prints a MSYS path
1100+
# and CMake tries to use it as a Windows path, you're gonna have a
1101+
# Bad Time.
1102+
#
1103+
# Consequently here we try to detect when that happens and print an
1104+
# error if it does.
1105+
if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/'
1106+
then
1107+
err "python is silently translating windows paths to MSYS paths \
1108+
and the build will fail if this python is used.\n\n \
1109+
Either an official python install must be used or an \
1110+
alternative python package in MinGW must be used."
1111+
fi
1112+
1113+
# MSVC requires cmake because that's how we're going to build LLVM
1114+
probe_need CFG_CMAKE cmake
1115+
1116+
# Use the REG program to figure out where VS is installed
1117+
# We need to figure out where cl.exe and link.exe are, so we do some
1118+
# munging and some probing here. We also look for the default
1119+
# INCLUDE and LIB variables for MSVC so we can set those in the
1120+
# build system as well.
1121+
install=$(reg QUERY \
1122+
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1123+
-v InstallDir)
1124+
need_ok "couldn't find visual studio install root"
1125+
CFG_MSVC_ROOT=$(echo "$install" | grep InstallDir | sed 's/.*REG_SZ[ ]*//')
1126+
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
1127+
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
1128+
CFG_MSVC_CL="${CFG_MSVC_ROOT}/VC/bin/amd64/cl.exe"
1129+
CFG_MSVC_LIB="${CFG_MSVC_ROOT}/VC/bin/amd64/lib.exe"
1130+
CFG_MSVC_LINK="${CFG_MSVC_ROOT}/VC/bin/amd64/link.exe"
1131+
1132+
vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
1133+
CFG_MSVC_INCLUDE_PATH=$(cmd /c "\"$vcvarsall\" amd64 && cmd /c echo %INCLUDE%")
1134+
need_ok "failed to learn about MSVC's INCLUDE"
1135+
CFG_MSVC_LIB_PATH=$(cmd /c "\"$vcvarsall\" amd64 && cmd /c echo %LIB%")
1136+
need_ok "failed to learn about MSVC's LIB"
1137+
1138+
putvar CFG_MSVC_ROOT
1139+
putvar CFG_MSVC_CL
1140+
putvar CFG_MSVC_LIB
1141+
putvar CFG_MSVC_LINK
1142+
putvar CFG_MSVC_INCLUDE_PATH
1143+
putvar CFG_MSVC_LIB_PATH
1144+
;;
1145+
10871146
*)
10881147
;;
10891148
esac
@@ -1125,6 +1184,7 @@ do
11251184
do
11261185
make_dir $t/rt/stage$s
11271186
make_dir $t/rt/jemalloc
1187+
make_dir $t/rt/compiler-rt
11281188
for i in \
11291189
isaac sync test \
11301190
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
@@ -1496,11 +1556,6 @@ do
14961556
putvar $CFG_LLVM_INST_DIR
14971557
done
14981558

1499-
# Munge any paths that appear in config.mk back to posix-y
1500-
cp config.tmp config.tmp.bak
1501-
sed -e 's@ \([a-zA-Z]\):[/\\]@ /\1/@g;' <config.tmp.bak >config.tmp
1502-
rm -f config.tmp.bak
1503-
15041559
msg
15051560
copy_if_changed ${CFG_SRC_DIR}Makefile.in ./Makefile
15061561
move_if_changed config.tmp config.mk

branches/stable/mk/cfg/x86_64-pc-windows-msvc.mk

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# x86_64-pc-windows-msvc configuration
2-
CC_x86_64-pc-windows-msvc=cl
3-
LINK_x86_64-pc-windows-msvc=link
4-
CXX_x86_64-pc-windows-msvc=cl
5-
CPP_x86_64-pc-windows-msvc=cl
6-
AR_x86_64-pc-windows-msvc=llvm-ar
2+
CC_x86_64-pc-windows-msvc="$(CFG_MSVC_CL)" -nologo
3+
LINK_x86_64-pc-windows-msvc="$(CFG_MSVC_LINK)" -nologo
4+
CXX_x86_64-pc-windows-msvc="$(CFG_MSVC_CL)" -nologo
5+
CPP_x86_64-pc-windows-msvc="$(CFG_MSVC_CL)" -nologo
6+
AR_x86_64-pc-windows-msvc="$(CFG_MSVC_LIB)" -nologo
77
CFG_LIB_NAME_x86_64-pc-windows-msvc=$(1).dll
88
CFG_STATIC_LIB_NAME_x86_64-pc-windows-msvc=$(1).lib
99
CFG_LIB_GLOB_x86_64-pc-windows-msvc=$(1)-*.dll
@@ -21,4 +21,21 @@ CFG_UNIXY_x86_64-pc-windows-msvc :=
2121
CFG_LDPATH_x86_64-pc-windows-msvc :=
2222
CFG_RUN_x86_64-pc-windows-msvc=$(2)
2323
CFG_RUN_TARG_x86_64-pc-windows-msvc=$(call CFG_RUN_x86_64-pc-windows-msvc,,$(2))
24-
CFG_GNU_TRIPLE_x86_64-pc-windows-msvc := x86_64-pc-windows-msvc
24+
CFG_GNU_TRIPLE_x86_64-pc-windows-msvc := x86_64-pc-win32
25+
26+
# These two environment variables are scraped by the `./configure` script and
27+
# are necessary for `cl.exe` to find standard headers (the INCLUDE variable) and
28+
# for `link.exe` to find standard libraries (the LIB variable).
29+
ifdef CFG_MSVC_INCLUDE_PATH
30+
export INCLUDE := $(CFG_MSVC_INCLUDE_PATH)
31+
endif
32+
ifdef CFG_MSVC_LIB_PATH
33+
export LIB := $(CFG_MSVC_LIB_PATH)
34+
endif
35+
36+
# Unfortunately `link.exe` is also a program in `/usr/bin` on MinGW installs,
37+
# but it's not the one that we want. As a result we make sure that our detected
38+
# `link.exe` shows up in PATH first.
39+
ifdef CFG_MSVC_LINK
40+
export PATH := $(CFG_MSVC_ROOT)/VC/bin/amd64:$(PATH)
41+
endif

0 commit comments

Comments
 (0)