Skip to content

Commit 8856a54

Browse files
committed
---
yaml --- r: 234973 b: refs/heads/stable c: f07b11d h: refs/heads/master i: 234971: 90e4bc3 v: v3
1 parent e6a3d1a commit 8856a54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+683
-1367
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 1659075b4aa3f9e61e8d9e27f2f00d768effbc8e
32+
refs/heads/stable: f07b11d07ecdf3fc983b14d68e3d9ecadadf7874
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
# * tidy-basic - show file / line stats
6363
# * tidy-errors - show the highest rustc error code
6464
# * tidy-features - show the status of language and lib features
65-
# * rustc-stage$(stage) - Only build up to a specific stage
6665
#
6766
# Then mix in some of these environment variables to harness the
6867
# ultimate power of The Rust Build System.
@@ -91,7 +90,7 @@
9190
#
9291
# # Rust recipes for build system success
9392
#
94-
# // Modifying libstd? Use this comment to run unit tests just on your change
93+
# // Modifying libstd? Use this command to run unit tests just on your change
9594
# make check-stage1-std NO_REBUILD=1 NO_BENCH=1
9695
#
9796
# // Added a run-pass test? Use this to test running your test

branches/stable/configure

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ do
11141114
fi
11151115
;;
11161116

1117-
*-msvc)
1117+
x86_64-*-msvc)
11181118
# Currently the build system is not configured to build jemalloc
11191119
# with MSVC, so we omit this optional dependency.
11201120
step_msg "targeting MSVC, disabling jemalloc"
@@ -1154,45 +1154,22 @@ do
11541154
CFG_MSVC_ROOT=$(echo "$install" | grep InstallDir | sed 's/.*REG_SZ[ ]*//')
11551155
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
11561156
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
1157-
putvar CFG_MSVC_ROOT
1158-
1159-
case $i in
1160-
x86_64-*)
1161-
bits=x86_64
1162-
msvc_part=amd64
1163-
;;
1164-
i686-*)
1165-
bits=i386
1166-
msvc_part=
1167-
;;
1168-
*)
1169-
err "can only target x86 targets for MSVC"
1170-
;;
1171-
esac
1172-
bindir="${CFG_MSVC_ROOT}/VC/bin"
1173-
if [ ! -z "$msvc_part" ]; then
1174-
bindir="$bindir/$msvc_part"
1175-
fi
1176-
eval CFG_MSVC_BINDIR_$bits="\"$bindir\""
1177-
eval CFG_MSVC_CL_$bits="\"$bindir/cl.exe\""
1178-
eval CFG_MSVC_LIB_$bits="\"$bindir/lib.exe\""
1179-
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""
1157+
CFG_MSVC_CL="${CFG_MSVC_ROOT}/VC/bin/amd64/cl.exe"
1158+
CFG_MSVC_LIB="${CFG_MSVC_ROOT}/VC/bin/amd64/lib.exe"
1159+
CFG_MSVC_LINK="${CFG_MSVC_ROOT}/VC/bin/amd64/link.exe"
11801160

11811161
vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
1182-
include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
1162+
CFG_MSVC_INCLUDE_PATH=$(cmd /c "\"$vcvarsall\" amd64 && cmd /c echo %INCLUDE%")
11831163
need_ok "failed to learn about MSVC's INCLUDE"
1184-
lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%")
1164+
CFG_MSVC_LIB_PATH=$(cmd /c "\"$vcvarsall\" amd64 && cmd /c echo %LIB%")
11851165
need_ok "failed to learn about MSVC's LIB"
11861166

