Skip to content

Commit cc84121

Browse files
committed
---
yaml --- r: 60814 b: refs/heads/auto c: 2b08337 h: refs/heads/master v: v3
1 parent 912efc0 commit cc84121

File tree

244 files changed

+3006
-5480
lines changed

Some content is hidden

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

244 files changed

+3006
-5480
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 35655a0fb3bde60985d5f92437a729c37bb8755a
17+
refs/heads/auto: 2b083373e4ac973bad8e3c2b949d6c12991bd623
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ DRIVER_CRATE := $(S)src/driver/driver.rs
275275

276276
# FIXME: x86-ism
277277
LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit \
278-
interpreter instrumentation
278+
interpreter
279279

280280
define DEF_LLVM_VARS
281281
# The configure script defines these variables with the target triples

branches/auto/configure

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
376376
opt manage-submodules 1 "let the build manage the git submodules"
377377
opt mingw-cross 0 "cross-compile for win32 using mingw"
378378
opt clang 0 "prefer clang to gcc for building the runtime"
379+
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
379380
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
380381
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
381382
valopt prefix "/usr/local" "set installation prefix"
@@ -421,6 +422,7 @@ else
421422
fi
422423

423424
probe CFG_CLANG clang++
425+
probe CFG_CCACHE ccache
424426
probe CFG_GCC gcc
425427
probe CFG_LD ld
426428
probe CFG_VALGRIND valgrind
@@ -555,11 +557,11 @@ then
555557
CFG_CLANG_VERSION=$("$CFG_CLANG" \
556558
--version \
557559
| grep version \
558-
| sed 's/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \
560+
| sed 's/.*\(version .*\)/\1/' \
559561
| cut -d ' ' -f 2)
560562

561563
case $CFG_CLANG_VERSION in
562-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3*)
564+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 4.0* | 4.1* | 4.2*)
563565
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
564566
CFG_C_COMPILER="clang"
565567
;;
@@ -571,6 +573,16 @@ else
571573
CFG_C_COMPILER="gcc"
572574
fi
573575

576+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
577+
then
578+
if [ -z "$CFG_CCACHE" ]
579+
then
580+
err "ccache requested but not found"
581+
fi
582+
583+
CFG_C_COMPILER="ccache $CFG_C_COMPILER"
584+
fi
585+
574586
# a little post-processing of various config values
575587

576588
CFG_PREFIX=${CFG_PREFIX%/}
@@ -825,20 +837,35 @@ do
825837
--enable-bindings=none --disable-threads \
826838
--disable-pthreads"
827839

828-
if [ "$CFG_C_COMPILER" = "clang" ]
829-
then
840+
case "$CFG_C_COMPILER" in
841+
("ccache clang")
842+
LLVM_CXX_32="ccache clang++ -m32 -Qunused-arguments"
843+
LLVM_CC_32="ccache clang -m32 -Qunused-arguments"
844+
845+
LLVM_CXX_64="ccache clang++ -Qunused-arguments"
846+
LLVM_CC_64="ccache clang -Qunused-arguments"
847+
;;
848+
("clang")
830849
LLVM_CXX_32="clang++ -m32"
831850
LLVM_CC_32="clang -m32"
832851

833852
LLVM_CXX_64="clang++"
834853
LLVM_CC_64="clang"
835-
else
854+
;;
855+
("ccache gcc")
856+
LLVM_CXX_32="ccache g++ -m32"
857+
LLVM_CC_32="ccache gcc -m32"
858+
859+
LLVM_CXX_64="ccache g++"
860+
LLVM_CC_64="ccache gcc"
861+
;;
862+
("gcc")
836863
LLVM_CXX_32="g++ -m32"
837864
LLVM_CC_32="gcc -m32"
838865

839866
LLVM_CXX_64="g++"
840867
LLVM_CC_64="gcc"
841-
fi
868+
esac
842869

843870
LLVM_CFLAGS_32="-m32"
844871
LLVM_CXXFLAGS_32="-m32"
@@ -935,6 +962,14 @@ then
935962
putvar CFG_PAXCTL
936963
fi
937964

