Skip to content

Commit 53f4bc3

Browse files
committed
Auto merge of #41138 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests - Successful merges: #40797, #41047, #41056, #41061, #41075, #41080, #41120, #41130, #41131 - Failed merges:
2 parents c438c1f + cd2310b commit 53f4bc3

File tree

34 files changed

+347
-196
lines changed

34 files changed

+347
-196
lines changed

appveyor.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,18 @@ install:
141141
- set SCCACHE_ERROR_LOG=%CD%/sccache.log
142142

143143
test_script:
144-
- appveyor-retry sh -c 'git submodule deinit -f . && git submodule update --init'
144+
- if not exist C:\cache\rustsrc\NUL mkdir C:\cache\rustsrc
145+
- sh src/ci/init_repo.sh . /c/cache/rustsrc
145146
- set SRC=.
146147
- set NO_CCACHE=1
147148
- sh src/ci/run.sh
148149

149150
on_failure:
150-
- cat %CD%/sccache.log
151+
- cat %CD%\sccache.log
152+
- cat C:\Users\appveyor\AppData\Local\Temp\1\build-cache-logs\*.log
151153

152154
cache:
155+
- C:\cache\rustsrc
153156
- "build/i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"
154157
- "build/x86_64-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"
155158
- "i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"

src/bootstrap/dist.rs

+22-19
Original file line numberDiff line numberDiff line change
@@ -433,29 +433,32 @@ pub fn rust_src(build: &Build) {
433433
copy(&build.src.join(item), &dst_src.join(item));
434434
}
435435

436-
// Get cargo-vendor installed, if it isn't already.
437-
let mut has_cargo_vendor = false;
438-
let mut cmd = Command::new(&build.cargo);
439-
for line in output(cmd.arg("install").arg("--list")).lines() {
440-
has_cargo_vendor |= line.starts_with("cargo-vendor ");
441-
}
442-
if !has_cargo_vendor {
436+
// If we're building from git sources, we need to vendor a complete distribution.
437+
if build.src_is_git {
438+
// Get cargo-vendor installed, if it isn't already.
439+
let mut has_cargo_vendor = false;
440+
let mut cmd = Command::new(&build.cargo);
441+
for line in output(cmd.arg("install").arg("--list")).lines() {
442+
has_cargo_vendor |= line.starts_with("cargo-vendor ");
443+
}
444+
if !has_cargo_vendor {
445+
let mut cmd = Command::new(&build.cargo);
446+
cmd.arg("install")
447+
.arg("--force")
448+
.arg("--debug")
449+
.arg("--vers").arg(CARGO_VENDOR_VERSION)
450+
.arg("cargo-vendor")
451+
.env("RUSTC", &build.rustc);
452+
build.run(&mut cmd);
453+
}
454+
455+
// Vendor all Cargo dependencies
443456
let mut cmd = Command::new(&build.cargo);
444-
cmd.arg("install")
445-
.arg("--force")
446-
.arg("--debug")
447-
.arg("--vers").arg(CARGO_VENDOR_VERSION)
448-
.arg("cargo-vendor")
449-
.env("RUSTC", &build.rustc);
457+
cmd.arg("vendor")
458+
.current_dir(&dst_src.join("src"));
450459
build.run(&mut cmd);
451460
}
452461

453-
// Vendor all Cargo dependencies
454-
let mut cmd = Command::new(&build.cargo);
455-
cmd.arg("vendor")
456-
.current_dir(&dst_src.join("src"));
457-
build.run(&mut cmd);
458-
459462
// Create source tarball in rust-installer format
460463
let mut cmd = Command::new(SH_CMD);
461464
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))

src/bootstrap/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ pub struct Build {
162162
cxx: HashMap<String, gcc::Tool>,
163163
crates: HashMap<String, Crate>,
164164
is_sudo: bool,
165+
src_is_git: bool,
165166
}
166167

167168
#[derive(Debug)]
@@ -233,6 +234,7 @@ impl Build {
233234
};
234235
let rust_info = channel::GitInfo::new(&src);
235236
let cargo_info = channel::GitInfo::new(&src.join("cargo"));
237+
let src_is_git = src.join(".git").exists();
236238