1187-
eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\""
1188-
eval CFG_MSVC_LIB_PATH_${bits}="\"$lib_path\""
1189-
1190-
putvar CFG_MSVC_BINDIR_${bits}
1191-
putvar CFG_MSVC_CL_${bits}
1192-
putvar CFG_MSVC_LIB_${bits}
1193-
putvar CFG_MSVC_LINK_${bits}
1194-
putvar CFG_MSVC_INCLUDE_PATH_${bits}
1195-
putvar CFG_MSVC_LIB_PATH_${bits}
1167+
putvar CFG_MSVC_ROOT
1168+
putvar CFG_MSVC_CL
1169+
putvar CFG_MSVC_LIB
1170+
putvar CFG_MSVC_LINK
1171+
putvar CFG_MSVC_INCLUDE_PATH
1172+
putvar CFG_MSVC_LIB_PATH
11961173
;;
11971174

11981175
*)
@@ -1431,19 +1408,8 @@ do
14311408

14321409
msg "configuring LLVM with:"
14331410
msg "$CMAKE_ARGS"
1434-
case "$t" in
1435-
x86_64-*)
1436-
generator="Visual Studio 12 2013 Win64"
1437-
;;
1438-
i686-*)
1439-
generator="Visual Studio 12 2013"
1440-
;;
1441-
*)
1442-
err "can only build LLVM for x86 platforms"
1443-
;;
1444-
esac
14451411
(cd $LLVM_BUILD_DIR && "$CFG_CMAKE" $CFG_LLVM_SRC_DIR \
1446-
-G "$generator" \
1412+
-G "Visual Studio 12 2013 Win64" \
14471413
$CMAKE_ARGS)
14481414
need_ok "LLVM cmake configure failed"
14491415
fi

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 5 additions & 5 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="$(CFG_MSVC_CL_x86_64)" -nologo
3-
LINK_x86_64-pc-windows-msvc="$(CFG_MSVC_LINK_x86_64)" -nologo
4-
CXX_x86_64-pc-windows-msvc="$(CFG_MSVC_CL_x86_64)" -nologo
5-
CPP_x86_64-pc-windows-msvc="$(CFG_MSVC_CL_x86_64)" -nologo
6-
AR_x86_64-pc-windows-msvc="$(CFG_MSVC_LIB_x86_64)" -nologo
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,lib}

branches/stable/mk/platform.mk

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,23 @@ endef
239239
$(foreach target,$(CFG_TARGET), \
240240
$(eval $(call CFG_MAKE_TOOLCHAIN,$(target))))
241241

242+
# These two environment variables are scraped by the `./configure` script and
243+
# are necessary for `cl.exe` to find standard headers (the INCLUDE variable) and
244+
# for `link.exe` to find standard libraries (the LIB variable).
245+
ifdef CFG_MSVC_INCLUDE_PATH
246+
export INCLUDE := $(CFG_MSVC_INCLUDE_PATH)
247+
endif
248+
ifdef CFG_MSVC_LIB_PATH
249+
export LIB := $(CFG_MSVC_LIB_PATH)
250+
endif
251+
252+
# Unfortunately `link.exe` is also a program in `/usr/bin` on MinGW installs,
253+
# but it's not the one that we want. As a result we make sure that our detected
254+
# `link.exe` shows up in PATH first.
255+
ifdef CFG_MSVC_LINK
256+
export PATH := $(CFG_MSVC_ROOT)/VC/bin/amd64:$(PATH)
257+
endif
258+
242259
# There are more comments about this available in the target specification for
243260
# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe`
244261
# instead of `lib.exe` for assembling archives, so we need to inject this custom
@@ -290,4 +307,3 @@ endef
290307

291308
$(foreach target,$(CFG_TARGET), \
292309
$(eval $(call ADD_RUSTC_LLVM_DEF_TO_MSVC,$(target))))
293-