965+
# Avoid spurious warnings from clang by feeding it original source on
966+
# ccache-miss rather than preprocessed input.
967+
if [ ! -z "$CFG_ENABLE_CCACHE" ] && [ ! -z "$CFG_ENABLE_CLANG" ]
968+
then
969+
CFG_CCACHE_CPP2=1
970+
putvar CFG_CCACHE_CPP2
971+
fi
972+
938973
if [ ! -z $BAD_PANDOC ]
939974
then
940975
CFG_PANDOC=

branches/auto/doc/tutorial-tasks.md

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ let result = ports.foldl(0, |accum, port| *accum + port.recv() );
284284
# fn some_expensive_computation(_i: uint) -> int { 42 }
285285
~~~
286286

287-
## Backgrounding computations: Futures
287+
## Futures
288288
With `extra::future`, rust has a mechanism for requesting a computation and getting the result
289289
later.
290290

@@ -329,77 +329,6 @@ fn main() {
329329
}
330330
~~~
331331

332-
## Sharing immutable data without copy: ARC
333-
334-
To share immutable data between tasks, a first approach would be to only use pipes as we have seen
335-
previously. A copy of the data to share would then be made for each task. In some cases, this would
336-
add up to a significant amount of wasted memory and would require copying the same data more than
337-
necessary.
338-
339-
To tackle this issue, one can use an Atomically Reference Counted wrapper (`ARC`) as implemented in
340-
the `extra` library of Rust. With an ARC, the data will no longer be copied for each task. The ARC
341-
acts as a reference to the shared data and only this reference is shared and cloned.
342-
343-
Here is a small example showing how to use ARCs. We wish to run concurrently several computations on
344-
a single large vector of floats. Each task needs the full vector to perform its duty.
345-
~~~
346-
use extra::arc::ARC;
347-
348-
fn pnorm(nums: &~[float], p: uint) -> float {
349-
(vec::foldl(0.0, *nums, |a,b| a+(*b).pow(p as float) )).pow(1f / (p as float))
350-
}
351-
352-
fn main() {
353-
let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
354-
println(fmt!("Inf-norm = %?", numbers.max()));
355-
356-
let numbers_arc = ARC(numbers);
357-
358-
for uint::range(1,10) |num| {
359-
let (port, chan) = stream();
360-
chan.send(numbers_arc.clone());
361-
362-
do spawn {
363-
let local_arc : ARC<~[float]> = port.recv();
364-
let task_numbers = local_arc.get();
365-
println(fmt!("%u-norm = %?", num, pnorm(task_numbers, num)));
366-
}
367-
}
368-
}
369-
~~~
370-
371-
The function `pnorm` performs a simple computation on the vector (it computes the sum of its items
372-
at the power given as argument and takes the inverse power of this value). The ARC on the vector is
373-
created by the line
374-
~~~
375-
# use extra::arc::ARC;
376-
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
377-
let numbers_arc=ARC(numbers);
378-
~~~
379-
and a clone of it is sent to each task
380-
~~~
381-
# use extra::arc::ARC;
382-
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
383-
# let numbers_arc = ARC(numbers);
384-
# let (port, chan) = stream();
385-
chan.send(numbers_arc.clone());
386-
~~~
387-
copying only the wrapper and not its contents.
388-
389-
Each task recovers the underlying data by
390-
~~~
391-
# use extra::arc::ARC;
392-
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
393-
# let numbers_arc=ARC(numbers);
394-
# let (port, chan) = stream();
395-
# chan.send(numbers_arc.clone());
396-
# let local_arc : ARC<~[float]> = port.recv();
397-
let task_numbers = local_arc.get();
398-
~~~
399-
and can use it as if it were local.
400-
401-
The `arc` module also implements ARCs around mutable data that are not covered here.
402-
403332
# Handling task failure
404333

405334
Rust has a built-in mechanism for raising exceptions. The `fail!()` macro

