From 46eb009d5af3ca17ab6e18ccbfdaadc70d930a0f Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Fri, 31 May 2019 18:59:26 -0700 Subject: [PATCH] Don't use system compiler-rt, it's not ready yet --- debian/README.source | 7 +++++++ debian/changelog | 6 ++++++ debian/control | 4 ++-- debian/copyright | 17 ++++++++++++++--- debian/patches/gcc-4.8-aarch64-ice.diff | 25 +++++++++++++++++++++++++ debian/patches/series | 4 +++- debian/source/lintian-overrides | 2 -- 7 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 debian/patches/gcc-4.8-aarch64-ice.diff diff --git a/debian/README.source b/debian/README.source index 63a8d33ded..e0e6dc6fc2 100644 --- a/debian/README.source +++ b/debian/README.source @@ -17,6 +17,13 @@ The upstream source package embeds many external libraries. We make a great effort to remove them and use system versions where possible, but there are a few more remaining: + * compiler-rt from https://github.com/rust-lang/compiler-rt + -> system-wide compiler-rt fails during linkage + + Bug reported upstream, still to be fixed, see: + - https://github.com/rust-lang/rust/issues/15054 + - https://github.com/rust-lang/rust/issues/15708 + * vendor/backtrace-sys, vendor/dlmalloc, vendor/walkdir These are small C libraries designed to be statically linked; their upstream diff --git a/debian/changelog b/debian/changelog index 6b4b148b1d..a27f986f54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +rustc (1.34.2+dfsg1-1~exp3) UNRELEASED; urgency=medium + + * Don't use system compiler-rt, it's not ready yet. + + -- Ximin Luo Fri, 31 May 2019 18:37:07 -0700 + rustc (1.34.2+dfsg1-1~exp2) experimental; urgency=medium * Fix doc build, add version 1 compat mode hack for mdBook 2. diff --git a/debian/control b/debian/control index 8b79b52fa3..8f0d0f6c92 100644 --- a/debian/control +++ b/debian/control @@ -15,8 +15,8 @@ Build-Depends: debhelper (>= 9), llvm-8-dev:native, llvm-8-tools:native, libllvm8, - libclang-common-8-dev, - libclang-common-8-dev:native, +# libclang-common-8-dev, +# libclang-common-8-dev:native, autotools-dev, cmake (>= 3.0) | cmake3, # needed by some vendor crates diff --git a/debian/copyright b/debian/copyright index c3074b833b..fd336f4c10 100644 --- a/debian/copyright +++ b/debian/copyright @@ -24,8 +24,21 @@ Files-Excluded: src/tools/remote-test-server src/tools/rustfmt src/tools/miri +# Extraneous stuff from compiler-rt that's not needed by Rust + vendor/compiler_builtins/compiler-rt/cmake + vendor/compiler_builtins/compiler-rt/docs + vendor/compiler_builtins/compiler-rt/include + vendor/compiler_builtins/compiler-rt/lib/*san + vendor/compiler_builtins/compiler-rt/lib/fuzzer + vendor/compiler_builtins/compiler-rt/lib/interception + vendor/compiler_builtins/compiler-rt/lib/profile + vendor/compiler_builtins/compiler-rt/lib/sanitizer_common + vendor/compiler_builtins/compiler-rt/lib/scudo + vendor/compiler_builtins/compiler-rt/lib/xray + vendor/compiler_builtins/compiler-rt/test + vendor/compiler_builtins/compiler-rt/unittests + vendor/compiler_builtins/compiler-rt/www # Embedded C libraries - vendor/compiler_builtins/compiler-rt vendor/libz-sys/src/zlib* vendor/lzma-sys*/xz-* # Embedded binary blobs @@ -213,8 +226,6 @@ Copyright: 2016-2019 Jorge Aparicio License: MIT or Apache-2.0 Comment: see https://github.com/rust-lang-nursery/compiler-builtins -# TODO: below entries for compiler-rt can be removed on next source re-pack - Files: vendor/compiler_builtins/compiler-rt/* Copyright: 2009-2015 Howard Hinnant 2009-2015 The CompileRT Developers (see src/compiler-rt/CREDITS.TXT) diff --git a/debian/patches/gcc-4.8-aarch64-ice.diff b/debian/patches/gcc-4.8-aarch64-ice.diff new file mode 100644 index 0000000000..aaa4d7b11f --- /dev/null +++ b/debian/patches/gcc-4.8-aarch64-ice.diff @@ -0,0 +1,25 @@ +Index: rustc/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c +=================================================================== +--- rustc.orig/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c ++++ rustc/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c +@@ -7,6 +7,12 @@ + // + //===----------------------------------------------------------------------===// + ++#if defined(__aarch64__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ <= 8) ++// work around https://launchpad.net/bugs/1667761 ++#pragma GCC push_options ++#pragma GCC optimize "O1" ++#endif ++ + #define QUAD_PRECISION + #include "fp_lib.h" + +@@ -20,3 +26,7 @@ COMPILER_RT_ABI double __trunctfdf2(long + } + + #endif ++#if defined(__aarch64__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ <= 8) ++#pragma GCC pop_options ++#endif ++ diff --git a/debian/patches/series b/debian/patches/series index f0ebf9895c..ba0d646ea4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,6 +12,8 @@ u-mips-fixes.diff # not forwarded, or forwarded but unlikely to be merged u-reproducible-dl-stage0.patch +gcc-4.8-aarch64-ice.diff + # Debian-specific patches, not suitable for upstream # Patches needed by debian/prune-unused-deps d-0000-ignore-removed-submodules.patch @@ -20,7 +22,7 @@ d-0002-pkg-config-no-special-snowflake.patch d-0003-mdbook-strip-embedded-libs.patch d-0004-mdbook-2-1-compat.patch # Other patches needed by the full Debian build -d-use-system-compiler-rt.patch +#d-use-system-compiler-rt.patch d-ignore-error-detail-diff.patch d-disable-cargo-vendor.patch d-rust-gdb-paths diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index dda0650ff5..732a73a881 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,3 +1 @@ rustc source: source-is-missing src/stdsimd/crates/stdsimd-verify/arm-intrinsics.html line length is * characters (>*) -# TODO: can be removed on next source repack -rustc source: source-includes-file-in-files-excluded vendor/compiler_builtins/compiler-rt/*