branches/stable/mk/rt.mk

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5555
rust_android_dummy.c
5656
NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S
5757
ifeq ($$(findstring msvc,$(1)),msvc)
58-
ifeq ($$(findstring i686,$(1)),i686)
59-
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_32.ll
60-
else
6158
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_64.ll
62-
endif
6359
else
6460
NATIVE_DEPS_rustrt_native_$(1) += rust_try.ll
6561
endif
@@ -97,17 +93,6 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.S $$(MKFILE_DEPS) \
9793
@mkdir -p $$(@D)
9894
@$$(call E, compile: $$@)
9995
$$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
100-
101-
# On MSVC targets the compiler's default include path (e.g. where to find system
102-
# headers) is specified by the INCLUDE environment variable. This may not be set
103-
# so the ./configure script scraped the relevant values and this is the location
104-
# that we put them into cl.exe's environment.
105-
ifeq ($$(findstring msvc,$(1)),msvc)
106-
$$(RT_OUTPUT_DIR_$(1))/%.o: \
107-
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(1)))
108-
$(1)/rustllvm/%.o: \
109-
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(1)))
110-
endif
11196
endef
11297

11398
$(foreach target,$(CFG_TARGET),$(eval $(call NATIVE_LIBRARIES,$(target))))
@@ -255,12 +240,8 @@ COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1))
255240
ifeq ($$(findstring msvc,$(1)),msvc)
256241
COMPRT_CC_$(1) := gcc
257242
COMPRT_AR_$(1) := ar
258-
ifeq ($$(findstring i686,$(1)),i686)
259-
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m32
260-
else
261243
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m64
262244
endif
263-
endif
264245

265246
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
266247
@$$(call E, make: compiler-rt)

branches/stable/mk/target.mk

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -220,40 +220,3 @@ $(foreach target,$(CFG_TARGET), \
220220
$(foreach crate,$(CRATES), \
221221
$(foreach tool,$(NATIVE_TOOL_DEPS_$(crate)_T_$(target)), \
222222
$(eval $(call MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR,0,$(target),$(BOOTSTRAP_FROM_$(target)),$(crate),$(tool))))))
223-
224-
# For MSVC targets we need to set up some environment variables for the linker
225-
# to work correctly when building Rust crates. These two variables are:
226-
#
227-
# - LIB tells the linker the default search path for finding system libraries,
228-
# for example kernel32.dll
229-
# - PATH needs to be modified to ensure that MSVC's link.exe is first in the
230-
# path instead of MinGW's /usr/bin/link.exe (entirely unrelated)
231-
#
232-
# The values for these variables are detected by the configure script.
233-
define SETUP_LIB_MSVC_ENV_VARS
234-
ifeq ($$(findstring msvc,$(2)),msvc)
235-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
236-
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2)))
237-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
238-
export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH)
239-
endif
240-
endef
241-
define SETUP_TOOL_MSVC_ENV_VARS
242-
ifeq ($$(findstring msvc,$(2)),msvc)
243-
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
244-
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2)))
245-
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
246-
export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH)
247-
endif
248-
endef
249-
250-
$(foreach host,$(CFG_HOST), \
251-
$(foreach target,$(CFG_TARGET), \
252-
$(foreach stage,$(STAGES), \
253-
$(foreach crate,$(CRATES), \
254-
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,$(stage),$(target),$(host),$(crate)))))))
255-
$(foreach host,$(CFG_HOST), \
256-
$(foreach target,$(CFG_TARGET), \
257-
$(foreach stage,$(STAGES), \
258-
$(foreach tool,$(TOOLS), \
259-
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,$(stage),$(target),$(host),$(tool)))))))

