From 167b7eb8b518e32c11aaae9678f8b095f834045c Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 20 Mar 2017 17:35:57 +0100 Subject: [PATCH 01/12] FIN: update to upstream (llvm 4.0.1 + fastcomp 1.37.10) & compiler-rt 4.0 --- src/compiler-rt | 2 +- src/llvm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler-rt b/src/compiler-rt index d30da544a8afc..1fdc27db84c9d 160000 --- a/src/compiler-rt +++ b/src/compiler-rt @@ -1 +1 @@ -Subproject commit d30da544a8afc5d78391dee270bdf40e74a215d3 +Subproject commit 1fdc27db84c9d0d9ae4ae60185629e8c43b4a11c diff --git a/src/llvm b/src/llvm index 2e951c3ae354b..c9bf6e3f98557 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 2e951c3ae354bcbd2e50b30798e232949a926b75 +Subproject commit c9bf6e3f98557937df93b24c48b2564c6963e788 From 4fcfab16d340f61c37b9e2ffc5233ed1eb4ad00f Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 23 Apr 2017 20:21:02 +0200 Subject: [PATCH 02/12] FIN/LLVM: adopt all applicable rust llvm patches --- src/llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm b/src/llvm index c9bf6e3f98557..fb3c57828dc9d 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit c9bf6e3f98557937df93b24c48b2564c6963e788 +Subproject commit fb3c57828dc9df51f84967292cc551b7a3564465 From aaa307ce47742375f41f1b5bb112ab9f5881e150 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 23 Apr 2017 20:50:28 +0200 Subject: [PATCH 03/12] FIN/LLVM: new rust patches required for 4.0 --- src/llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm b/src/llvm index fb3c57828dc9d..a884d21cc5f0b 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit fb3c57828dc9df51f84967292cc551b7a3564465 +Subproject commit a884d21cc5f0b23a1693d1e872fd8998a4fdd17f From f622542b6498a9b4a0ab2a5fdcd80e1261ff8208 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 23 Apr 2017 21:58:44 +0200 Subject: [PATCH 04/12] FIN/CRT: adopt all applicable rust compiler-rt patches --- src/compiler-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler-rt b/src/compiler-rt index 1fdc27db84c9d..c8a8767c56ad3 160000 --- a/src/compiler-rt +++ b/src/compiler-rt @@ -1 +1 @@ -Subproject commit 1fdc27db84c9d0d9ae4ae60185629e8c43b4a11c +Subproject commit c8a8767c56ad3d3f4eb45c87b95026936fb9aa35 From a0ce63be2b5d73411f733509a12702ccec2d173b Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 20 Mar 2017 17:42:25 +0100 Subject: [PATCH 05/12] FIN: update emscripten builder --- src/ci/docker/emscripten/Dockerfile | 6 +++--- src/ci/docker/emscripten/build-emscripten.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ci/docker/emscripten/Dockerfile b/src/ci/docker/emscripten/Dockerfile index ffdb1d18a94ef..cbbca23f6e3db 100644 --- a/src/ci/docker/emscripten/Dockerfile +++ b/src/ci/docker/emscripten/Dockerfile @@ -27,10 +27,10 @@ WORKDIR /tmp COPY build-emscripten.sh /tmp/ RUN ./build-emscripten.sh ENV PATH=$PATH:/tmp/emsdk_portable -ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin +ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.10/build_tag-e1.37.10_32/bin ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin -ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1 -ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1 +ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.10 +ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.10 ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten diff --git a/src/ci/docker/emscripten/build-emscripten.sh b/src/ci/docker/emscripten/build-emscripten.sh index e39767357ad63..8d6a28f418bf9 100755 --- a/src/ci/docker/emscripten/build-emscripten.sh +++ b/src/ci/docker/emscripten/build-emscripten.sh @@ -49,5 +49,5 @@ chmod 755 emsdk_portable source emsdk_portable/emsdk_env.sh hide_output emsdk update -hide_output emsdk install --build=Release sdk-tag-1.37.1-32bit -hide_output emsdk activate --build=Release sdk-tag-1.37.1-32bit +hide_output emsdk install --build=Release sdk-tag-1.37.10-32bit +hide_output emsdk activate --build=Release sdk-tag-1.37.10-32bit From a146431e4c8095a3d809517c8abc6b886d5c5b07 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 2 Apr 2017 11:24:22 +0200 Subject: [PATCH 06/12] FIN: disable backtrace printing for panic-runtime/abort* on ARM --- .../panic-runtime/abort-link-to-unwinding-crates.rs | 12 +++++++++++- src/test/run-pass/panic-runtime/abort.rs | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs b/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs index 1c273fcba02da..ebbb00a4a9f23 100644 --- a/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs +++ b/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs @@ -27,7 +27,17 @@ fn main() { exit_success_if_unwind::bar(do_panic); } } - let s = Command::new(env::args_os().next().unwrap()).arg("foo").status(); + + let mut cmd = Command::new(env::args_os().next().unwrap()); + cmd.arg("foo"); + + + // ARMv6 hanges while printing the backtrace, see #41004 + if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") { + cmd.env("RUST_BACKTRACE", "0"); + } + + let s = cmd.status(); assert!(s.unwrap().code() != Some(0)); } diff --git a/src/test/run-pass/panic-runtime/abort.rs b/src/test/run-pass/panic-runtime/abort.rs index be38f6ea3643a..3ba3bd61c2e87 100644 --- a/src/test/run-pass/panic-runtime/abort.rs +++ b/src/test/run-pass/panic-runtime/abort.rs @@ -35,6 +35,15 @@ fn main() { panic!("try to catch me"); } } - let s = Command::new(env::args_os().next().unwrap()).arg("foo").status(); + + let mut cmd = Command::new(env::args_os().next().unwrap()); + cmd.arg("foo"); + + // ARMv6 hanges while printing the backtrace, see #41004 + if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") { + cmd.env("RUST_BACKTRACE", "0"); + } + + let s = cmd.status(); assert!(s.unwrap().code() != Some(0)); } From 5ae4a58c339a935fd098ba6ea8315af444113276 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 2 Apr 2017 12:36:20 +0200 Subject: [PATCH 07/12] FIN: build comiler-rt wihout Thumb on arm --- src/libcompiler_builtins/build.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcompiler_builtins/build.rs b/src/libcompiler_builtins/build.rs index bcd3a92dd4305..8fe79057bd817 100644 --- a/src/libcompiler_builtins/build.rs +++ b/src/libcompiler_builtins/build.rs @@ -293,6 +293,12 @@ fn main() { } if target.contains("arm") && !target.contains("ios") { + // (At least) udivsi3.S is broken for Thumb 1 which our gcc uses by + // default, we don't want Thumb 2 since it isn't supported on some + // devices, so disable thumb entirely. + // Upstream bug: https://bugs.llvm.org/show_bug.cgi?id=32492 + cfg.define("__ARM_ARCH_ISA_THUMB", Some("0")); + sources.extend(&["arm/aeabi_cdcmp.S", "arm/aeabi_cdcmpeq_check_nan.c", "arm/aeabi_cfcmp.S", From 5bd4e27db235bb857066e43384d483aa9dbdf56e Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Fri, 14 Apr 2017 11:27:35 +0200 Subject: [PATCH 08/12] FIN: update appveyor mingw description --- appveyor.yml | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 83cfea0dd834e..450a489f0b1e2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,28 +20,17 @@ environment: # 32/64-bit MinGW builds. # - # The MinGW builds unfortunately have to both download a custom toolchain and - # avoid the one installed by AppVeyor by default. Interestingly, though, for - # different reasons! + # We are using MinGW with posix threads since LLVM does not compile with + # the win32 threads version due to missing support for C++'s std::thread. # - # For 32-bit the installed gcc toolchain on AppVeyor uses the pthread - # threading model. This is unfortunately not what we want, and if we compile - # with it then there's lots of link errors in the standard library (undefined - # references to pthread symbols). - # - # For 64-bit the installed gcc toolchain is currently 5.3.0 which - # unfortunately segfaults on Windows with --enable-llvm-assertions (segfaults - # in LLVM). See rust-lang/rust#28445 for more information, but to work around - # this we go back in time to 4.9.2 specifically. + # Instead of relying on the MinGW version installed on appveryor we download + # and install one ourselves so we won't be surprised by changes to appveyor's + # build image. # # Finally, note that the downloads below are all in the `rust-lang-ci` S3 # bucket, but they cleraly didn't originate there! The downloads originally # came from the mingw-w64 SourceForge download site. Unfortunately # SourceForge is notoriously flaky, so we mirror it on our own infrastructure. - # - # And as a final point of note, the 32-bit MinGW build using the makefiles do - # *not* use debug assertions and llvm assertions. This is because they take - # too long on appveyor and this is tested by rustbuild below. - MSYS_BITS: 32 RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja SCRIPT: python x.py test From 6723e69a54947f7929e4d30f9f3e549ffd51e7b6 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Fri, 14 Apr 2017 11:29:05 +0200 Subject: [PATCH 09/12] FIN: ignore failing test on emscripten, see #41299 --- src/test/run-pass/issue-29663.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/run-pass/issue-29663.rs b/src/test/run-pass/issue-29663.rs index 9a77be049feeb..cf925662fc3f3 100644 --- a/src/test/run-pass/issue-29663.rs +++ b/src/test/run-pass/issue-29663.rs @@ -10,6 +10,8 @@ // write_volatile causes an LLVM assert with composite types +// ignore-emscripten See #41299: probably a bad optimization + #![feature(volatile)] use std::ptr::{read_volatile, write_volatile}; From 67560f6fae7c4c6ae7f1f78a9ba17f5e0d9f9037 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Fri, 14 Apr 2017 11:27:56 +0200 Subject: [PATCH 10/12] FIN: switch appveryor to mingw with posix threads --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 450a489f0b1e2..f8e4a30e152a1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,13 +35,13 @@ environment: RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja SCRIPT: python x.py test MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror - MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z + MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z MINGW_DIR: mingw32 - MSYS_BITS: 64 SCRIPT: python x.py test RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-ninja MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror - MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z + MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z MINGW_DIR: mingw64 # 32/64 bit MSVC and GNU deployment @@ -60,14 +60,14 @@ environment: RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended --enable-ninja SCRIPT: python x.py dist MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror - MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z + MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z MINGW_DIR: mingw32 DEPLOY: 1 - MSYS_BITS: 64 SCRIPT: python x.py dist RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended --enable-ninja MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror - MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z + MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z MINGW_DIR: mingw64 DEPLOY: 1 From f3dda17469bd70feaf6a1d979cdc65dd450f8fcb Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 17 Apr 2017 10:24:33 +0200 Subject: [PATCH 11/12] FIN: Compile LLVM with -fno-omit-frame-pointer on 32bit MinGW builds to work around an apparently bad optimization. --- src/bootstrap/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 84254d7d6ae51..27d4e309a7525 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -874,6 +874,13 @@ impl Build { if target.contains("apple-darwin") { base.push("-stdlib=libc++".into()); } + + // Work around an apparently bad MinGW / GCC optimization, + // See: http://lists.llvm.org/pipermail/cfe-dev/2016-December/051980.html + // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78936 + if target == "i686-pc-windows-gnu" { + base.push("-fno-omit-frame-pointer".into()); + } return base } From 899427765760068163c811fbe9e02ff953638698 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Thu, 13 Apr 2017 22:27:53 +0200 Subject: [PATCH 12/12] FIN: windows-gnu: statically link gcc_s, pthread with llvm --- src/librustc_llvm/build.rs | 4 ++++ src/librustc_llvm/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index 7d5887e699fd7..7ef9031734a71 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -265,4 +265,8 @@ fn main() { if target.contains("windows") { println!("cargo:rustc-link-lib=ole32"); } + if target.contains("windows-gnu") { + println!("cargo:rustc-link-lib=static-nobundle=gcc_s"); + println!("cargo:rustc-link-lib=static-nobundle=pthread"); + } } diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index f300bf16145a7..7c52ceae459cd 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -29,6 +29,7 @@ #![feature(link_args)] #![feature(staged_api)] #![feature(rustc_private)] +#![feature(static_nobundle)] extern crate libc; #[macro_use]