branches/auto/mk/platform.mk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,35 @@ ifeq ($(CFG_C_COMPILER),gcc)
105105
ifeq ($(origin CPP),default)
106106
CPP=gcc
107107
endif
108+
else
109+
ifeq ($(CFG_C_COMPILER),ccache clang)
110+
# The -Qunused-arguments sidesteps spurious warnings from clang
111+
ifeq ($(origin CC),default)
112+
CC=ccache clang -Qunused-arguments
113+
endif
114+
ifeq ($(origin CXX),default)
115+
CXX=ccache clang++ -Qunused-arguments
116+
endif
117+
ifeq ($(origin CPP),default)
118+
CPP=ccache clang -Qunused-arguments
119+
endif
120+
else
121+
ifeq ($(CFG_C_COMPILER),ccache gcc)
122+
ifeq ($(origin CC),default)
123+
CC=ccache gcc
124+
endif
125+
ifeq ($(origin CXX),default)
126+
CXX=ccache g++
127+
endif
128+
ifeq ($(origin CPP),default)
129+
CPP=ccache gcc
130+
endif
108131
else
109132
CFG_ERR := $(error please try on a system with gcc or clang)
110133
endif
111134
endif
135+
endif
136+
endif
112137

113138

114139
# x86_64-unknown-linux-gnu configuration
@@ -366,6 +391,10 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
366391
CFG_RUN_x86_64-unknown-freebsd=$(2)
367392
CFG_RUN_TARG_x86_64-unknown-freebsd=$(call CFG_RUN_x86_64-unknown-freebsd,,$(2))
368393

394+
ifeq ($(CFG_CCACHE_CPP2),1)
395+
CCACHE_CPP2=1
396+
export CCACHE_CPP
397+
endif
369398

370399
define CFG_MAKE_TOOLCHAIN
371400
CFG_COMPILE_C_$(1) = $$(CC_$(1)) \

branches/auto/mk/rustllvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LLVM_EXTRA_INCDIRS_$(1)= -iquote $(S)src/llvm/include \
2222
-iquote llvm/$(1)/include
2323
endif
2424

25-
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustWrapper.cpp PassWrapper.cpp)
25+
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustWrapper.cpp)
2626

2727
RUSTLLVM_DEF_$(1) := rustllvm/rustllvm$(CFG_DEF_SUFFIX_$(1))
2828

branches/auto/mk/target.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11-
# This is the compile-time target-triple for the compiler. For the compiler at
12-
# runtime, this should be considered the host-triple. More explanation for why
13-
# this exists can be found on issue #2400
14-
export CFG_COMPILER_TRIPLE
15-
1611
# TARGET_STAGE_N template: This defines how target artifacts are built
1712
# for all stage/target architecture combinations. The arguments:
1813
# $(1) is the stage
@@ -67,7 +62,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
6762
@$$(call E, cp: $$@)
6863
$$(Q)cp $$< $$@
6964

70-
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): CFG_COMPILER_TRIPLE = $(2)
7165
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
7266
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
7367
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)) \

branches/auto/mk/tests.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ define TEST_RUNNER
284284
# If NO_REBUILD is set then break the dependencies on extra so we can
285285
# test crates without rebuilding std and extra first
286286
ifeq ($(NO_REBUILD),)
287-
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
287+
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
288288
else
289289
STDTESTDEP_$(1)_$(2)_$(3) =
290290
endif
@@ -307,7 +307,6 @@ $(3)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
307307
@$$(call E, compile_and_link: $$@)
308308
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
309309

310-
$(3)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): CFG_COMPILER_TRIPLE = $(2)
311310
$(3)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): \
312311
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
313312
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM_$(2)) \

branches/auto/src/compiletest/compiletest.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#[allow(non_camel_case_types)];
1414

15-
#[no_core]; // XXX: Remove after snapshot
1615
#[no_std];
1716

1817
extern mod core(name = "std", vers = "0.7-pre");

0 commit comments

Comments
 (0)