237239
Build {
238240
flags: flags,
@@ -251,6 +253,7 @@ impl Build {
251253
lldb_version: None,
252254
lldb_python_dir: None,
253255
is_sudo: is_sudo,
256+
src_is_git: src_is_git,
254257
}
255258
}
256259

@@ -307,10 +310,7 @@ impl Build {
307310
OutOfSync,
308311
}
309312

310-
if !self.config.submodules {
311-
return
312-
}
313-
if fs::metadata(self.src.join(".git")).is_err() {
313+
if !self.src_is_git || !self.config.submodules {
314314
return
315315
}
316316
let git = || {

src/bootstrap/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn check(build: &mut Build) {
6565

6666
// If we've got a git directory we're gona need git to update
6767
// submodules and learn about various other aspects.
68-
if fs::metadata(build.src.join(".git")).is_ok() {
68+
if build.src_is_git {
6969
need_cmd("git".as_ref());
7070
}
7171

src/ci/docker/README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,13 @@ For targets: `powerpc-unknown-linux-gnu`
152152
- Path and misc options > Patches origin = Bundled, then local
153153
- Path and misc options > Local patch directory = /tmp/patches
154154
- Target options > Target Architecture = powerpc
155-
- Target options > Emit assembly for CPU = power4 -- (+)
156-
- Target options > Tune for CPU = power6 -- (+)
155+
- Target options > Emit assembly for CPU = powerpc -- pure 32-bit PowerPC
157156
- Operating System > Target OS = linux
158157
- Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
159158
- C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
160159
- C compiler > gcc version = 4.9.3
161-
- C compiler > Core gcc extra config = --with-cpu-32=power4 --with-cpu=default32 -- (+)
162-
- C compiler > gcc extra config = --with-cpu-32=power4 --with-cpu=default32 -- (+)
163160
- C compiler > C++ = ENABLE -- to cross compile LLVM
164161

165-
(+) These CPU options match the configuration of the toolchains in RHEL6.
166-
167162
## `powerpc64-linux-gnu.config`
168163

169164
For targets: `powerpc64-unknown-linux-gnu`

src/ci/docker/dist-fuchsia/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1414
xz-utils \
1515
swig \
1616
libedit-dev \
17-
libncurses5-dev
17+
libncurses5-dev \
18+
patch
1819

1920
RUN curl -L https://cmake.org/files/v3.8/cmake-3.8.0-rc1-Linux-x86_64.tar.gz | \
2021
tar xzf - -C /usr/local --strip-components=1
2122

2223
WORKDIR /tmp
23-
COPY shared.sh build-toolchain.sh /tmp/
24+
COPY shared.sh build-toolchain.sh compiler-rt-dso-handle.patch /tmp/
2425
RUN /tmp/build-toolchain.sh
2526

2627
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \

src/ci/docker/dist-fuchsia/build-toolchain.sh

+20-10
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,43 @@
99
# option. This file may not be copied, modified, or distributed
1010
# except according to those terms.
1111

12+
# ignore-tidy-linelength
13+
1214
set -ex
1315
source shared.sh
1416

1517
# Download sources
1618
SRCS=(
17-
"https://fuchsia.googlesource.com/magenta magenta ac69119"
18-
"https://fuchsia.googlesource.com/third_party/llvm llvm 5463083"
19-
"https://fuchsia.googlesource.com/third_party/clang llvm/tools/clang 4ff7b4b"
20-
"https://fuchsia.googlesource.com/third_party/lld llvm/tools/lld fd465a3"
21-
"https://fuchsia.googlesource.com/third_party/lldb llvm/tools/lldb 6bb11f8"
22-
"https://fuchsia.googlesource.com/third_party/compiler-rt llvm/runtimes/compiler-rt 52d4ecc"
23-
"https://fuchsia.googlesource.com/third_party/libcxx llvm/runtimes/libcxx e891cc8"
24-
"https://fuchsia.googlesource.com/third_party/libcxxabi llvm/runtimes/libcxxabi f0f0257"
25-
"https://fuchsia.googlesource.com/third_party/libunwind llvm/runtimes/libunwind 50bddc1"
19+
"https://fuchsia.googlesource.com/magenta magenta d17073dc8de344ead3b65e8cc6a12280dec38c84"
20+
"https://llvm.googlesource.com/llvm llvm 3f58a16d8eec385e2b3ebdfbb84ff9d3bf27e025"
21+
"https://llvm.googlesource.com/clang llvm/tools/clang 727ea63e6e82677f6e10e05e08bc7d6bdbae3111"
22+
"https://llvm.googlesource.com/lld llvm/tools/lld a31286c1366e5e89b8872803fded13805a1a084b"
23+
"https://llvm.googlesource.com/lldb llvm/tools/lldb 0b2384abec4cb99ad66687712e07dee4dd9d187e"
24+
"https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt 9093a35c599fe41278606a20b51095ea8bd5a081"
25+
"https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx 607e0c71ec4f7fd377ad3f6c47b08dbe89f66eaa"
26+
"https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi 0a3a1a8a5ca5ef69e0f6b7d5b9d13e63e6fd2c19"
27+
"https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind e128003563d99d9ee62247c4cee40f07d21c03e3"
2628
)
2729

2830
fetch() {
2931
mkdir -p $2
3032
pushd $2 > /dev/null
31-
curl -sL $1/+archive/$3.tar.gz | tar xzf -
33+
git init
34+
git remote add origin $1
35+
git fetch --depth=1 origin $3
36+
git reset --hard FETCH_HEAD
3237
popd > /dev/null
3338
}
3439

3540
for i in "${SRCS[@]}"; do
3641
fetch $i
3742
done
3843

44+
# Remove this once https://reviews.llvm.org/D28791 is resolved
45+
cd llvm/runtimes/compiler-rt
46+
patch -Np1 < /tmp/compiler-rt-dso-handle.patch
47+
cd ../../..
48+
3949
# Build toolchain
4050
cd llvm
4151
mkdir build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
2+
index fc4384af2..b442264c0 100644
3+
--- a/lib/builtins/CMakeLists.txt
4+
+++ b/lib/builtins/CMakeLists.txt
5+
@@ -194,6 +194,12 @@ if(APPLE)
6+
atomic_thread_fence.c)
7+
endif()
8+
9+
+if(FUCHSIA)
10+
+ set(GENERIC_SOURCES
11+
+ ${GENERIC_SOURCES}
12+
+ dso_handle.c)
13+
+endif()
14+
+
15+
if(NOT WIN32 OR MINGW)
16+
set(GENERIC_SOURCES
17+
${GENERIC_SOURCES}
18+
diff --git a/lib/builtins/dso_handle.c b/lib/builtins/dso_handle.c
19+
new file mode 100644
20+
index 000000000..7766cd0aa
21+
--- /dev/null
22+
+++ b/lib/builtins/dso_handle.c
23+
@@ -0,0 +1,18 @@
24+
+/* ===-- dso_handle.c - Provide __dso_handle -------------------------------===
25+
+ *
26+
+ * The LLVM Compiler Infrastructure
27+
+ *
28+
+ * This file is dual licensed under the MIT and the University of Illinois Open
29+
+ * Source Licenses. See LICENSE.TXT for details.
30+
+ *
31+
+ * ===----------------------------------------------------------------------===
32+
+ */
33+
+
34+
+/* __dso_handle symbol is mandated by C++ ABI with a value which is an address
35+
+ * in one of the object's segments, and as such this symbol has to be included
36+
+ * statically and cannot be a part of a shared library. Traditionally, it has
37+
+ * been defined in crtbegin.o but there's no principled reason for it to be
38+
+ * there. We defined this symbol in the builtin library which is built as a
39+
+ * static library and always included in the final link.
40+
+ */
41+
+__attribute__((visibility("hidden"))) void *const __dso_handle;

src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ CT_ARCH_SUPPORTS_WITH_FLOAT=y
101101
CT_ARCH_DEFAULT_BE=y
102102
CT_ARCH_DEFAULT_32=y
103103
CT_ARCH_ABI=""
104-
CT_ARCH_CPU="power4"
105-
CT_ARCH_TUNE="power6"
104+
CT_ARCH_CPU="powerpc"
105+
CT_ARCH_TUNE=""
106106
CT_ARCH_BE=y
107107
# CT_ARCH_LE is not set
108108
CT_ARCH_32=y
@@ -391,8 +391,8 @@ CT_CC_GCC_HAS_LIBSANITIZER=y
391391
CT_CC_GCC_VERSION="4.9.3"
392392
# CT_CC_LANG_FORTRAN is not set
393393
CT_CC_GCC_ENABLE_CXX_FLAGS=""
394-
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--with-cpu-32=power4 --with-cpu=default32"
395-
CT_CC_GCC_EXTRA_CONFIG_ARRAY="--with-cpu-32=power4 --with-cpu=default32"
394+
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
395+
CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
396396
CT_CC_GCC_EXTRA_ENV_ARRAY=""
397397
CT_CC_GCC_STATIC_LIBSTDCXX=y
398398
# CT_CC_GCC_SYSTEM_ZLIB is not set

src/ci/init_repo.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,20 @@ fi
3838

3939
# Wipe the cache if it's not valid, or mark it as invalid while we update it
4040
if [ ! -f "$cache_valid_file" ]; then
41-
rm -rf "$CACHE_DIR" && mkdir "$CACHE_DIR"
41+
rm -rf "$CACHE_DIR"
42+
mkdir "$CACHE_DIR"
4243
else
43-
rm "$cache_valid_file"
44+
stat_lines=$(cd "$cache_src_dir" && git status --porcelain | wc -l)
45+
stat_ec=$(cd "$cache_src_dir" && git status >/dev/null 2>&1 && echo $?)
46+
if [ ! -d "$cache_src_dir/.git" -o $stat_lines != 0 -o $stat_ec != 0 ]; then
47+
# Something is badly wrong - the cache valid file is here, but something
48+
# about the git repo is fishy. Nuke it all, just in case
49+
echo "WARNING: $cache_valid_file exists but bad repo: l:$stat_lines, ec:$stat_ec"
50+
rm -rf "$CACHE_DIR"
51+
mkdir "$CACHE_DIR"
52+
else
53+
rm "$cache_valid_file"
54+
fi
4455
fi
4556

4657
# Update the cache (a pristine copy of the rust source master)

src/librustc/hir/lowering.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ impl<'a> LoweringContext<'a> {
26972697
fn pat_ident_binding_mode(&mut self, span: Span, name: Name, bm: hir::BindingMode)
26982698
-> P<hir::Pat> {
26992699
let id = self.next_id();
2700-
let parent_def = self.parent_def;
2700+
let parent_def = self.parent_def.unwrap();
27012701
let def_id = {
27022702
let defs = self.resolver.definitions();
27032703
let def_path_data = DefPathData::Binding(name.as_str());

src/librustc/hir/map/def_collector.rs

+4-15
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ impl<'a> DefCollector<'a> {
4040
}
4141
}
4242

43-
pub fn collect_root(&mut self) {
44-
let root = self.create_def_with_parent(None,
45-
CRATE_NODE_ID,
46-
DefPathData::CrateRoot,
47-
ITEM_LIKE_SPACE);
43+
pub fn collect_root(&mut self, crate_name: &str, crate_disambiguator: &str) {
44+
let root = self.definitions.create_root_def(crate_name,
45+
crate_disambiguator);
4846
assert_eq!(root, CRATE_DEF_INDEX);
4947
self.parent_def = Some(root);
5048
}
@@ -54,20 +52,11 @@ impl<'a> DefCollector<'a> {
5452
data: DefPathData,
5553
address_space: DefIndexAddressSpace)
5654
-> DefIndex {
57-
let parent_def = self.parent_def;
55+
let parent_def = self.parent_def.unwrap();
5856
debug!("create_def(node_id={:?}, data={:?}, parent_def={:?})", node_id, data, parent_def);
5957
self.definitions.create_def_with_parent(parent_def, node_id, data, address_space)
6058
}
6159

62-
fn create_def_with_parent(&mut self,
63-
parent: Option<DefIndex>,
64-
node_id: NodeId,
65-
data: DefPathData,
66-
address_space: DefIndexAddressSpace)
67-
-> DefIndex {
68-
self.definitions.create_def_with_parent(parent, node_id, data, address_space)
69-
}
70-
7160
pub fn with_parent<F: FnOnce(&mut Self)>(&mut self, parent_def: DefIndex, f: F) {
7261
let parent = self.parent_def;
7362
self.parent_def = Some(parent_def);

0 commit comments

Comments
 (0)