branches/stable/src/libcore/num/f32.rs

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -215,37 +215,13 @@ impl Float for f32 {
215215
/// Rounds towards minus infinity.
216216
#[inline]
217217
fn floor(self) -> f32 {
218-
return floorf(self);
219-
220-
// On MSVC LLVM will lower many math intrinsics to a call to the
221-
// corresponding function. On MSVC, however, many of these functions
222-
// aren't actually available as symbols to call, but rather they are all
223-
// `static inline` functions in header files. This means that from a C
224-
// perspective it's "compatible", but not so much from an ABI
225-
// perspective (which we're worried about).
226-
//
227-
// The inline header functions always just cast to a f64 and do their
228-
// operation, so we do that here as well, but only for MSVC targets.
229-
//
230-
// Note that there are many MSVC-specific float operations which
231-
// redirect to this comment, so `floorf` is just one case of a missing
232-
// function on MSVC, but there are many others elsewhere.
233-
#[cfg(target_env = "msvc")]
234-
fn floorf(f: f32) -> f32 { (f as f64).floor() as f32 }
235-
#[cfg(not(target_env = "msvc"))]
236-
fn floorf(f: f32) -> f32 { unsafe { intrinsics::floorf32(f) } }
218+
unsafe { intrinsics::floorf32(self) }
237219
}
238220

239221
/// Rounds towards plus infinity.
240222
#[inline]
241223
fn ceil(self) -> f32 {
242-
return ceilf(self);
243-
244-
// see notes above in `floor`
245-
#[cfg(target_env = "msvc")]
246-
fn ceilf(f: f32) -> f32 { (f as f64).ceil() as f32 }
247-
#[cfg(not(target_env = "msvc"))]
248-
fn ceilf(f: f32) -> f32 { unsafe { intrinsics::ceilf32(f) } }
224+
unsafe { intrinsics::ceilf32(self) }
249225
}
250226

251227
/// Rounds to nearest integer. Rounds half-way cases away from zero.
@@ -323,13 +299,7 @@ impl Float for f32 {
323299

324300
#[inline]
325301
fn powf(self, n: f32) -> f32 {
326-
return powf(self, n);
327-
328-
// see notes above in `floor`
329-
#[cfg(target_env = "msvc")]
330-
fn powf(f: f32, n: f32) -> f32 { (f as f64).powf(n as f64) as f32 }
331-
#[cfg(not(target_env = "msvc"))]
332-
fn powf(f: f32, n: f32) -> f32 { unsafe { intrinsics::powf32(f, n) } }
302+
unsafe { intrinsics::powf32(self, n) }
333303
}
334304

335305
#[inline]
@@ -347,13 +317,7 @@ impl Float for f32 {
347317
/// Returns the exponential of the number.
348318
#[inline]
349319
fn exp(self) -> f32 {
350-
return expf(self);
351-
352-
// see notes above in `floor`
353-
#[cfg(target_env = "msvc")]
354-
fn expf(f: f32) -> f32 { (f as f64).exp() as f32 }
355-
#[cfg(not(target_env = "msvc"))]
356-
fn expf(f: f32) -> f32 { unsafe { intrinsics::expf32(f) } }
320+
unsafe { intrinsics::expf32(self) }
357321
}
358322

359323
/// Returns 2 raised to the power of the number.
@@ -365,13 +329,7 @@ impl Float for f32 {
365329
/// Returns the natural logarithm of the number.
366330
#[inline]
367331
fn ln(self) -> f32 {
368-
return logf(self);
369-
370-
// see notes above in `floor`
371-
#[cfg(target_env = "msvc")]
372-
fn logf(f: f32) -> f32 { (f as f64).ln() as f32 }
373-
#[cfg(not(target_env = "msvc"))]
374-
fn logf(f: f32) -> f32 { unsafe { intrinsics::logf32(f) } }
332+
unsafe { intrinsics::logf32(self) }
375333
}
376334

377335
/// Returns the logarithm of the number with respect to an arbitrary base.
@@ -387,13 +345,7 @@ impl Float for f32 {
387345
/// Returns the base 10 logarithm of the number.
388346
#[inline]
389347
fn log10(self) -> f32 {
390-
return log10f(self);
391-
392-
// see notes above in `floor`
393-
#[cfg(target_env = "msvc")]
394-
fn log10f(f: f32) -> f32 { (f as f64).log10() as f32 }
395-
#[cfg(not(target_env = "msvc"))]
396-
fn log10f(f: f32) -> f32 { unsafe { intrinsics::log10f32(f) } }
348+
unsafe { intrinsics::log10f32(self) }
397349
}
398350

399351
/// Converts to degrees, assuming the number is in radians.

0 commit comments

Comments
 (0)