From f25948bb2cb2e66efd4898ba1ec9ac0637ed4252 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Sat, 3 Mar 2018 12:13:18 +0100 Subject: [PATCH] Take care of some outstanding bugs --- debian/architecture.mk | 5 +- debian/changelog | 8 ++ debian/control | 3 + .../d-armel-disable-kernel-helpers.patch | 15 +++ debian/patches/series | 3 + debian/patches/u-powerpcspe-support.patch | 95 +++++++++++++++++++ debian/rules | 3 +- 7 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 debian/patches/d-armel-disable-kernel-helpers.patch create mode 100644 debian/patches/u-powerpcspe-support.patch diff --git a/debian/architecture.mk b/debian/architecture.mk index daeda01b97..9a71eb996a 100644 --- a/debian/architecture.mk +++ b/debian/architecture.mk @@ -2,7 +2,10 @@ include /usr/share/dpkg/architecture.mk -rust_cpu = $(subst i586,i686,$(if $(findstring -armhf-,-$(2)-),$(subst arm,armv7,$(1)),$(1))) +rust_cpu = $(subst i586,i686,\ +$(if $(findstring -armhf-,-$(2)-),$(subst arm,armv7,$(1)),\ +$(if $(findstring -armel-,-$(2)-),$(subst arm,armv5te,$(1)),\ +$(1)))) rust_type_setvar = $(1)_RUST_TYPE ?= $(call rust_cpu,$($(1)_GNU_CPU),$($(1)_ARCH))-unknown-$($(1)_GNU_SYSTEM) $(foreach machine,BUILD HOST TARGET,\ diff --git a/debian/changelog b/debian/changelog index 6de4e28c8d..b423fe3c87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,14 @@ rustc (1.24.1+dfsg1-1) UNRELEASED; urgency=medium * More sparc64 CABI fixes. (Closes: #888757) * New upstream release. + * Include Debian-specific patch to disable kernel helpers on armel. + (Closes: #891902) + * Include missing build-dependencies for pkg.rustc.dlstage0 build profile. + (Closes: #891022) + * Add architecture.mk mapping for armel => armv5te-unknown-linux-gnueabi. + (Closes: #891913) + * Enable debuginfo-only-std on armel as well. (Closes: #891961) + * Backport upstream patch to support powerpcspe. (Closes: #891542) -- Ximin Luo Sat, 03 Mar 2018 11:37:35 +0100 diff --git a/debian/control b/debian/control index 09501ab664..06cc1516cc 100644 --- a/debian/control +++ b/debian/control @@ -34,6 +34,9 @@ Build-Depends: debhelper (>= 9), # Work around #864741. The version constraint for gdb above should already do # that, but this will keep things covered even in the case that they change # gdb-minimal to do a versioned Provides: gdb. +# Extra build-deps needed for x.py to download stuff in pkg.rustc.dlstage0. + curl , + ca-certificates , Build-Conflicts: gdb-minimal Standards-Version: 4.1.3 Homepage: http://www.rust-lang.org/ diff --git a/debian/patches/d-armel-disable-kernel-helpers.patch b/debian/patches/d-armel-disable-kernel-helpers.patch new file mode 100644 index 0000000000..fd04e604fc --- /dev/null +++ b/debian/patches/d-armel-disable-kernel-helpers.patch @@ -0,0 +1,15 @@ +--- rustc-1.24.0+dfsg1/src/libcompiler_builtins/build.rs.orig 2018-02-12 16:56:07.000000000 -0200 ++++ rustc-1.24.0+dfsg1/src/libcompiler_builtins/build.rs 2018-03-02 07:22:10.124164162 -0300 +@@ -52,9 +52,9 @@ + } + + // Only emit the ARM Linux atomic emulation on pre-ARMv6 architectures. +- if llvm_target[0] == "armv4t" || llvm_target[0] == "armv5te" { +- println!("cargo:rustc-cfg=kernel_user_helpers") +- } ++ // if llvm_target[0] == "armv4t" || llvm_target[0] == "armv5te" { ++ // println!("cargo:rustc-cfg=kernel_user_helpers") ++ // } + } + + #[cfg(feature = "gen-tests")] diff --git a/debian/patches/series b/debian/patches/series index 1c2a7c0269..d44e4d1cf3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,6 +3,7 @@ # pending, forwarded u-sparc64-detection.patch u-fix-sparc64-cabi.patch +u-powerpcspe-support.patch u-gperf-3.1.patch u-reproducible-build.patch u-ignoretest-armhf_01.patch @@ -30,5 +31,7 @@ d-dont-download-stage0.patch d-no-web-dependencies-in-doc.patch d-ignore-removed-submodules.patch +d-armel-disable-kernel-helpers.patch + # Work around for some porterboxes, keep this commented #d-host-duplicates.patch diff --git a/debian/patches/u-powerpcspe-support.patch b/debian/patches/u-powerpcspe-support.patch new file mode 100644 index 0000000000..0c2c8d508c --- /dev/null +++ b/debian/patches/u-powerpcspe-support.patch @@ -0,0 +1,95 @@ +diff -Nru rustc-1.24.0+dfsg1.orig/src/bootstrap/native.rs rustc-1.24.0+dfsg1/src/bootstrap/native.rs +--- rustc-1.24.0+dfsg1.orig/src/bootstrap/native.rs 2018-02-12 19:51:18.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/bootstrap/native.rs 2018-02-26 16:10:36.018558904 +0100 +@@ -440,6 +440,7 @@ + "mips64el-unknown-linux-gnuabi64" => "linux64-mips64", + "mipsel-unknown-linux-gnu" => "linux-mips32", + "powerpc-unknown-linux-gnu" => "linux-ppc", ++ "powerpc-unknown-linux-gnuspe" => "linux-ppc", + "powerpc64-unknown-linux-gnu" => "linux-ppc64", + "powerpc64le-unknown-linux-gnu" => "linux-ppc64le", + "s390x-unknown-linux-gnu" => "linux64-s390x", +diff -Nru rustc-1.24.0+dfsg1.orig/src/librustc_back/target/mod.rs rustc-1.24.0+dfsg1/src/librustc_back/target/mod.rs +--- rustc-1.24.0+dfsg1.orig/src/librustc_back/target/mod.rs 2018-02-12 19:51:18.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/librustc_back/target/mod.rs 2018-02-26 16:10:39.178562446 +0100 +@@ -144,6 +144,7 @@ + ("mips64el-unknown-linux-gnuabi64", mips64el_unknown_linux_gnuabi64), + ("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu), + ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu), ++ ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe), + ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu), + ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu), + ("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu), +diff -Nru rustc-1.24.0+dfsg1.orig/src/librustc_back/target/powerpc_unknown_linux_gnuspe.rs rustc-1.24.0+dfsg1/src/librustc_back/target/powerpc_unknown_linux_gnuspe.rs +--- rustc-1.24.0+dfsg1.orig/src/librustc_back/target/powerpc_unknown_linux_gnuspe.rs 1970-01-01 01:00:00.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/librustc_back/target/powerpc_unknown_linux_gnuspe.rs 2018-02-26 16:10:39.178562446 +0100 +@@ -0,0 +1,35 @@ ++// Copyright 2018 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use LinkerFlavor; ++use target::{Target, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::linux_base::opts(); ++ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mspe".to_string()); ++ base.max_atomic_width = Some(32); ++ ++ // see #36994 ++ base.exe_allocation_crate = None; ++ ++ Ok(Target { ++ llvm_target: "powerpc-unknown-linux-gnuspe".to_string(), ++ target_endian: "big".to_string(), ++ target_pointer_width: "32".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(), ++ arch: "powerpc".to_string(), ++ target_os: "linux".to_string(), ++ target_env: "gnu".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: base, ++ }) ++} +diff -Nru rustc-1.24.0+dfsg1.orig/src/test/run-make/atomic-lock-free/Makefile rustc-1.24.0+dfsg1/src/test/run-make/atomic-lock-free/Makefile +--- rustc-1.24.0+dfsg1.orig/src/test/run-make/atomic-lock-free/Makefile 2018-02-15 22:24:54.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/test/run-make/atomic-lock-free/Makefile 2018-02-26 16:10:45.258569263 +0100 +@@ -32,6 +32,8 @@ + ifeq ($(filter powerpc,$(LLVM_COMPONENTS)),powerpc) + $(RUSTC) --target=powerpc-unknown-linux-gnu atomic_lock_free.rs + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add ++ $(RUSTC) --target=powerpc-unknown-linux-gnuspe atomic_lock_free.rs ++ nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add + $(RUSTC) --target=powerpc64-unknown-linux-gnu atomic_lock_free.rs + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add + $(RUSTC) --target=powerpc64le-unknown-linux-gnu atomic_lock_free.rs +diff -Nru rustc-1.24.0+dfsg1.orig/src/tools/build-manifest/src/main.rs rustc-1.24.0+dfsg1/src/tools/build-manifest/src/main.rs +--- rustc-1.24.0+dfsg1.orig/src/tools/build-manifest/src/main.rs 2018-02-12 19:51:19.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/tools/build-manifest/src/main.rs 2018-02-26 16:10:42.178565811 +0100 +@@ -82,6 +82,7 @@ + "mipsel-unknown-linux-gnu", + "mipsel-unknown-linux-musl", + "powerpc-unknown-linux-gnu", ++ "powerpc-unknown-linux-gnuspe", + "powerpc64-unknown-linux-gnu", + "powerpc64le-unknown-linux-gnu", + "s390x-unknown-linux-gnu", +diff -Nru rustc-1.24.0+dfsg1.orig/src/vendor/cc/src/lib.rs rustc-1.24.0+dfsg1/src/vendor/cc/src/lib.rs +--- rustc-1.24.0+dfsg1.orig/src/vendor/cc/src/lib.rs 2018-02-12 21:28:22.000000000 +0100 ++++ rustc-1.24.0+dfsg1/src/vendor/cc/src/lib.rs 2018-02-26 16:11:11.754599023 +0100 +@@ -1433,6 +1433,7 @@ + "mips64-unknown-linux-gnuabi64" => Some("mips64-linux-gnuabi64"), + "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"), + "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"), ++ "powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"), + "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), + "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), + "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"), diff --git a/debian/rules b/debian/rules index aeb08dceaa..302573bba3 100755 --- a/debian/rules +++ b/debian/rules @@ -163,7 +163,8 @@ debian/config.toml: debian/config.toml.in "$<" > "$@" ! $(DOWNLOAD_BOOTSTRAP) || sed -i -e '/^rustc = /d' -e '/^cargo = /d' "$@" # Work around armhf issue: https://github.com/rust-lang/rust/issues/45854 - [ $(DEB_BUILD_ARCH) != armhf ] || sed -i -e '/^debuginfo-only-std = /d' "$@" + [ $(DEB_BUILD_ARCH) != armhf -a \ + $(DEB_BUILD_ARCH) != armel ] || sed -i -e '/^debuginfo-only-std = /d' "$@" debian/rust-src.%: debian/rust-src.%.in m4 -DRUST_LONG_VERSION="$(RUST_LONG_VERSION)" \ -- 2.39.5