Import rustc_1.41.1+dfsg1-1~deb10u1.debian.tar.xz
authorEmilio Pozuelo Monfort <pochu@debian.org>
Tue, 8 Sep 2020 16:38:19 +0000 (17:38 +0100)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Tue, 8 Sep 2020 16:38:19 +0000 (17:38 +0100)
[dgit import tarball rustc 1.41.1+dfsg1-1~deb10u1 rustc_1.41.1+dfsg1-1~deb10u1.debian.tar.xz]

91 files changed:
NEWS [new file with mode: 0644]
README.Debian [new file with mode: 0644]
README.source [new file with mode: 0644]
TODO [new file with mode: 0644]
architecture-test.mk [new file with mode: 0644]
architecture.mk [new file with mode: 0644]
bin/rust-lld [new file with mode: 0755]
cargo/.package-cache [new file with mode: 0644]
changelog [new file with mode: 0644]
check-orig-suspicious.sh [new file with mode: 0755]
compat [new file with mode: 0644]
config.toml.in [new file with mode: 0644]
control [new file with mode: 0644]
copyright [new file with mode: 0644]
docs [new file with mode: 0644]
ensure-patch [new file with mode: 0755]
gbp.conf [new file with mode: 0644]
get-stage0.py [new file with mode: 0755]
icons/rust-logo-32x32-blk.png [new file with mode: 0644]
libstd-rust-1.41.lintian-overrides [new file with mode: 0644]
libstd-rust-dev-wasm32-cross.lintian-overrides [new file with mode: 0644]
libstd-rust-dev.lintian-overrides [new file with mode: 0644]
lintian-to-copyright.sh [new file with mode: 0755]
llvm-upstream-patch.sh [new file with mode: 0755]
make_orig-stage0_tarball.sh [new file with mode: 0755]
patches/0001-Fix-compiletest-fallout-from-stage0-bump.patch [new file with mode: 0644]
patches/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch [new file with mode: 0644]
patches/d-0000-ignore-removed-submodules.patch [new file with mode: 0644]
patches/d-0001-disable-miniz.patch [new file with mode: 0644]
patches/d-0002-pkg-config-no-special-snowflake.patch [new file with mode: 0644]
patches/d-0003-mdbook-strip-embedded-libs.patch [new file with mode: 0644]
patches/d-add-bootstrap-checksums.patch [new file with mode: 0644]
patches/d-add-soname.patch [new file with mode: 0644]
patches/d-disable-cargo-vendor.patch [new file with mode: 0644]
patches/d-dont-download-stage0.patch [new file with mode: 0644]
patches/d-fix-mips64el-bootstrap.patch [new file with mode: 0644]
patches/d-host-duplicates.patch [new file with mode: 0644]
patches/d-i686-baseline.patch [new file with mode: 0644]
patches/d-ignore-avx-44056.patch [new file with mode: 0644]
patches/d-ignore-error-detail-diff.patch [new file with mode: 0644]
patches/d-no-jemalloc.patch [new file with mode: 0644]
patches/d-prefer-dynamic.patch [new file with mode: 0644]
patches/d-read-beta-version-from-file.patch [new file with mode: 0644]
patches/d-rust-gdb-paths [new file with mode: 0644]
patches/d-rust-lldb-paths [new file with mode: 0644]
patches/d-use-system-compiler-rt.patch [new file with mode: 0644]
patches/rust-pr68019-in-tree-compiletest.patch [new file with mode: 0644]
patches/series [new file with mode: 0644]
patches/u-allow-system-compiler-rt.patch [new file with mode: 0644]
patches/u-make-tests-work-without-rpath.patch [new file with mode: 0644]
patches/u-mips-fixes.diff [new file with mode: 0644]
patches/u-prefer-local-css.patch [new file with mode: 0644]
patches/u-reproducible-build.patch [new file with mode: 0644]
patches/u-reproducible-dl-stage0.patch [new file with mode: 0644]
patches/u-riscv64-66899.patch [new file with mode: 0644]
patches/u-riscv64-68452.patch [new file with mode: 0644]
patches/u-riscv64-cc-461.patch [new file with mode: 0644]
patches/u-riscv64-cc-465.patch [new file with mode: 0644]
patches/u-riscv64-compiletest.patch [new file with mode: 0644]
patches/u-riscv64-libc-1606.patch [new file with mode: 0644]
patches/u-rustc-llvm-cross-flags.patch [new file with mode: 0644]
patches/u-test-python-3.patch [new file with mode: 0644]
patches/u-tests-ignore-arm.patch [new file with mode: 0644]
patches/u-wasm32-libc-1625.patch [new file with mode: 0644]
prune-checksums [new file with mode: 0755]
prune-unused-deps [new file with mode: 0755]
rules [new file with mode: 0755]
rust-doc.doc-base.book [new file with mode: 0644]
rust-doc.doc-base.reference [new file with mode: 0644]
rust-doc.docs [new file with mode: 0644]
rust-doc.install [new file with mode: 0644]
rust-doc.links [new file with mode: 0644]
rust-gdb.install [new file with mode: 0644]
rust-gdb.links [new file with mode: 0644]
rust-lldb.install [new file with mode: 0644]
rust-lldb.links [new file with mode: 0644]
rust-src.install.in [new file with mode: 0644]
rust-src.links.in [new file with mode: 0644]
rust-src.lintian-overrides [new file with mode: 0644]
rustc.install [new file with mode: 0644]
rustc.links [new file with mode: 0644]
rustc.manpages [new file with mode: 0644]
source/format [new file with mode: 0644]
source/include-binaries [new file with mode: 0644]
source/lintian-overrides [new file with mode: 0644]
source/options [new file with mode: 0644]
update-version.sh [new file with mode: 0755]
upstream-tarball-unsuspicious.txt [new file with mode: 0644]
upstream/signing-key.asc [new file with mode: 0644]
watch [new file with mode: 0644]
watch-beta.in [new file with mode: 0644]

diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..067259d
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,29 @@
+rustc (1.20.0+dfsg1-2) unstable; urgency=medium
+
+  Starting from version 1.20.0+dfsg1-1 (i.e. the previous version) the Debian
+  packages of rustc no longer fail their build if any tests fail. In other
+  words, some tests might have failed when building this and future versions of
+  the package. This is due to lack of maintainer time to investigate failures.
+
+  Many previous test failures were reported to upstream and did not receive a
+  timely response, suggesting the failures were not important. I was then
+  forced to patch out the test to make the build proceed, so several tests were
+  being ignored in practise anyway.
+
+  This brings the Debian package in line with the Fedora package which also
+  ignores all test failures. (Many other distributions don't run tests at all.)
+
+  If you think that the Debian rustc package is miscompiling your program in a
+  way that the upstream distributed compiler doesn't, you may check the test
+  failures here:
+
+  https://buildd.debian.org/status/package.php?p=rustc
+
+  If you can identify a relevant test failure as well as the patches needed to
+  fix it (either to rustc or LLVM), this will speed up the processing of any
+  bug reports on the Debian side.
+
+  We will also examine these failures ourselves on a best-effort basis and
+  attempt to fix the more serious-looking ones.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 16 Oct 2017 18:02:23 +0200
diff --git a/README.Debian b/README.Debian
new file mode 100644 (file)
index 0000000..577d773
--- /dev/null
@@ -0,0 +1,239 @@
+Architecture-specific notes
+===========================
+
+armhf armel mips mipsel powerpc powerpcspe
+------------------------------------------
+
+We only ship debuginfo for libstd and not the compiler itself, otherwise builds
+run out of memory on the Debian buildds, with non-obvious and random errors.
+
+See https://github.com/rust-lang/rust/issues/45854 for details.
+
+If all your armhf build machines have ~8GB memory or more, you can experiment
+with disabling this work-around (i.e. revert to normal) in d/rules.
+
+wasm32
+------
+
+We ship two different wasm32 targets - wasm32-unknown-unknown and wasm32-wasi -
+in the libstd-rust-dev-wasm32-cross package.
+
+wasm32-unknown-unknown is suitable for web stuff, where you typically will need
+to depending on the rust-wasm-bindgen, js-sys, and web-sys crates. Here, calls
+to libstd stuff (such as println!()) will silently do nothing, as defined in
+``src/libstd/sys/wasm/fs.rs`` and explained in upstream #48564.
+
+wasm32-wasi is suitable for non-web stuff, and is closer to a "normal" target
+where you expect libstd to be available, and for println!() to actually print
+to stdout. If you just want to cross-compile a regular non-wasm library or
+program to wasm for whatever reason, and only want to run it natively and not
+inside a web browser, use this target.
+
+To run the generated wasm, you will need a runtime:
+
+- https://github.com/bytecodealliance/wasmtime
+- https://github.com/bytecodealliance/lucet
+- https://github.com/wasmerio/wasmer
+- https://nodejs.org/api/wasi.html (sadly Debian's is too old, ATTOW)
+
+The first 3 are actually also all written in Rust, so one day some of them may
+even be packaged for Debian.
+
+
+Cross-compiling
+===============
+
+Rust uses LLVM, so cross-compiling works a bit differently from the GNU
+toolchain. The most important difference is that there are no "cross"
+compilers, every compiler is already a cross compiler. All you need to do is
+install the standard libraries for each target architecture you want to compile
+to. For rustc, this is libstd-rust-dev, so your debian/control would look
+something like this:
+
+    Build-Depends:
+     [..]
+     rustc:native    (>= $version),
+     libstd-rust-dev (>= $version),
+     [..]
+
+You need both, this is important. When Debian build toolchains satisfy the
+build-depends of a cross-build, (1) a "rustc:native" Build-Depends selects
+rustc for the native architecture, which is possible because it's "Multi-Arch:
+allowed", and this will implicitly pull in libstd-rust-dev also for the native
+architecture; and (2) a "libstd-rust-dev" Build-Depends implies libstd-rust-dev
+for the foreign architecture, since it's "Multi-Arch: same".
+
+You'll probably also want to add
+
+    include /usr/share/rustc/architecture.mk
+
+to your debian/rules. This sets some useful variables like DEB_HOST_RUST_TYPE.
+
+See the cargo package for an example.
+
+Terminology
+-----------
+
+The rust ecosystem generally uses the term "host" for the native architecture
+running the compiler, equivalent to DEB_BUILD_RUST_TYPE or "build" in GNU
+terminology, and "target" for the foreign architecture that the build products
+run on, equivalent to DEB_HOST_RUST_TYPE or "host" in GNU terminology. For
+example, rustc --version --verbose will output something like:
+
+    rustc 1.16.0
+    [..]
+    host: x86_64-unknown-linux-gnu
+
+And both rustc and cargo have --target flags:
+
+    $ rustc --help | grep '\-\-target'
+        --target TARGET     Target triple for which the code is compiled
+    $ cargo build --help | grep '\-\-target'
+        --target TRIPLE              Build for the target triple
+
+One major exception to this naming scheme is in CERTAIN PARTS OF the build
+scripts of cargo and rustc themselves, such as the `./configure` scripts and
+SOME PARTS of the `config.toml` files. Here, "build", "host" and "target" mean
+the same things they do in GNU toolchain terminology. However, IN OTHER PARTS
+OF the build scripts of cargo and rustc, as well as cargo and rustc's own
+output and logging messages, the term "host" and "target" mean as they do in
+the previous paragraph. Yes, it's a total mind fuck. :( Table for clarity:
+
+======================================= =============== ========================
+                                        Rust ecosystem, Some parts of the rustc
+GNU term / Debian envvar                rustc and cargo and cargo build scripts
+======================================= =============== ========================
+build   DEB_BUILD_{ARCH,RUST_TYPE}      host            build
+  the machine running the build
+--------------------------------------- --------------- ------------------------
+host    DEB_HOST_{ARCH,RUST_TYPE}       target          host(s)
+  the machine the build products run on
+--------------------------------------- --------------- ------------------------
+only relevant when building a compiler
+target  DEB_TARGET_{ARCH,RUST_TYPE}     N/A             target(s)
+  the one architecture that the built                     extra architectures
+  cross-compiler itself builds for                        to build "std" for
+--------------------------------------- --------------- ------------------------
+
+
+Porting to new architectures (on the same distro)
+=================================================
+
+As mentioned above, to cross-compile rust packages you need to install the rust
+standard library for each relevant foreign architecture. However, this is not
+needed when cross-compiling rustc itself; its build system will build any
+relevant foreign-architecture standard libraries automatically.
+
+Cross-build, in a schroot using sbuild
+--------------------------------------
+
+0. Set up an schroot for your native architecture, for sbuild:
+
+    sudo apt-get install sbuild
+    sudo sbuild-adduser $LOGNAME
+    newgrp sbuild # or log out and log back in
+    sudo sbuild-createchroot --include=eatmydata,ccache,gnupg unstable \
+      /srv/chroot/unstable-$(dpkg-architecture -qDEB_BUILD_ARCH)-sbuild \
+      http://deb.debian.org/debian
+
+   See https://wiki.debian.org/sbuild for more details.
+
+1. Build it:
+
+    sudo apt-get source --download-only rustc
+    sbuild --host=$new_arch rustc_*.dsc
+
+Cross-build, directly on your own system
+----------------------------------------
+
+0. Install the build-dependencies of rustc (including cargo and itself):
+
+    sudo dpkg --add-architecture $new_arch
+    sudo apt-get --no-install-recommends build-dep --host-architecture=$new_arch rustc
+
+1. Build it:
+
+    apt-get source --compile --host-architecture=$new_arch rustc
+
+Native-build using bundled upstream binary blobs
+------------------------------------------------
+
+Use the same instructions as given in "Bootstrapping" in debian/README.source
+in the source package, making sure to set the relevant architectures.
+
+Responsible distribution of cross-built binaries
+------------------------------------------------
+
+By nature, cross-builds do not run tests. These are important for rustc and
+many tests often fail on newly-supported architectures even if builds and
+cross-builds work fine. You should find some appropriate way to test your
+cross-built packages rather than blindly shipping them to users.
+
+For example, Debian experimental is an appropriate place to upload them, so
+that they can be installed and tested on Debian porter boxes, before being
+uploaded to unstable and distributed to users.
+
+
+Test failures
+=============
+
+Starting from version 1.20.0+dfsg1-1 the Debian packages of rustc no longer
+fail the overall build if > 0 tests fail. Instead, we allow up to around 5
+tests to fail. In other words, if you're reading this in a binary package,
+between 0 and 5 tests might have failed when building this.
+
+This is due to lack of maintainer time to investigate all failures. Many
+previous test failures were reported to upstream and did not receive a timely
+response, suggesting the failures were not important. I was then forced to
+patch out the test to make the build proceed, so several tests were being
+ignored in practise anyway.
+
+This brings the Debian package in line with the Fedora package which also
+ignores all test failures. (Many other distributions don't run tests at all.)
+
+If you think that the Debian rustc package is miscompiling your program in a
+way that the upstream distributed compiler doesn't, you may check the test
+failures here:
+
+https://buildd.debian.org/status/package.php?p=rustc
+
+If you can identify a relevant test failure, as well as the patches needed to
+fix it (either to rustc or LLVM), this will speed up the processing of any bug
+reports on the Debian side.
+
+We will also examine these failures ourselves on a best-effort basis and
+attempt to fix the more serious-looking ones.
+
+Uncommon architectures
+----------------------
+
+Debian release architectures armel and s390x currently have more test failures,
+being tracked by upstream here:
+
+- https://github.com/rust-lang/rust/issues/52493 armel
+- https://github.com/rust-lang/rust/issues/52491 s390x
+
+Ports architectures
+-------------------
+
+The number of allowed test failures on certain Debian ports architectures
+(currently powerpc, powerpcspe, sparc64, x32) is raised greatly to help unblock
+progress for porters. Of course, as a user this means you may run into more
+bugs than usual; as mentioned above bugs reports and patches are welcome.
+
+
+Shared libraries
+================
+
+For now, the shared libraries of Rust are private.
+The rational is the following:
+ * Upstream prefers static linking for now
+   - https://github.com/rust-lang/rust/issues/10209
+ * rust is still under heavy development. As far as we know, there is
+   no commitement from upstream to provide a stable ABI for now.
+   Until we know more, we cannot take the chance to have Rust-built packages
+   failing at each release of the compiler.
+ * Static builds are working out of the box just fine
+ * However, LD_LIBRARY_PATH has to be updated when -C prefer-dynamic is used
+
+ -- Sylvestre Ledru <sylvestre@debian.org>, Fri, 13 Feb 2015 15:08:43 +0100
diff --git a/README.source b/README.source
new file mode 100644 (file)
index 0000000..3495c25
--- /dev/null
@@ -0,0 +1,237 @@
+Document by Ximin Luo, Luca Bruno & Sylvestre Ledru
+
+This source package is unfortunately quite tricky and with several cutting
+edges, due to the complexity of rust-lang bootstrapping system and the high
+rate of language changes still ongoing.
+
+We try to describe here inner packaging details and the reasons behind them.
+
+If you are looking to help maintain this package, be sure to read the "Notes
+for package maintainers" section further below.
+
+
+Embedded libraries
+==================
+
+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:
+
+ * vendor/backtrace-sys, vendor/dlmalloc, vendor/walkdir
+
+   These are small C libraries designed to be statically linked; their upstream
+   does not support building them as a shared library and they are too small to
+   justify their own Debian package.
+
+
+Building from source
+====================
+
+The Debian rustc package will use the system rustc to bootstrap itself from.
+The system rustc has to be either the previous or the same version as the rustc
+being built; the build will fail if this is not the case.
+
+    sudo apt-get build-dep ./
+    dpkg-buildpackage
+    # Or, to directly use what's in the Debian FTP archive
+    sudo apt-get build-dep rustc
+    apt-get source --compile rustc
+
+Alternatively, you may give the "pkg.rustc.dlstage0" DEB_BUILD_PROFILE to
+instead use the process defined by Rust upstream. This downloads the "official"
+stage0 compiler for the version being built from rust-lang.org. At the time of
+writing "official" means "the previous stable version".
+
+    sudo apt-get build-dep -P pkg.rustc.dlstage0 ./
+    dpkg-buildpackage
+    # Or, to directly use what's in the Debian FTP archive
+    sudo apt-get build-dep -P pkg.rustc.dlstage0 rustc
+    apt-get source --compile -P pkg.rustc.dlstage0 rustc
+
+After [1] is fixed, both of these should in theory give identical results.
+
+If neither of these options are acceptable to you, e.g. because your distro
+does not have rustc already and your build process cannot access the network,
+see "Bootstrapping" below.
+
+[1] https://github.com/rust-lang/rust/issues/34902
+
+
+Bootstrapping
+=============
+
+To bootstrap rustc on a distro that does not have it or cargo available on any
+architecture (so cross-compiling is not an option) you can run `debian/rules
+source_orig-stage0`. This creates a .dsc that does not Build-Depend on rustc or
+cargo. Instead, it includes an extra orig-stage0 source tarball that contains
+the official stage0 compiler, pre-downloaded from rust-lang.org so that your
+build daemons don't need to access the network during the build.
+
+    debian/rules source_orig-stage0
+    # Follow the final manual instructions that it outputs. Then:
+    sbuild ../rustc_*.dsc && dput ../rustc_*.dsc
+
+To only bootstrap specific architectures, run this instead:
+
+    upstream_bootstrap_arch="arm64 armhf" debian/rules source_orig-stage0
+
+This way, other architectures will be omitted from the orig-stage0 tarball. You
+might want to do this e.g. if these other architectures are already present in
+your distro, but the $upstream_bootstrap_arch ones are not yet present.
+
+Notes
+-----
+
+The approach bundles the upstream bootstrapping binaries inside the Debian
+source package. This is a nasty hack that stretches the definition of "source
+package", but has a few advantages explained below.
+
+The traditional Debian way of bootstrapping compilers - and other distros have
+similar approaches - is some variant of the following:
+
+1. A developer locally installs some upstream bootstrapping binaries.
+2. They locally build a Debian package, using these binaries as undeclared
+   build dependencies.
+3. They upload these binary packages to Debian, which can be used as declared
+   Build-Depends in the future, including by the same package.
+
+The problem with this is, Debian does not have any policy nor infrastructure
+that can try to reproduce what this developer supposedly did.
+
+Using bootstrapping binary blobs *at some point of the process* is unavoidable.
+Rather than pretending we didn't do this, it is better to record *which blobs*
+we used, so it can be audited later. If we bundle non-Debian build-dependencies
+inside the source package, then we can do a *source-only upload*, and the
+building of the binary packages can be done by the normal build infrastructure.
+
+If the build process is reproducible [1] then we can be sure that *you* (as the
+developer that prepared the source-only upload) didn't backdoor the binaries,
+nor did the build daemons even if they were compromised during the build.
+
+The bootstrapping binaries may still have been backdoored, but this is true in
+both scenarios. So our arrangement is still a strict improvement in security,
+because it reduces the set of "things that may have been backdoored". Also,
+more people use the upstream binaries than the "magical original Debian
+package", so backdoors have a greater chance of being detected in the former.
+
+In the long run, this process is laying the foundations for doing Diverse
+Double-Compilation [2], where we use *many independent* bootstrapping binaries
+to reproduce bit-for-bit identical output compilers, giving confidence that
+nothing was backdoored along the way.
+
+[1] The build process for rustc is currently *not* reproducible but we're
+    working towards it. https://github.com/rust-lang/rust/issues/34902
+[2] http://www.dwheeler.com/trusting-trust/
+
+
+Maintaining this package
+========================
+
+Import of a new upstream version
+--------------------------------
+
+$ apt install equivs python3-magic
+$ sudo mk-build-deps -irt 'aptitude -R'
+$ uscan --verbose                       # or debian/rules source_orig-beta, for beta
+$ ver=UPDATE-ME                         # whatever it is, probably X.YY.Z or X.YY.Z~beta.N
+
+$ tar xf ../rustc-${ver/\~/-}-src.tar.xz && ( cd rustc-${ver/*~*/beta}-src/ && pwd && ../debian/prune-unused-deps ) && rm -rf rustc-${ver/*~*/beta}-src/
+# ^ If this fails, you probably need to refresh the patches used by debian/prune-unused-deps
+$ git diff
+# Review the diff. If it removes too much stuff, it could mean that rustc
+# pulled in new unnecessary dependencies in this newer version. See if you can
+# drop them by amending the patch "d-0000-ignore-removed-submodules.patch".
+# Rerun the above "tar ..." commands again and check that your patch works.
+# For example, there is absolutely no reason why rustc should need openssl.
+
+$ git commit -m "Update Files-Excluded for new upstream version ${ver/\~/-}" debian/copyright
+$ uscan --verbose                       # yes, again, to pick up the new Files-Excluded stuff
+                                        # or debian/rules source_orig-beta, for beta
+
+# Keep running this and follow its instructions, until it gives no output:
+$ debian/check-orig-suspicious.sh $ver
+# When you are satisfied with the above, proceed:
+
+$ git checkout debian/experimental
+$ gbp import-orig ../rustc_$ver+dfsg1.orig.tar.xz
+$ dch -v $ver+dfsg1-1~exp1 "New upstream release."
+$ debian/rules update-version
+# might also need to bump the version of the cargo Build-Depends
+# then refresh patches, etc etc
+# Use /usr/share/cargo/scripts/guess-crate-copyright to help update d/copyright quickly
+
+# If you need to repack again, bump the 'repacksuffix' in d/watch then run
+$ uscan --verbose --force-download
+# This will do a local repack using the new Files-Excluded rules, without
+# redownloading the orig tarball (despite the slightly misleading flag).
+
+
+Proceeding after build failure
+------------------------------
+
+If your build fails, don't run `./x.py` directly as that will detect it's being
+run with different settings, and run the build from scratch all over again.
+overwriting all intermediate files. Instead, do:
+
+$ debian/rules run_rustbuild X_CMD="build|test|install" X_FLAGS="whatever"
+
+Hopefully, this will directly proceed to the step that failed, without
+rebuilding everything in between.
+
+
+Comparing Debian rustc vs upstream rustc
+----------------------------------------
+
+This package does things the Debian way, which differs significantly from
+upstream practices. If you find a bug, you might want to check if it is present
+in the upstream package. Run "debian/rules debian/config.toml" to generate our
+config.toml that you can then use in an upstream directory **unpacked from the
+release tarball*. (It is more complex to get this working with their git repo.)
+
+This will configure it in a "halfway" style between upstream and Debian.
+Specifically, it will not build LLVM nor download stuff from crates.io, yet
+Debian patches are *not* applied. These specific settings were chosen as a
+tradeoff between convenience vs being close to what upstream does - so that the
+chances of a bug here being a genuine upstream issue rather than a Debian bug,
+is much higher. Also, with the exception of LLVM, these are non-default modes
+*supported by* upstream so they would be happy to receive bug reports about it
+even if your issue only occurs here.
+
+OTOH if you need to test a completely clean upstream build, including all the
+annoying stuff like building LLVM and downloading dependencies from crates.io,
+simply unpack the tarball and run `./configure && ./x.py build` etc as normal.
+This can be useful for confirming that an issue is caused by Debian's LLVM.
+
+If you need to test a LLVM patch, do something like this:
+
+# build your patched LLVM debs, then:
+$ mkdir -p llvm-destdir && cd llvm-destdir
+$ ver=4.0; VERSION=FIXME
+$ for i in llvm-$ver llvm-$ver-dev llvm-$ver-runtime llvm-$ver-tools libllvm$ver; do \
+    dpkg -x ../"$i"_*${VERSION}_*.deb .; done
+$ cd ../rustc
+$ debian/rules LLVM_DESTDIR=$PWD/../llvm-destdir build
+
+If you need to test a patch to the stage0 rustc, do something like this:
+
+# build your patched rustc debs or upstream rustc, then:
+$ mkdir -p rust-destdir && cd rust-destdir
+$ ver=1.20; VERSION=FIXME;
+$ for i in rustc libstd-rust-$ver libstd-rust-dev; do \
+    dpkg -x ../"$i"_*${VERSION}_*.deb .; done
+$ cd ../rustc
+$ debian/rules RUST_DESTDIR=$PWD/../rust-destdir build
+
+
+Useful links
+------------
+
+The Fedora rust team is more active than the Debian one. Here are their links:
+
+Source code
+https://src.fedoraproject.org/rpms/rust/tree/
+
+Binary packages and test logs
+https://kojipkgs.fedoraproject.org//packages/rust/
+If the same test fails both on Fedora and Debian it's a good indication that
+we're not Doing It Wrong and can file a valid bug upstream.
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..ed9f05b
--- /dev/null
+++ b/TODO
@@ -0,0 +1,12 @@
+Older backlog
+=============
+
+ * Use Compiler-rt package
+ * Improve the bootstrap (do the local build first on our systems, upload
+   to Debian and use the packages)
+ * Port on other archs
+ * Create a runtime package (rust-runtime)
+ * Move the runtime library into a public directory
+ * Package the various editors plugins (emacs, kate & vim)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 20 Jan 2015 08:50:28 +0100
diff --git a/architecture-test.mk b/architecture-test.mk
new file mode 100644 (file)
index 0000000..e7aeaba
--- /dev/null
@@ -0,0 +1,16 @@
+# Used for testing architecture.mk, and for make_orig-stage0_tarball.sh.
+# Not for end users.
+#
+# Usage:
+# $ make -s --no-print-directory -f debian/architecture-test.mk rust-for-deb_arm64
+# arm64 aarch64-unknown-linux-gnu
+
+include debian/architecture.mk
+
+deb_arch_setvars = $(foreach var,ARCH ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\
+  $(eval DEB_$(1)_$(var) = $(shell dpkg-architecture -a$(1) -qDEB_HOST_$(var) 2>/dev/null)))
+
+rust-for-deb_%:
+       $(eval $(call deb_arch_setvars,$*))
+       $(eval $(call rust_type_setvar,DEB_$*))
+       @echo $(DEB_$(*)_ARCH) $(DEB_$(*)_RUST_TYPE)
diff --git a/architecture.mk b/architecture.mk
new file mode 100644 (file)
index 0000000..825986d
--- /dev/null
@@ -0,0 +1,17 @@
+# This Makefile snippet defines DEB_*_RUST_TYPE triples based on DEB_*_GNU_TYPE
+
+include /usr/share/dpkg/architecture.mk
+
+rust_cpu = $(subst i586,i686,\
+$(if $(findstring -riscv64-,-$(2)-),$(subst riscv64,riscv64gc,$(1)),\
+$(if $(findstring -armhf-,-$(2)-),$(subst arm,armv7,$(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,\
+  $(eval $(call rust_type_setvar,DEB_$(machine))))
+
+# fallback for older dpkg versions
+ifeq ($(DEB_TARGET_RUST_TYPE),-unknown-)
+  DEB_TARGET_RUST_TYPE = $(DEB_HOST_RUST_TYPE)
+endif
diff --git a/bin/rust-lld b/bin/rust-lld
new file mode 100755 (executable)
index 0000000..b991b7f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Wrapper around lld that strips away -Wl, which it doesn't recognise.
+# We need this for the wasm32 tests, where we have generic RUSTFLAGS that
+# includes LDFLAGS from dpkg-buildflags which assumes a GCC linker.
+#
+# However the tests fail for other reasons, namely we can't build rustdoc
+# (which runs the tests) in wasm32 yet. So this is just WIP at the moment,
+# it is not expect to work nor to be installed on user machines.
+exec /usr/bin/lld-7 "${@/#-Wl,/}"
diff --git a/cargo/.package-cache b/cargo/.package-cache
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/changelog b/changelog
new file mode 100644 (file)
index 0000000..984b872
--- /dev/null
+++ b/changelog
@@ -0,0 +1,1206 @@
+rustc (1.41.1+dfsg1-1~deb10u1) buster; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport to buster.
+  * stage0 build.
+    - Use arm-unknown-linux-gnueabi target for armel.
+  * Use LLVM 7.
+  * Disable wasm.
+  * Reduce debugging symbols on i386 to avoid FTBFS due to OOM.
+
+ -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 08 Sep 2020 18:38:19 +0200
+
+rustc (1.41.1+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 03 Apr 2020 23:41:11 +0100
+
+rustc (1.41.1+dfsg1-1~exp1) experimental; urgency=medium
+
+  [ Ximin Luo ]
+  * More python 2 -> 3 fixes.
+  * Enable the wasm32-wasi target for code that needs a "real" libstd.
+  * Don't strip static rlibs. This sometimes breaks wasm, and more generally
+    the stripped debuginfo is actually totally lost rather than being moved
+    into the -dbgsym packages. Shared libraries are unaffected and work.
+  * Allow 180 failing tests on riscv64, none were actually run last time.
+
+  [ Fabian Grünbichler ]
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 09 Mar 2020 00:31:34 +0000
+
+rustc (1.40.0+dfsg1-5) unstable; urgency=medium
+
+  * More python 2 -> 3 fixes.
+  * Allow 24 failing tests on riscv64.
+  * Reenable debuginfo for rustc, not just libstd.
+  * Reenable backtraces during tests.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 05 Jan 2020 13:35:46 +0000
+
+rustc (1.40.0+dfsg1-4) unstable; urgency=medium
+
+  * Experimental riscv64 support.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 04 Jan 2020 05:40:11 +0000
+
+rustc (1.40.0+dfsg1-3) unstable; urgency=medium
+
+  * Work around upstream #59264 again. :/
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 03 Jan 2020 22:05:16 +0000
+
+rustc (1.40.0+dfsg1-2) unstable; urgency=medium
+
+  * Fix more internal build scripts so they use python3.
+  * Don't add -L/usr/lib/llvm when cross-compiling. (Closes: #941783)
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 03 Jan 2020 20:18:46 +0000
+
+rustc (1.40.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Ignore new test failing on arm that also fails in previous versions.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 29 Dec 2019 22:17:04 +0000
+
+rustc (1.40.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 25 Dec 2019 00:09:24 +0000
+
+rustc (1.39.0+dfsg1-4) unstable; urgency=medium
+
+  * Update to LLVM 9. (Closes: #946886)
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 23 Dec 2019 03:21:02 +0000
+
+rustc (1.39.0+dfsg1-3) unstable; urgency=medium
+
+  * Fix mips patch involving mxgot for new RUSTFLAGS behaviour.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 06 Dec 2019 22:18:53 +0000
+
+rustc (1.39.0+dfsg1-2) unstable; urgency=medium
+
+  * Include reproducibility patch for compiler-builtins.
+  * Use python3 instead of python to run rustbuild. (Closes: #938422)
+  * Expand d-ignore-error-detail-diff.patch for unfixed upstream #53081.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 05 Dec 2019 22:51:41 +0000
+
+rustc (1.39.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 30 Nov 2019 22:20:48 +0000
+
+rustc (1.38.0+dfsg1-2) unstable; urgency=medium
+
+  * Fix building with rustc 1.38.0
+  * Fix building with cargo 0.40.0
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 29 Nov 2019 00:05:16 +0000
+
+rustc (1.38.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 26 Nov 2019 14:41:46 +0000
+
+rustc (1.37.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Fix a typo in debian/rules regex causing FTBFS on some arches.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 05 Sep 2019 00:06:23 -0700
+
+rustc (1.37.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Support cross-compiling to wasm32. (Closes: #903110)
+    To do that, install the libstd-rust-dev-wasm32-cross package and give
+    --target wasm32-unknown-unknown.
+  * Drop dependency on system compiler-rt, these new versions of rustc
+    actually don't need it at all.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 29 Aug 2019 09:00:03 -0700
+
+rustc (1.37.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Use system compiler-rt.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 25 Aug 2019 03:06:33 -0700
+
+rustc (1.36.0+dfsg1-2) unstable; urgency=medium
+
+  * Set CARGO_HOME to debian/cargo_home (instead of $HOME/.cargo) as newer
+    versions of cargo must take a file lock that has to exist.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 17 Jul 2019 18:25:06 -0700
+
+rustc (1.36.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 16 Jul 2019 20:27:55 -0700
+
+rustc (1.36.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 13 Jul 2019 12:42:05 -0700
+
+rustc (1.35.0+dfsg1-1) unstable; urgency=medium
+
+  * Add entry in 1.34.2+dfsg1-1 to note that it uses LLVM 7.
+  * Add entry in 1.35.0+dfsg1-1~exp2 to note that it uses LLVM 8.
+  * Fix ICE on sparc64 by including upstream PR #61881.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 13 Jul 2019 10:30:35 -0700
+
+rustc (1.35.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * Don't use system compiler-rt, it's not ready yet.
+  * Update to LLVM 8.
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 09 Jun 2019 23:20:52 -0700
+
+rustc (1.34.2+dfsg1-1) unstable; urgency=medium
+
+  * Don't use system compiler-rt, there are issues with that for now.
+  * Use LLVM 7 for the Debian buster release.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 29 May 2019 21:52:37 -0700
+
+rustc (1.34.2+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Fix doc build, add version 1 compat mode hack for mdBook 2.
+  * Use system compiler-rt from libclang-common-*-dev.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 24 May 2019 00:39:59 -0700
+
+rustc (1.34.2+dfsg1-1~exp1) experimental; urgency=medium
+
+  * Ensure Cargo.toml is in rust-src.
+  * New upstream release.
+  * Update to LLVM 8.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 19 May 2019 02:40:02 -0700
+
+rustc (1.33.0+dfsg1-2) unstable; urgency=medium
+
+  * Add Fedora patches.
+  * Bump i386 allowed test failures to 12.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 18 May 2019 12:18:25 -0700
+
+rustc (1.33.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Fix build on mips, flags needed whitespace massaging.
+  * Drop obsolete patches.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 17 May 2019 21:04:20 -0700
+
+rustc (1.33.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+  [ Hiroaki Nakamura ]
+  * Delete obsolete patch.
+
+  [ Sylvestre Ledru ]
+  * Update compiler-rt patch.
+  * Improve build-related docs a bit.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 29 Apr 2019 19:50:48 -0700
+
+rustc (1.32.0+dfsg1-3) unstable; urgency=medium
+
+  * Conditionally-apply u-compiletest.patch based on stage0 compiler.
+  * Fix syntax error in d/rules compiletest check.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 17 Mar 2019 16:40:05 -0700
+
+rustc (1.32.0+dfsg1-2) unstable; urgency=medium
+
+  * More verbose logging during builds.
+  * Fix compiletest compile error, and check log has at least 1 pass.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 17 Mar 2019 12:52:57 -0700
+
+rustc (1.32.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 27 Jan 2019 22:02:48 -0800
+
+rustc (1.32.0~beta.2+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Note that this upstream version already Closes: #917191.
+  * Backport other upstream fixes. (Closes: #916818, #917000, #917192).
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 01 Jan 2019 15:26:57 -0800
+
+rustc (1.32.0~beta.2+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Drop obsolete d-sparc64-dont-pack-spans.patch
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 16 Dec 2018 13:48:25 -0800
+
+rustc (1.31.0+dfsg1-2) unstable; urgency=medium
+
+  * Bump mips mipsel s390x allowed-failures to 24.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 16 Dec 2018 14:34:44 -0800
+
+rustc (1.31.0+dfsg1-1) unstable; urgency=medium
+
+  * Revert debuginfo patches, they're not ready yet.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 16 Dec 2018 09:58:06 -0800
+
+rustc (1.31.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Drop redundant patches.
+  * Fix line numbers in some test-case patches.
+  * Backport an updated patch for gdb 8.2.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 15 Dec 2018 13:52:26 -0800
+
+rustc (1.31.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 14 Dec 2018 21:30:56 -0800
+
+rustc (1.31.0~beta.19+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Filter LLVM build flags to not be stupid.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 01 Dec 2018 12:17:52 -0800
+
+rustc (1.31.0~beta.19+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 29 Nov 2018 22:29:16 -0800
+
+rustc (1.31.0~beta.4+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Merge changes from Debian unstable.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 06 Nov 2018 19:45:26 -0800
+
+rustc (1.31.0~beta.4+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Drop old maintainers from Uploaders.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 04 Nov 2018 19:00:16 -0800
+
+rustc (1.30.0+dfsg1-2) unstable; urgency=medium
+
+  * Increase FAILURES_ALLOWED for mips mipsel to 20.
+  * Set debuginfo-only-std = false for 32-bit powerpc architectures.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 02 Nov 2018 01:42:36 -0700
+
+rustc (1.30.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable. (Closes: #881845)
+  * Increase FAILURES_ALLOWED for mips architectures.
+  * Set debuginfo-only-std = false for mips architectures.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 01 Nov 2018 10:05:52 -0700
+
+rustc (1.30.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Disable debuginfo-gdb tests relating to enums. These will be fixed in an
+    upcoming version, see upstream #54614 for details.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 31 Oct 2018 00:02:25 -0700
+
+rustc (1.30.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * Actually don't build docs in an arch-only build.
+  * Add mips patch, hopefully closes #881845 but let's see.
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 30 Oct 2018 22:05:59 -0700
+
+rustc (1.30.0~beta.7+dfsg1-1~exp3) experimental; urgency=medium
+
+  * Do the necessary bookkeeping for the LLVM update.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 26 Sep 2018 23:29:18 -0700
+
+rustc (1.30.0~beta.7+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Tweak test failure rules: armel <= 8, ppc64 <= 12.
+  * Update to LLVM 7.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 26 Sep 2018 21:43:30 -0700
+
+rustc (1.30.0~beta.7+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 23 Sep 2018 10:40:30 -0700
+
+rustc (1.29.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Drop d-armel-disable-kernel-helpers.patch as a necessary part of the
+    fix to #906520, so it is actually fixed.
+  * Backport a patch to fix the rand crate on powerpc. (Closes: #909400)
+  * Lower the s390x allowed failures back to 25.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 23 Sep 2018 10:16:53 -0700
+
+rustc (1.29.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Include patch for armel atomics. (Closes: #906520)
+  * Update to latest Standards-Version; no changes required.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 20 Sep 2018 22:33:20 -0700
+
+rustc (1.28.0+dfsg1-3) unstable; urgency=medium
+
+  * Team upload.
+
+  [ Ximin Luo ]
+  * More sparc64 fixes, and increase allowed-test-failures there to 180.
+
+  [ Julien Cristau ]
+  * Don't use pentium4 as i686 baseline (closes: #908561)
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 11 Sep 2018 15:54:27 +0200
+
+rustc (1.28.0+dfsg1-2) unstable; urgency=medium
+
+  * Switch on verbose-tests to restore the old pre-1.28 behaviour, and restore
+    old failure-counting logic.
+  * Allow 50 test failures on s390x, restored failure-counting logic avoids
+    more double-counts.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 05 Aug 2018 02:18:10 -0700
+
+rustc (1.28.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Add patches from Fedora to fix some test failures.
+  * Ignore a failure testing specific error output, under investigation.
+  * Allow 100 test failures on s390x, should be reducible later with LLVM 7.
+  * Temporary fix for mips64el bootstrap.
+  * Be even more verbose during the build.
+  * Update to latest Standards-Version.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 04 Aug 2018 23:04:41 -0700
+
+rustc (1.28.0~beta.14+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Update test-failure counting logic.
+  * Fix version constraints for Recommends: cargo.
+  * Add patch to fix sparc64 CABI.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 27 Jul 2018 04:26:52 -0700
+
+rustc (1.28.0~beta.14+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Update to latest Standards-Version; no changes required.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 25 Jul 2018 03:11:11 -0700
+
+rustc (1.27.2+dfsg1-1) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * Update of the alioth ML address.
+
+  [ Ximin Luo ]
+  * Fail the build if our version contains ~exp and we are not releasing to
+    experimental, this has happened by accident a few times already.
+  * Allow 36 and 44 test failures on armel and s390x respectively.
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 24 Jul 2018 21:35:56 -0700
+
+rustc (1.27.1+dfsg1-1~exp4) experimental; urgency=medium
+
+  * Unconditonally prune crate checksums to avoid having to manually prune them
+    whenever we patch the vendored crates.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 19 Jul 2018 14:49:18 -0700
+
+rustc (1.27.1+dfsg1-1~exp3) experimental; urgency=medium
+
+  * Add patch from Fedora to fix rebuild against same version.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 19 Jul 2018 08:52:03 -0700
+
+rustc (1.27.1+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Fix some failing tests.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 18 Jul 2018 09:06:44 -0700
+
+rustc (1.27.1+dfsg1-1~exp1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 13 Jul 2018 22:58:02 -0700
+
+rustc (1.26.2+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Stop ignoring tests that now pass.
+  * Don't ignore tests that still fail, instead raise FAILURES_ALLOWED.
+    This allows us to see the test failures in the build logs, rather than
+    hiding them.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 16 Jun 2018 12:39:59 -0700
+
+rustc (1.26.1+dfsg1-3) unstable; urgency=medium
+
+  * Fix build-dep version range to build against myself.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 31 May 2018 09:25:17 -0700
+
+rustc (1.26.1+dfsg1-2) unstable; urgency=medium
+
+  * Also ignore test_loading_cosine on ppc64el.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 30 May 2018 20:58:46 -0700
+
+rustc (1.26.1+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 30 May 2018 08:18:04 -0700
+
+rustc (1.26.0+dfsg1-1~exp4) experimental; urgency=medium
+
+  * Try alternative patch to ignore x86 stdsimd tests suggested by upstream.
+  * Bump up allowed-test-failures to 8 to account for the fact that we're now
+    double-counting some failures.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 29 May 2018 20:36:56 -0700
+
+rustc (1.26.0+dfsg1-1~exp3) experimental; urgency=medium
+
+  * Ignore some irrelevant tests on ppc64 and non-x86 platforms.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 29 May 2018 09:32:38 -0700
+
+rustc (1.26.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Add Breaks+Replaces for older libstd-rust-dev with codegen-backends.
+    (Closes: #899180)
+  * Backport some test and packaging fixes from Ubuntu.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 22 May 2018 22:00:53 -0700
+
+rustc (1.26.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Update to latest Standards-Version; no changes required.
+  * Update doc-base files. (Closes: #876831)
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 20 May 2018 03:11:45 -0700
+
+rustc (1.25.0+dfsg1-2) unstable; urgency=medium
+
+  * Add patches for LLVM's compiler-rt to fix bugs on sparc64 and mips64.
+    (Closes: #898982)
+  * Install codegen-backends into rustc rather than libstd-rust-dev.
+    (Closes: #899087)
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 19 May 2018 13:10:33 -0700
+
+rustc (1.25.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Allow up to 15 test failures on s390x.
+  * Set CARGO_INCREMENTAL=0 on sparc64.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 18 May 2018 01:11:15 -0700
+
+rustc (1.25.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Install missing codegen-backends.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 06 Apr 2018 14:05:36 -0700
+
+rustc (1.25.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Update to LLVM 6.0.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 01 Apr 2018 15:59:47 +0200
+
+rustc (1.24.1+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Raise allowed-test-failures to 160 on some non-release arches: powerpc,
+    powerpcspe, sparc64, x32.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 07 Mar 2018 20:07:27 +0100
+
+rustc (1.24.1+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Steal some patches from Fedora to fix some test failures.
+  * Update debian/patches/u-make-tests-work-without-rpath.patch to try to fix
+    some more test failures.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 05 Mar 2018 16:25:26 +0100
+
+rustc (1.24.1+dfsg1-1~exp1) experimental; urgency=medium
+
+  * More sparc64 CABI fixes. (Closes: #888757)
+  * New upstream release.
+  * Note that s390x baseline was updated in the meantime. (Closes: #851150)
+  * 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)
+  * Disable full-bootstrap again to work around upstream #48319.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 03 Mar 2018 14:23:29 +0100
+
+rustc (1.23.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 19 Jan 2018 11:49:31 +0100
+
+rustc (1.23.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Update to latest Standards-Version; no changes required.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 14 Jan 2018 00:08:17 +0100
+
+rustc (1.22.1+dfsg1-2) unstable; urgency=medium
+
+  * Fix B-D rustc version so this package can be built using itself.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 01 Jan 2018 14:27:19 +0100
+
+rustc (1.22.1+dfsg1-1) unstable; urgency=medium
+
+  [ Ximin Luo ]
+  * Remove unimportant files that autoload remote resources from rust-src.
+  * Fix more symlinks in rust-doc.
+  * On armhf, only generate debuginfo for libstd and not the compiler itself.
+    This works around buildds running out of memory, see upstream #45854.
+  * Update to latest Standards-Version; no changes required.
+
+  [ Chris Coulson ]
+  * Fix some test failures that occur because we build rust without an rpath.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 18 Dec 2017 19:46:25 +0100
+
+rustc (1.22.1+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Fix symlink target. (Closes: #877276)
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 25 Nov 2017 22:29:12 +0100
+
+rustc (1.21.0+dfsg1-3) unstable; urgency=medium
+
+  * Add/fix detection for sparc64, thanks to John Paul Adrian Glaubitz.
+  * Workaround FTBFS when building docs. (Closes: #880262)
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 06 Nov 2017 10:03:32 +0100
+
+rustc (1.21.0+dfsg1-2) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Fix bootstrapping using 1.21.0, which is more strict about redundant &mut
+    previously used in u-output-failed-commands.patch.
+  * Only allow up to 5 test failures.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 25 Oct 2017 20:27:30 +0200
+
+rustc (1.21.0+dfsg1-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Fix the "install" target for cross-compilations; cross-compiling with
+    sbuild --host=$foreign-arch should work again.
+  * Update to latest Standards-Version; changes:
+    - Priority changed to optional from extra.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 17 Oct 2017 00:42:54 +0200
+
+rustc (1.20.0+dfsg1-3) unstable; urgency=medium
+
+  * Disable jemalloc to fix FTBFS with 1.21 on armhf.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 25 Oct 2017 12:01:19 +0200
+
+rustc (1.20.0+dfsg1-2) unstable; urgency=medium
+
+  * Update changelog entry for 1.20.0+dfsg1-1 to reflect that it was actually
+    and accidentally uploaded to unstable. No harm, no foul.
+  * We are no longer failing the build when tests fail, see NEWS or
+    README.Debian for details.
+  * Bump LLVM requirement to fix some failing tests.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 21 Oct 2017 14:20:17 +0200
+
+rustc (1.20.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 15 Oct 2017 23:30:35 +0200
+
+rustc (1.19.0+dfsg3-4) unstable; urgency=medium
+
+  * Bump LLVM requirement to pull in a fix for a FTBFS on ppc64el.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 15 Oct 2017 21:31:03 +0200
+
+rustc (1.19.0+dfsg3-3) unstable; urgency=medium
+
+  * Fix a trailing whitespace for tidy.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 19 Sep 2017 16:09:41 +0200
+
+rustc (1.19.0+dfsg3-2) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Add a patch to print extra information when tests fail.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 19 Sep 2017 12:32:03 +0200
+
+rustc (1.19.0+dfsg3-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Upgrade to LLVM 4.0. (Closes: #873421)
+  * rust-src: install Debian patches as well
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 15 Sep 2017 04:02:09 +0200
+
+rustc (1.18.0+dfsg1-4) unstable; urgency=medium
+
+  * Support gperf 3.1. (Closes: #869610)
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 25 Jul 2017 23:19:47 +0200
+
+rustc (1.18.0+dfsg1-3) unstable; urgency=medium
+
+  * Upload to unstable.
+  * Disable failing run-make test on armhf.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 22 Jul 2017 20:30:25 +0200
+
+rustc (1.18.0+dfsg1-2) experimental; urgency=medium
+
+  * Update to latest Standards-Version; no changes required.
+  * Change rustc to Multi-Arch: allowed and update Build-Depends with :native
+    annotations. Multi-Arch: foreign is typically for arch-indep packages that
+    might need to satisfy dependency chains of different architectures. Also
+    update instructions on cross-compiling to match this newer situation.
+  * Build debugging symbols for non-libstd parts of rustc.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 17 Jul 2017 23:04:03 +0200
+
+rustc (1.18.0+dfsg1-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 27 Jun 2017 12:51:22 +0200
+
+rustc (1.17.0+dfsg2-8) unstable; urgency=medium
+
+  * Workaround for linux #865549, fix FTBFS on ppc64el.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 17 Jul 2017 13:41:59 +0200
+
+rustc (1.17.0+dfsg2-7) unstable; urgency=medium
+
+  * Show exception traceback in bootstrap.py to examine ppc64el build failure.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 21 Jun 2017 10:46:27 +0200
+
+rustc (1.17.0+dfsg2-6) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 21 Jun 2017 00:24:22 +0200
+
+rustc (1.17.0+dfsg2-5) experimental; urgency=medium
+
+  * More work-arounds for armhf test failures.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 16 Jun 2017 13:27:45 +0200
+
+rustc (1.17.0+dfsg2-4) experimental; urgency=medium
+
+  * Fix arch-indep and arch-dep tests.
+  * Bump the LLVM requirement to fix FTBFS on armhf.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 14 Jun 2017 21:37:16 +0200
+
+rustc (1.17.0+dfsg2-3) experimental; urgency=medium
+
+  * Try to force the real gdb package. Some resolvers like aspcud will select
+    gdb-minimal under some circumstances, but this causes the debuginfo-gdb
+    tests to break.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 14 Jun 2017 00:48:37 +0200
+
+rustc (1.17.0+dfsg2-2) experimental; urgency=medium
+
+  * Support and document cross-compiling of rustc itself.
+  * Document cross-compiling other rust packages such as cargo.
+  * Work around upstream #39015 by disabling those tests rather than by
+    disabling optimisation, which causes FTBFS on 1.17.0 ppc64el. See
+    upstream #42476 and #42532 for details.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 13 Jun 2017 21:13:31 +0200
+
+rustc (1.17.0+dfsg2-1) experimental; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * New upstream release
+
+  [ Ximin Luo ]
+  * Adapt packaging for rustbuild, the new upstream cargo-based build system.
+
+  [ Matthijs van Otterdijk ]
+  * Add a binary package, rust-src. (Closes: #846177)
+  * Link to local Debian web resources in the docs, instead of remote ones.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 16 May 2017 18:00:53 +0200
+
+rustc (1.16.0+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable so we have something to build 1.17 with.
+  * Update u-ignoretest-powerpc.patch for 1.16.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 19 Apr 2017 22:47:18 +0200
+
+rustc (1.16.0+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Don't ignore test failures on Debian unstable.
+  * Re-fix ignoring armhf test, accidentally reverted in previous version.
+  * Try to fix buildd failure by swapping B-D alternatives.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 16 Apr 2017 15:05:47 +0200
+
+rustc (1.16.0+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release
+  * u-ignoretest-jemalloc.patch removed (applied upstream)
+
+  [ Matthias Klose ]
+  * Bootstrap using the rustc version in the archive, on all architectures.
+  * Work around a GCC 4.8 ICE on AArch64.
+  * Use alternative build dependencies on cmake3 and binutils-2.26 for
+    builds on 14.04 LTS (trusty).
+  * debian/make_orig*dl_tarball.sh: Include all Ubuntu architectures.
+  * debian/rules: Ignore test results for now.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 13 Apr 2017 15:24:03 +0200
+
+rustc (1.15.1+dfsg1-1) unstable; urgency=medium
+
+  * Upload to unstable so we have something to build 1.16 with.
+  * Try to fix ignoring atomic-lock-free tests on armhf.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 22 Mar 2017 00:13:27 +0100
+
+rustc (1.15.1+dfsg1-1~exp3) experimental; urgency=medium
+
+  * Ignore atomic-lock-free tests on armhf.
+  * Update ignoretest-armhf_03.patch for newer 1.15.1 behaviour.
+  * Tidy up some other patches to do with ignoring tests.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 12 Mar 2017 04:15:33 +0100
+
+rustc (1.15.1+dfsg1-1~exp2) experimental; urgency=medium
+
+  * Update armhf ignoretest patch.
+  * Bootstrap armhf. (Closes: #809316, #834003)
+  * Bootstrap ppc4el. (Closes: #839643)
+  * Fix rust-lldb symlink. (Closes: #850639)
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 02 Mar 2017 23:01:26 +0100
+
+rustc (1.15.1+dfsg1-1~exp1) experimental; urgency=medium
+
+  * New upstream release (won't probably be in stretch).
+    see the 1.4 git branch for the follow up for stable
+  * Call to the test renamed from check-notidy => check
+  * d/p/u-destdir-support.diff: Apply upstream patch to support
+    destdir in the make install (for rustbuild, in later versions)
+  * Overrides the 'binary-or-shlib-defines-rpath' lintian warnings.
+    We need them for now
+  * Refresh of the patches
+
+  [ Sven Joachim ]
+  * Drop Pre-Depends on multiarch-support. (Closes: #856109)
+
+  [ Erwan Prioul ]
+  * Fix test and build failures for ppc64el. (Closes: #839643)
+
+  [ Ximin Luo ]
+  * Disable rustbuild for the time being (as it was in 1.14) and instead
+    bootstrap two new arches, armhf and ppc64el.
+  * Switch back to debhelper 9 to make backporting easier.
+  * Switch Build-Depends on binutils-multiarch back to binutils, the former is
+    no longer needed by the upstream tests.
+
+  [ Matthias Klose ]
+  * Compatibility fixes and improvements to help work better on Ubuntu.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 26 Feb 2017 21:12:27 +0100
+
+rustc (1.14.0+dfsg1-3) unstable; urgency=medium
+
+  * Fix mips64 Makefile patches.
+  * Don't run arch-dep tests in a arch-indep build.
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 04 Jan 2017 21:34:56 +0100
+
+rustc (1.14.0+dfsg1-2) unstable; urgency=medium
+
+  * Update README.Debian, the old one was way out of date.
+  * Detect mips CPUs in ./configure and fill in mips Makefile rules.
+  * Work around jemalloc-related problems in the upstream bootstrapping
+    binaries for arm64, ppc64el, s390x.
+  * Disable jemalloc on s390x - upstream already disable it for some other
+    arches.
+  * Disable jemalloc tests for arches where jemalloc is disabled.
+  * We still expect the following failures:
+    * arm64 should be fixed (i.e. no failures) compared to the previous upload.
+    * armhf will FTBFS due to 'Illegal instruction' and this can only be fixed
+      with the next stable rustc release.
+    * mips mipsel mips64el ppc64 ppc64el s390x will FTBFS due to yet other
+      test failures beyond the ones I fixed above; this upload is only to save
+      me manual work in producing nice reports that exhibit these failures.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 29 Dec 2016 23:00:47 +0100
+
+rustc (1.14.0+dfsg1-1) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * New upstream release
+  * Update debian/watch
+
+  [ Ximin Luo ]
+  * Try to bootstrap armhf ppc64 ppc64el s390x mips mipsel mips64el.
+    (Closes: #809316, #834003, #839643)
+  * Make rust-gdb and rust-lldb arch:all packages.
+  * Switch to debhelper 10.
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 24 Dec 2016 18:03:03 +0100
+
+rustc (1.13.0+dfsg1-2) unstable; urgency=high
+
+  * Skip macro-stepping test on arm64, until
+    https://github.com/rust-lang/rust/issues/37225 is resolved.
+
+ -- Luca Bruno <lucab@debian.org>  Sat, 26 Nov 2016 23:40:14 +0000
+
+rustc (1.13.0+dfsg1-1) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * New upstream release.
+
+  [ Ximin Luo ]
+  * Use Debian system jquery instead of upstream's embedded copy.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 11 Nov 2016 13:35:23 +0100
+
+rustc (1.12.1+dfsg1-1) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * New (minor) upstream release
+  * Missing dependency from rust-lldb to python-lldb-3.8 (Closes: #841833)
+  * Switch to llvm 3.9. (Closes: #841834)
+
+  [ Ximin Luo ]
+  * Dynamically apply rust-boot-1.12.1-from-1.12.0.diff.
+    This allows us to bootstrap from either 1.11.0 or 1.12.0.
+  * Bump LLVM Build-Depends version to get the backported patches for LLVM
+    #30402 and #29163.
+  * Install debugger_pretty_printers_common to rust-gdb and rust-lldb.
+    (Closes: #841835)
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 07 Nov 2016 14:15:14 +0100
+
+rustc (1.12.0+dfsg1-2) unstable; urgency=medium
+
+  * Ignore test run-make/no-duplicate-libs. Fails on i386
+  * Ignore test run-pass-valgrind/down-with-thread-dtors.rs . Fails on arm64
+  * I am not switching to llvm 3.9 now because a test freezes. The plan is
+    to silent the warning breaking the build and upload 1.12.1 after
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 05 Oct 2016 10:48:01 +0200
+
+rustc (1.12.0+dfsg1-1) unstable; urgency=medium
+
+  * new upstream release
+    - Rebase of the patches and removal of deprecated patches
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 29 Sep 2016 20:45:04 +0200
+
+rustc (1.11.0+dfsg1-3) unstable; urgency=medium
+
+  * Fix separate build-arch and build-indep builds.
+
+ -- Ximin Luo <infinity0@debian.org>  Tue, 13 Sep 2016 12:30:41 +0200
+
+rustc (1.11.0+dfsg1-2) unstable; urgency=medium
+
+  * Fix rebuilding against the current version, by backporting a patch I wrote
+    that was already applied upstream. Should fix the FTBFS that was observed
+    by tests.reproducible-builds.org.
+  * Ignore a failing stdcall test on arm64; should fix the FTBFS there.
+  * Backport a doctest fix I wrote, already applied upstream.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 12 Sep 2016 17:40:12 +0200
+
+rustc (1.11.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+  * Add versioned binutils dependency. (Closes: #819475, #823540)
+
+ -- Ximin Luo <infinity0@debian.org>  Wed, 07 Sep 2016 10:31:57 +0200
+
+rustc (1.10.0+dfsg1-3) unstable; urgency=medium
+
+  * Rebuild with LLVM 3.8, same as what upstream are using
+  * Dynamically link against LLVM. (Closes: #832565)
+
+ -- Ximin Luo <infinity0@debian.org>  Sat, 30 Jul 2016 22:36:41 +0200
+
+rustc (1.10.0+dfsg1-2) unstable; urgency=medium
+
+  * Tentatively support ARM architectures
+  * Include upstream arm64,armel,armhf stage0 compilers (i.e. 1.9.0 stable)
+    in a orig-dl tarball, like how we previously did for amd64,i386.
+
+ -- Ximin Luo <infinity0@debian.org>  Fri, 22 Jul 2016 15:54:51 +0200
+
+rustc (1.10.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+  * Add myself to uploaders
+  * Update our build process to bootstrap from the previous Debian rustc stable
+    version by default. See README.Debian for other options.
+  * Update to latest Standards-Version; no changes required.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 17 Jul 2016 03:40:49 +0200
+
+rustc (1.9.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release (Closes: #825752)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 29 May 2016 17:57:38 +0200
+
+rustc (1.8.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+
+  [ Ximin Luo ]
+  * Fix using XZ for the orig tarball: needs explicit --repack in debian/watch
+  * Drop wno-error patch; applied upstream.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 15 Apr 2016 12:01:45 +0200
+
+rustc (1.7.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 03 Mar 2016 22:41:24 +0100
+
+rustc (1.6.0+dfsg1-3) unstable; urgency=medium
+
+  * Apply upstream fix to silent a valgrind issue in the test suite
+    (Closes: ##812825)
+  * Add gcc & libc-dev as dependency of rustc to make sure it works
+    out of the box
+
+  [ Ximin Luo ]
+  * Work around rust bug https://github.com/rust-lang/rust/issues/31529
+  * Enable optional tests, and add verbosity/backtraces to tests
+  * Use XZ instead of GZ compression (will apply to the next new upload)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 02 Feb 2016 15:08:11 +0100
+
+rustc (1.6.0+dfsg1-2) unstable; urgency=medium
+
+  * mk/rt.mk: Modify upstream code to append -Wno-error rather than trying
+    to remove the string "-Werror".  (Closes: #812448)
+  * Disable new gcc-6 "-Wmisleading-indentation" warning, which triggers
+    (incorrectly) on src/rt/miniz.c.  (Closes: #811573)
+  * Guard arch-dependent dh_install commands appropriately, fixing
+    arch-indep-only builds.  (Closes: #809124)
+
+ -- Angus Lees <gus@debian.org>  Tue, 26 Jan 2016 05:40:14 +1100
+
+rustc (1.6.0+dfsg1-1) unstable; urgency=medium
+
+  * new upstream release
+
+  [ Ximin Luo ]
+  * Use secure links for Vcs-* fields.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 22 Jan 2016 10:56:08 +0100
+
+rustc (1.5.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+    - We believe that we should let rust transit to testing
+      (Closes: #786836)
+  * Move away from hash to the same rust naming schema
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 10 Dec 2015 17:23:32 +0100
+
+rustc (1.4.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+    198068b3 => 1bf6e69c
+  * Update the download url in debian/watch
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 30 Oct 2015 09:36:02 +0100
+
+rustc (1.3.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+    62abc69f => 198068b3
+  * jquery updated from 2.1.0 to 2.1.4
+
+  [ Ximin Luo ]
+  * Use LLVM 3.7 as upstream does, now that it's released. (Closes: #797626)
+  * Fix debian/copyright syntax mistakes.
+  * Don't Replace/Break previous versions of libstd-rust-*
+  * Check that the libstd-rust-* name in d/control matches upstream.
+  * Several other minor build tweaks.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 19 Sep 2015 14:39:35 +0200
+
+rustc (1.2.0+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release
+    libstd-rust-7d23ff90 => libstd-rust-62abc69f
+  * Add llvm-3.6-tools to the build dep as it is
+    now needed for tests
+  * Fix the Vcs-Browser value
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 08 Aug 2015 23:13:44 +0200
+
+rustc (1.1.0+dfsg1-3) unstable; urgency=medium
+
+  * rust-{gdb,lldb} now Replaces pre-split rustc package.
+    Closes: #793433.
+  * Several minor lintian cleanups.
+
+ -- Angus Lees <gus@debian.org>  Fri, 24 Jul 2015 17:47:48 +1000
+
+rustc (1.1.0+dfsg1-2) unstable; urgency=medium
+
+  [ Angus Lees ]
+  * Replace remote Rust logo with local file in HTML docs.
+  * Symlink rust-{gdb,lldb}.1 to {gdb,lldb}.1 manpages.
+    Note that gdb.1 requires the gdb-doc package, and that lldb.1 doesn't
+    exist yet (see #792908).
+  * Restore "Architecture: amd64 i386" filter, mistakenly removed in
+    previous version.  Unfortunately the toolchain bootstrap isn't ready
+    to support all Debian archs yet.  Closes: #793147.
+
+ -- Angus Lees <gus@debian.org>  Wed, 22 Jul 2015 09:51:08 +1000
+
+rustc (1.1.0+dfsg1-1) unstable; urgency=low
+
+  [ Angus Lees ]
+  * Set SONAME when building dylibs
+  * Split out libstd-rust, libstd-rust-dev, rust-gdb, rust-lldb from rustc
+    - libs are now installed into multiarch-friendly locations
+    - rpath is no longer required to use dylibs (but talk to Debian Rust
+      maintainers before building a package that depends on the dylibs)
+  * Install /usr/share/rustc/architecture.mk, which declares Rust arch
+    triples for Debian archs and is intended to help future Rust packaging
+    efforts.  Warning: it may not be complete/accurate yet.
+  * New upstream release (1.1)
+
+ -- Angus Lees <gus@debian.org>  Thu, 16 Jul 2015 14:23:47 +1000
+
+rustc (1.0.0+dfsg1-1) unstable; urgency=medium
+
+  [ Angus Lees ]
+  * New upstream release (1.0!)
+
+  [ Sylvestre Ledru ]
+  * Fix the watch file
+  * Update of the repack to remove llvm sources
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 16 May 2015 08:24:32 +1000
+
+rustc (1.0.0~beta.4-1~exp1) experimental; urgency=low
+
+  [ Angus Lees ]
+  * New upstream release (beta 3)
+    - Drop manpage patch - now included upstream
+  * Replace duplicated compile-time dylibs with symlinks to run-time libs
+    (reduces installed size by ~68MB)
+
+  [ Sylvestre Ledru ]
+  * New upstream release (beta 4)
+  * Replace two more occurrences of jquery by the package
+  * Repack upstream to remove an LLVM file with a non-DFSG license
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 06 May 2015 11:14:30 +0200
+
+rustc (1.0.0~alpha.2-1~exp1) experimental; urgency=low
+
+  [ Angus Lees ]
+  * Patch upstream manpages to address minor troff issues
+  * Make 'debian/rules clean' also clean LLVM source
+  * Rename primary 'rust' binary package to 'rustc'
+  * Fix potential FTBFS: rust-doc requires texlive-fonts-recommended (for
+    pzdr.tfm)
+  * Build against system LLVM
+
+  [ Sylvestre Ledru ]
+  * New testing release
+  * Renaming of the source package
+  * Set a minimal version for dpkg-dev and debhelper (for profiles)
+  * For now, disable build profiles as they are not supported in Debian
+  * Introduce some changes by Angus Lees
+    - Introduction of build stages
+    - Disable the parallel execution of tests
+    - Improving of the parallel syntax
+    - Use override_dh_auto_build-arch
+    - Use override_dh_auto_build-indep
+    - Better declarations of the doc
+    - Update of the description
+    - Watch file updated (with key check)
+
+  [ Luca Bruno ]
+  * rules: respect 'nocheck' DEB_BUILD_OPTIONS
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 07 Mar 2015 09:25:47 +0100
+
+rust (1.0.0~alpha-0~exp1) experimental; urgency=low
+
+  * Initial package (Closes: #689207)
+    Work done by Luca Bruno, Jordan Justen and Sylvestre Ledru
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 23 Jan 2015 15:47:37 +0100
diff --git a/check-orig-suspicious.sh b/check-orig-suspicious.sh
new file mode 100755 (executable)
index 0000000..b0bf28c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+ver="$1"
+test -n "$ver" || exit 2
+
+SUS_WHITELIST=$(find "${PWD}/debian" -name upstream-tarball-unsuspicious.txt -type f)
+
+rm -rf rustc-${ver/*~*/beta}-src/
+tar xf ../rustc_$ver+dfsg1.orig.tar.xz && cd rustc-${ver/*~*/beta}-src/
+
+/usr/share/cargo/scripts/audit-vendor-source \
+  "$SUS_WHITELIST" \
+  "Files-Excluded: in debian/copyright and run a repack."
+
+echo "Artifacts left in rustc-$ver-src, please remove them yourself."
diff --git a/compat b/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
+++ b/compat
@@ -0,0 +1 @@
+9
diff --git a/config.toml.in b/config.toml.in
new file mode 100644 (file)
index 0000000..4159493
--- /dev/null
@@ -0,0 +1,62 @@
+[build]
+submodules = false
+vendor = true
+locked-deps = false
+verbose = 2
+
+rustc = "RUST_DESTDIR/usr/bin/rustc"
+cargo = "RUST_DESTDIR/usr/bin/cargo"
+
+build = "DEB_BUILD_RUST_TYPE"
+host = ["DEB_HOST_RUST_TYPE"]
+target = ["DEB_TARGET_RUST_TYPE"]
+
+#full-bootstrap = true
+# originally needed to work around #45317 but no longer necessary
+# currently we have to omit it because it breaks #48319
+
+# this might get changed later by override_dh_auto_configure-indep
+# we do it this way to avoid spurious rebuilds
+docs = false
+
+[install]
+prefix = "/usr"
+
+[target.DEB_BUILD_RUST_TYPE]
+llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config"
+linker = "DEB_BUILD_GNU_TYPE-gcc"
+
+ifelse(DEB_BUILD_RUST_TYPE,DEB_HOST_RUST_TYPE,,
+[target.DEB_HOST_RUST_TYPE]
+llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config"
+linker = "DEB_HOST_GNU_TYPE-gcc"
+
+)dnl
+ifelse(DEB_BUILD_RUST_TYPE,DEB_TARGET_RUST_TYPE,,DEB_HOST_RUST_TYPE,DEB_TARGET_RUST_TYPE,,
+[target.DEB_TARGET_RUST_TYPE]
+llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config"
+linker = "DEB_TARGET_GNU_TYPE-gcc"
+
+)dnl
+[target.wasm32-wasi]
+wasi-root = "/usr"
+
+[llvm]
+link-shared = true
+
+[rust]
+jemalloc = false
+optimize = MAKE_OPTIMISATIONS
+dist-src = false
+
+channel = "RELEASE_CHANNEL"
+
+# parallel codegen interferes with reproducibility, see
+# https://github.com/rust-lang/rust/issues/34902#issuecomment-319463586
+#codegen-units = 0
+debuginfo-level = 2
+debuginfo-level-std = 2
+rpath = false
+
+verbose-tests = true
+backtrace-on-ice = true
diff --git a/control b/control
new file mode 100644 (file)
index 0000000..ba1a394
--- /dev/null
+++ b/control
@@ -0,0 +1,216 @@
+Source: rustc
+Section: devel
+Priority: optional
+Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+Uploaders:
+ Ximin Luo <infinity0@debian.org>,
+ Sylvestre Ledru <sylvestre@debian.org>
+# :native annotations are to support cross-compiling, see README.Debian
+Build-Depends: debhelper (>= 9),
+               dpkg-dev (>= 1.17.14),
+               python3:native,
+#               cargo:native (>= 0.40.0)      <!pkg.rustc.dlstage0>,
+#               rustc:native (>= 1.40.0+dfsg) <!pkg.rustc.dlstage0>,
+#               rustc:native (<= 1.41.1++)    <!pkg.rustc.dlstage0>,
+               llvm-7-dev:native,
+               llvm-7-tools:native,
+#               libllvm7 (>= 1:9.0.1-2),
+               autotools-dev,
+               cmake (>= 3.0) | cmake3,
+# needed by some vendor crates
+               pkg-config,
+# this is sometimes needed by rustc_llvm
+               zlib1g-dev:native,
+               zlib1g-dev,
+# used by rust-installer
+               liblzma-dev:native,
+# test dependencies:
+               binutils (>= 2.26) <!nocheck> | binutils-2.26 <!nocheck>,
+               git <!nocheck>,
+               procps <!nocheck>,
+# below are optional tools even for 'make check'
+               gdb (>= 7.12) <!nocheck>,
+# Extra build-deps needed for x.py to download stuff in pkg.rustc.dlstage0.
+               curl <pkg.rustc.dlstage0>,
+               ca-certificates <pkg.rustc.dlstage0>,
+#Build-Depends-Indep:
+# wasi-libc (>= 0.0~git20191220.a280fea~~) <!nowasm>,
+# wasi-libc (<= 0.0~git20191220.a280fea++) <!nowasm>,
+Build-Conflicts: gdb-minimal <!nocheck>
+Standards-Version: 4.2.1
+Homepage: http://www.rust-lang.org/
+Vcs-Git: https://salsa.debian.org/rust-team/rust.git
+Vcs-Browser: https://salsa.debian.org/rust-team/rust
+
+Package: rustc
+Architecture: any
+Multi-Arch: allowed
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-dev (= ${binary:Version}),
+ gcc, libc-dev, binutils (>= 2.26)
+Recommends: cargo (>= 0.42.0~~), cargo (<< 0.43.0~~), rust-gdb | rust-lldb
+Suggests: rust-doc, rust-src, lld-7
+Replaces: libstd-rust-dev (<< 1.25.0+dfsg1-2~~)
+Breaks: libstd-rust-dev (<< 1.25.0+dfsg1-2~~)
+Description: Rust systems programming language
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+
+Package: libstd-rust-1.41
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Rust standard libraries
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains the standard Rust libraries, built as dylibs.
+
+Package: libstd-rust-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-1.41 (= ${binary:Version})
+Description: Rust standard libraries - development files
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains development files necessary to use the standard
+ Rust libraries.
+
+#Package: libstd-rust-dev-wasm32-cross
+#Section: libdevel
+#Architecture: all
+#Depends: ${shlibs:Depends}, ${misc:Depends}, lld-7
+## Embeds wasi-libc so doesn't need to depend on it
+## None of its licenses require source redistrib, so no need for Built-Using
+#Build-Profiles: <!nowasm>
+#Description: Rust standard libraries - development files
+# Rust is a curly-brace, block-structured expression language.  It
+# visually resembles the C language family, but differs significantly
+# in syntactic and semantic details.  Its design is oriented toward
+# concerns of "programming in the large", that is, of creating and
+# maintaining boundaries - both abstract and operational - that
+# preserve large-system integrity, availability and concurrency.
+# .
+# It supports a mixture of imperative procedural, concurrent actor,
+# object-oriented and pure functional styles.  Rust also supports
+# generic programming and meta-programming, in both static and dynamic
+# styles.
+# .
+# This package contains development files necessary to use the standard
+# Rust libraries, for cross-compiling to the wasm32-unknown-unknown target.
+
+Package: rust-gdb
+Architecture: all
+Depends: gdb, ${misc:Depends}
+Suggests: gdb-doc
+Replaces: rustc (<< 1.1.0+dfsg1-1)
+Description: Rust debugger (gdb)
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains pretty printers and a wrapper script for
+ invoking gdb on rust binaries.
+
+Package: rust-lldb
+Architecture: all
+# When updating, also update rust-lldb.links
+Depends: lldb-7, ${misc:Depends}, python3-lldb-7
+Replaces: rustc (<< 1.1.0+dfsg1-1)
+Description: Rust debugger (lldb)
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains pretty printers and a wrapper script for
+ invoking lldb on rust binaries.
+
+Package: rust-doc
+Section: doc
+Architecture: all
+Build-Profiles: <!nodoc>
+Depends: ${misc:Depends},
+ libjs-jquery, libjs-highlight.js, libjs-mathjax,
+ fonts-open-sans, fonts-font-awesome
+Recommends: cargo-doc
+Description: Rust systems programming language - Documentation
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains the Rust tutorial, language reference and
+ standard library documentation.
+
+Package: rust-src
+Architecture: all
+Depends: ${misc:Depends}
+Description: Rust systems programming language - source code
+ Rust is a curly-brace, block-structured expression language.  It
+ visually resembles the C language family, but differs significantly
+ in syntactic and semantic details.  Its design is oriented toward
+ concerns of "programming in the large", that is, of creating and
+ maintaining boundaries - both abstract and operational - that
+ preserve large-system integrity, availability and concurrency.
+ .
+ It supports a mixture of imperative procedural, concurrent actor,
+ object-oriented and pure functional styles.  Rust also supports
+ generic programming and meta-programming, in both static and dynamic
+ styles.
+ .
+ This package contains sources of the Rust compiler and standard
+ libraries, useful for IDEs and code analysis tools such as Racer.
diff --git a/copyright b/copyright
new file mode 100644 (file)
index 0000000..7899263
--- /dev/null
+++ b/copyright
@@ -0,0 +1,1747 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: rust
+Source: https://www.rust-lang.org
+Files-Excluded:
+ *.min.js
+ src/llvm-emscripten
+ src/llvm-project
+ vendor/jemalloc-sys
+ vendor/mdbook/src/theme/FontAwesome
+ vendor/mdbook/src/theme/highlight.js
+ vendor/mdbook/src/theme/highlight.css
+# Exclude submodules https://github.com/rust-lang/rust/tree/master/src/tools
+# We prefer to do them in different Debian packages so they can have their own
+# version numbers. If upstream merges them "properly" (i.e. unify the version
+# numbers) then we can merge the packages in Debian. Note that cargotest here
+# does actually belong to rustc, it is an integration test suite for rustc to
+# check that certain popular crates continue to compile. It is not the same as
+# cargo's own test suite (in its own package) also called cargotest.
+# NB: don't exclude rust-installer, it's needed for "install" functionality
+ src/tools/cargo
+ src/tools/clippy
+ src/tools/rls
+ src/tools/remote-test-client
+ src/tools/remote-test-server
+ src/tools/rustfmt
+ src/tools/miri
+# Embedded C libraries
+ vendor/libz-sys/src/zlib*
+ vendor/lzma-sys*/xz-*
+# Embedded binary blobs
+ vendor/winapi-*/*/*.a
+ vendor/mdbook/src/theme/playpen_editor
+# Embedded proprietary doc formats
+ src/doc/book/nostarch/docx
+# unused dependencies, generated by debian/prune-unused-deps
+# DO NOT EDIT below, AUTOGENERATED
+ vendor/adler32
+ vendor/arc-swap
+ vendor/argon2rs
+ vendor/base64
+ vendor/bitmaps
+ vendor/blake2-rfc
+ vendor/bstr
+ vendor/bytecount
+ vendor/bytes
+ vendor/bytesize
+ vendor/cargo_metadata-0.8.0
+ vendor/cargo_metadata
+ vendor/colored
+ vendor/commoncrypto
+ vendor/commoncrypto-sys
+ vendor/compiletest_rs
+ vendor/constant_time_eq
+ vendor/cookie
+ vendor/cookie_store
+ vendor/core-foundation-0.6.3
+ vendor/core-foundation
+ vendor/core-foundation-sys-0.6.2
+ vendor/core-foundation-sys
+ vendor/crossbeam-channel
+ vendor/crossbeam-deque-0.6.3
+ vendor/crossbeam-utils
+ vendor/crypto-hash
+ vendor/curl
+ vendor/curl-sys
+ vendor/derive_more
+ vendor/derive-new
+ vendor/directories
+ vendor/dirs
+ vendor/dirs-sys
+ vendor/dtoa
+ vendor/dunce
+ vendor/encoding_rs
+ vendor/foreign-types
+ vendor/foreign-types-shared
+ vendor/fs2
+ vendor/fst
+ vendor/fuchsia-cprng
+ vendor/futures
+ vendor/futures-cpupool
+ vendor/fwdansi
+ vendor/git2
+ vendor/git2-curl
+ vendor/glob
+ vendor/globset
+ vendor/h2
+ vendor/hex-0.3.2
+ vendor/hex
+ vendor/home
+ vendor/httparse
+ vendor/http-body
+ vendor/http
+ vendor/hyper
+ vendor/hyper-tls
+ vendor/if_chain
+ vendor/ignore
+ vendor/im-rc
+ vendor/iovec
+ vendor/json
+ vendor/jsonrpc-client-transports
+ vendor/jsonrpc-core
+ vendor/jsonrpc-core-client
+ vendor/jsonrpc-derive
+ vendor/jsonrpc-ipc-server
+ vendor/jsonrpc-pubsub
+ vendor/jsonrpc-server-utils
+ vendor/lazycell
+ vendor/libgit2-sys
+ vendor/libnghttp2-sys
+ vendor/libssh2-sys
+ vendor/lsp-codec
+ vendor/lsp-types
+ vendor/mdbook-linkcheck
+ vendor/mime
+ vendor/mime_guess
+ vendor/miniz_oxide
+ vendor/mio
+ vendor/mio-named-pipes
+ vendor/mio-uds
+ vendor/miow-0.2.1
+ vendor/native-tls
+ vendor/net2
+ vendor/opener
+ vendor/openssl
+ vendor/openssl-probe
+ vendor/openssl-src
+ vendor/openssl-sys
+ vendor/ordslice
+ vendor/owning_ref
+ vendor/packed_simd
+ vendor/parity-tokio-ipc
+ vendor/parking_lot-0.7.1
+ vendor/parking_lot_core-0.4.0
+ vendor/percent-encoding-1.0.1
+ vendor/pretty_env_logger
+ vendor/proc-macro-crate
+ vendor/proc-macro-error
+ vendor/publicsuffix
+ vendor/quine-mc_cluskey
+ vendor/racer
+ vendor/rand_os
+ vendor/rand_xoshiro
+ vendor/rdrand
+ vendor/redox_users
+ vendor/reqwest
+ vendor/rls-analysis
+ vendor/rls-vfs
+ vendor/rustc-ap-arena
+ vendor/rustc-ap-graphviz
+ vendor/rustc-ap-rustc_data_structures
+ vendor/rustc-ap-rustc_errors
+ vendor/rustc-ap-rustc_index
+ vendor/rustc-ap-rustc_lexer
+ vendor/rustc-ap-rustc_macros
+ vendor/rustc-ap-rustc_target
+ vendor/rustc-ap-serialize
+ vendor/rustc-ap-syntax
+ vendor/rustc-ap-syntax_pos
+ vendor/rustc_tools_util
+ vendor/schannel
+ vendor/scoped_threadpool
+ vendor/scopeguard-0.3.3
+ vendor/security-framework
+ vendor/security-framework-sys
+ vendor/serde_ignored
+ vendor/serde_repr
+ vendor/serde_urlencoded
+ vendor/shell-escape
+ vendor/signal-hook
+ vendor/sized-chunks
+ vendor/slab
+ vendor/string
+ vendor/strip-ansi-escapes
+ vendor/structopt
+ vendor/structopt-derive
+ vendor/term
+ vendor/tester
+ vendor/tokio-buf
+ vendor/tokio
+ vendor/tokio-codec
+ vendor/tokio-current-thread
+ vendor/tokio-executor
+ vendor/tokio-fs
+ vendor/tokio-io
+ vendor/tokio-named-pipes
+ vendor/tokio-process
+ vendor/tokio-reactor
+ vendor/tokio-service
+ vendor/tokio-signal
+ vendor/tokio-tcp
+ vendor/tokio-threadpool
+ vendor/tokio-timer
+ vendor/tokio-udp
+ vendor/tokio-uds
+ vendor/try_from
+ vendor/try-lock
+ vendor/unicode_categories
+ vendor/url-1.7.2
+ vendor/utf8parse
+ vendor/uuid
+ vendor/vergen
+ vendor/version_check
+ vendor/vte
+ vendor/want
+ vendor/winreg
+ vendor/ws2_32-sys
+# DO NOT EDIT above, AUTOGENERATED
+
+Files: C*.md
+       R*.md
+       Cargo.lock
+       Cargo.toml
+       COPYRIGHT
+       LICENSE*
+       configure
+       config.toml.example
+       git-commit-hash
+       src/README.md
+       src/bootstrap/*
+       src/build_helper/*
+       src/ci/*
+       src/doc/*
+       src/etc/*
+       src/lib*
+       src/rt*
+       src/rust*
+       src/stage0.txt
+       src/stdarch/*
+       src/tools/*
+       src/test/*
+       version
+       x.py
+Copyright: 2006-2009 Graydon Hoare
+           2009-2012 Mozilla Foundation
+           2012-2017 The Rust Project Developers (see AUTHORS.txt)
+License: MIT or Apache-2.0
+
+Files: vendor/compiler_builtins/*
+Copyright: 2016-2019 Jorge Aparicio <japaricious@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/rust-lang-nursery/compiler-builtins
+
+Files: src/librustdoc/html/static/FiraSans*
+Copyright: 2014, Mozilla Foundation, 2014, Telefonica S.A.
+License: SIL-OPEN-FONT
+
+Files: src/librustdoc/html/static/SourceCodePro*
+Copyright: 2010, 2012 Adobe Systems Incorporated
+License: SIL-OPEN-FONT
+
+Files: src/librustdoc/html/static/SourceSerifPro*
+Copyright: 2014 Adobe Systems Incorporated
+License: SIL-OPEN-FONT
+
+Files: src/librustdoc/html/static/main.js
+Copyright: 2014 The Rust Project Developers
+License: MIT or Apache-2.0
+
+Files: src/libstd/memchr.rs
+Copyright: 2015 Andrew Gallant, bluss and Nicolas Koch
+License: MIT or Apache-2.0
+
+Files: src/libstd/sync/mpsc/mpsc_queue.rs
+       src/libstd/sync/mpsc/spsc_queue.rs
+Copyright: 2010-2011 Dmitry Vyukov
+License: BSD-2-Clause
+
+Files:
+ vendor/bitflags/*
+ vendor/cc/*
+ vendor/cmake/*
+ vendor/env_logger/*
+ vendor/env_logger-0*/*
+ vendor/getopts/*
+ vendor/libc/*
+ vendor/log/*
+ vendor/regex/*
+ vendor/regex-syntax/*
+ vendor/rustc-hash/*
+ vendor/time/*
+Copyright: 2010-2018 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment:
+ This is a collection of external crates embedded here to bootstrap cargo.
+ Most of them come from the original upstream Rust project, thus share the
+ same MIT/Apache-2.0 dual-license. See https://github.com/rust-lang.
+ Exceptions are noted below.
+
+Files: vendor/num-integer/*
+       vendor/num-traits/*
+Copyright: 2014-2018 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/rust-num/num
+
+Files:
+ vendor/string_cache/*
+ vendor/string_cache_codegen/*
+ vendor/string_cache_shared/*
+ vendor/unicode-bidi/*
+Copyright: 2015-2017 Alex Crichton <alex@alexcrichton.com>
+           2015-2017 Keegan McAllister <kmcallister@mozilla.com>
+           2015-2017 Chris Morgan <me@chrismorgan.info>
+           2014-2017 The html5ever Project Developers
+           2014-2017 The Servo Project Developers
+           2013-2017 Simon Sapin <simon.sapin@exyr.org>
+License: MIT or Apache-2.0
+Comment: see https://github.com/servo/
+
+Files:
+ vendor/getrandom/*
+ vendor/rand/*
+ vendor/rand-0*/*
+ vendor/rand_chacha/*
+ vendor/rand_chacha-0*/*
+ vendor/rand_core/*
+ vendor/rand_core-0*/*
+ vendor/rand_hc/*
+ vendor/rand_hc-0*/*
+ vendor/rand_isaac/*
+ vendor/rand_pcg/*
+ vendor/rand_xorshift/*
+ vendor/rand_xorshift-0*/*
+Copyright: 2010-2019 The Rand Project Developers
+           2010-2019 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/rust-random/getrandom
+ see https://github.com/rust-random/rand
+ see https://github.com/rust-random/small-rngs
+
+Files:
+ vendor/backtrace/*
+ vendor/backtrace-sys/*
+ vendor/cfg-if/*
+ vendor/filetime/*
+ vendor/flate2/*
+ vendor/fnv/*
+ vendor/jobserver/*
+ vendor/libz-sys/*
+ vendor/lzma-sys/*
+ vendor/miow/*
+ vendor/pkg-config/*
+ vendor/proc-macro2/*
+ vendor/proc-macro2-0*/*
+ vendor/rustc-demangle/*
+ vendor/scoped-tls/*
+ vendor/socket2/*
+ vendor/tar/*
+ vendor/toml/*
+ vendor/xz2/*
+Copyright: 2014-2019 Alex Crichton <alex@alexcrichton.com>
+           2015-2017 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/alexcrichton/
+
+Files: vendor/dlmalloc/*
+Copyright: 2017-2019 Alex Crichton <alex@alexcrichton.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/alexcrichton/dlmalloc-rs
+
+Files: vendor/dlmalloc/src/dlmalloc.c
+Copyright: 2000-2012 Doug Lea <dl@cs.oswego.edu>
+License: CC0-1.0
+
+Files: vendor/backtrace-sys/src/libbacktrace/*
+Copyright: 2012-2016 Free Software Foundation, Inc.
+License: BSD-3-Clause
+Comment: written by Ian Lance Taylor, Google.
+
+Files:
+ vendor/backtrace-sys/src/libbacktrace/filenames.h
+ vendor/backtrace-sys/src/libbacktrace/ltmain.sh
+Copyright: 2000, 2001, 2007, 2010 Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: vendor/ammonia/*
+Copyright: 2015-2018 Michael Howell <michael@notriddle.com>
+License: MIT  or  Apache-2.0
+Comment: see https://github.com/notriddle/ammonia
+
+Files: vendor/annotate-snippets/*
+Copyright: 2018-2019 Zibi Braniecki <gandalf@mozilla.com>
+License: Apache-2.0 or MIT
+Comment: see https://github.com/zbraniecki/annotate-snippets-rs
+
+Files: vendor/ansi_term/*
+Copyright: 2014-2016 ogham@bsago.me
+           2014-2016 Ryan Scheel (Havvy) <ryan.havvy@gmail.com>
+License: MIT
+Comment: see https://github.com/ogham/rust-ansi-term
+
+Files: vendor/aho-corasick/*
+       vendor/memchr/*
+       vendor/utf8-ranges/*
+Copyright: 2015 Andrew Gallant <jamslam@gmail.com>
+           2015-2018 bluss
+License: MIT or Unlicense
+Comment: see upstream projects,
+ * https://github.com/docopt/docopt.rs
+ * https://github.com/BurntSushi/aho-corasick
+ * https://github.com/BurntSushi/rust-memchr
+ * https://github.com/BurntSushi/utf8-ranges
+
+Files: vendor/arrayref/*
+Copyright: 2015-2018 David Roundy <roundyd@physics.oregonstate.edu>
+License: BSD-2-Clause
+Comment: see https://github.com/droundy/arrayref
+
+Files: vendor/autocfg/*
+Copyright: 2018-2019 Josh Stone <cuviper@gmail.com>
+License: Apache-2.0 or MIT
+
+Files: vendor/atty/*
+Copyright: 2015-2017 softprops <d.tangren@gmail.com>
+License: MIT
+Comment: see https://github.com/softprops/atty
+
+Files:
+ vendor/block-buffer/*
+ vendor/byte-tools/*
+ vendor/digest/*
+ vendor/fake-simd/*
+ vendor/sha-1/*
+Copyright: 2016-2019 RustCrypto Project Developers
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/RustCrypto/traits
+ see https://github.com/RustCrypto/utils
+
+Files:
+ vendor/byteorder/*
+ vendor/same-file/*
+ vendor/termcolor/*
+ vendor/walkdir/*
+ vendor/winapi-util/*
+ vendor/wincolor/*
+Copyright: 2015-2018 Andrew Gallant <jamslam@gmail.com>
+License: Unlicense or MIT
+Comment:
+ see https://github.com/BurntSushi/byteorder
+ see https://github.com/BurntSushi/same-file
+ see https://github.com/BurntSushi/walkdir
+ see https://github.com/BurntSushi/winapi-util
+ see https://github.com/BurntSushi/ripgrep/tree/master/termcolor
+ see https://github.com/BurntSushi/ripgrep/tree/master/wincolor
+
+Files: vendor/log_settings/*
+Copyright: 2016-2018 Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
+License: MIT
+Comment: see https://github.com/oli-obk/log_settings
+
+Files:
+ vendor/c2-chacha/*
+ vendor/ppv-lite86/*
+Copyright: 2019-2019 The CryptoCorrosion Contributors
+License: MIT or Apache-2.0
+Comment: see https://github.com/cryptocorrosion/cryptocorrosion
+
+Files:
+ vendor/chalk-engine/*
+ vendor/chalk-macros/*
+Copyright: 2015-2018 Rust Compiler Team
+           2015-2018 Chalk developers
+License: Apache-2.0 or MIT
+Comment: see https://github.com/rust-lang-nursery/chalk
+
+Files: vendor/chrono/*
+Copyright: 2014-2018 Kang Seonghoon <public+rust@mearie.org>
+License: MIT or Apache-2.0
+Comment: see https://github.com/chronotope/chrono
+
+Files: vendor/clap/*
+Copyright: 2015-2017 Kevin K. <kbknapp@gmail.com>
+License: MIT
+Comment: see https://github.com/kbknapp/clap-rs.git
+
+Files: vendor/cloudabi/*
+Copyright: 2016-2018 Nuxi (https://nuxi.nl/) and contributors
+License: BSD-2-Clause
+Comment: see https://github.com/nuxinl/cloudabi
+
+Files: vendor/crc32fast/*
+Copyright: 2018-2019 Sam Rijs <srijs@airpost.net>
+           2018-2019 Alex Crichton <alex@alexcrichton.com>
+License: MIT OR Apache-2.0
+Comment: see https://github.com/srijs/rust-crc32fast
+
+Files:
+ vendor/crossbeam-deque/*
+ vendor/crossbeam-epoch/*
+ vendor/crossbeam-queue/*
+ vendor/crossbeam-utils/*
+ vendor/crossbeam-utils-0.6.5/*
+Copyright: 2015-2020 The Crossbeam Project Developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/crossbeam-rs
+
+Files: vendor/codespan/*
+Copyright: 2018-2020 Brendan Zabarauskas <bjzaba@yahoo.com.au>
+License: Apache-2.0
+Comment: see https://github.com/brendanzab/codespan
+
+Files: vendor/codespan-reporting/*
+Copyright: 2018-2020 Brendan Zabarauskas <bjzaba@yahoo.com.au>
+License: Apache-2.0
+Comment: see https://github.com/brendanzab/codespan
+
+Files:
+ vendor/darling/*
+ vendor/darling_core/*
+ vendor/darling_macro/*
+Copyright: 2017-2019 Ted Driggs <ted.driggs@outlook.com>
+License: MIT
+
+Files: vendor/datafrog/*
+Copyright:
+ 2018 Frank McSherry <fmcsherry@me.com>
+ 2018 The Rust Project Developers
+ 2018 Datafrog Developers
+License: Apache-2.0 or MIT
+Comment: see https://github.com/rust-lang-nursery/datafrog
+
+Files: vendor/diff/*
+Copyright: 2015-2017 Utkarsh Kukreti <utkarshkukreti@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/utkarshkukreti/diff.rs
+
+Files:
+ vendor/itoa/*
+ vendor/quote/*
+ vendor/quote-0*/*
+ vendor/syn/*
+ vendor/syn-0*/*
+Copyright: 2016-2018 David Tolnay <dtolnay@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/dtolnay/itoa
+ see https://github.com/dtolnay/quote
+ see https://github.com/dtolnay/syn
+ see https://github.com/dtolnay/synom
+
+Files:
+ vendor/arrayvec/*
+ vendor/either/*
+ vendor/fixedbitset/*
+ vendor/itertools/*
+ vendor/itertools-0.7.8/*
+ vendor/maplit/*
+ vendor/nodrop/*
+ vendor/ordermap/*
+ vendor/scopeguard/*
+Copyright: 2014-2020 bluss
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/bluss/rust-itertools
+ see https://github.com/bluss/either
+ see https://github.com/bluss/arrayvec
+ see https://github.com/bluss/fixedbitset
+ see https://github.com/bluss/maplit
+ see https://github.com/bluss/ordermap
+ see https://github.com/bluss/scopeguard
+
+Files: vendor/difference/*
+Copyright: 2015-2018 Johann Hofmann <mail@johann-hofmann.com>
+License: MIT
+Comment: see https://github.com/johannhof/difference.rs
+
+Files: vendor/elasticlunr-rs/*
+Copyright: 2017-2018 Matt Ickstadt <mattico8@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/mattico/elasticlunr-rs
+
+Files: vendor/ena/*
+Copyright: 2015-2018 Niko Matsakis <niko@alum.mit.edu>
+License: MIT or Apache-2.0
+Comment: see https://github.com/nikomatsakis/ena
+
+Files:
+ vendor/error-chain/*
+Copyright: 2016-2017 Brian Anderson <banderson@mozilla.com>
+           2016-2017 Paul Colomiets <paul@colomiets.name>
+           2016-2017 Colin Kiegel <kiegel@gmx.de>
+           2016-2017 Yamakaky <yamakaky@yamaworld.fr>
+License: MIT or Apache-2.0
+Comment: see https://github.com/brson/error-chain
+
+Files:
+ vendor/failure/*
+ vendor/failure_derive/*
+Copyright: 2017-2018 Without Boats <boats@mozilla.com>
+License: MIT OR Apache-2.0
+Comment:
+ see https://github.com/withoutboats/failure
+ see https://github.com/withoutboats/failure_derive
+
+Files: vendor/fortanix-sgx-abi/*
+Copyright: 2015-2019 Jethro Beekman <jethro@fortanix.com>
+License: MPL-2.0
+Comment: see https://github.com/fortanix/rust-sgx
+
+Files: vendor/fs_extra/*
+Copyright: 2017-2018 Denis Kurilenko <webdesus@gmail.com>
+License: MIT
+Comment: see https://github.com/webdesus/fs_extra
+
+Files:
+ vendor/fuchsia-zircon/*
+ vendor/fuchsia-zircon-sys/*
+Copyright: 2014-2018 Raph Levien <raph@google.com>
+License: BSD-3-Clause
+Comment: see https://fuchsia.googlesource.com/garnet/
+
+Files: vendor/futf/*
+Copyright: 2015-2018 Keegan McAllister <kmcallister@mozilla.com>
+License: MIT  or  Apache-2.0
+Comment: see https://github.com/servo/futf
+
+Files: vendor/generic-array/*
+Copyright: 2015-2019 Bartłomiej Kamiński <fizyk20@gmail.com>
+License: MIT
+Comment: see https://github.com/fizyk20/generic-array.git
+
+Files: vendor/handlebars/*
+Copyright: 2014-2017 Ning Sun <sunng@about.me>
+License: MIT
+Comment: see https://github.com/sunng87/handlebars-rust
+
+Files: vendor/heck/*
+Copyright: 2017-2018 Without Boats <woboats@gmail.com>
+License: MIT OR Apache-2.0
+Comment: see https://github.com/withoutboats/heck
+
+Files: vendor/hermit-abi/*
+Copyright: 2019-2019 Stefan Lankes
+License: MIT or Apache-2.0
+Comment: see https://github.com/hermitcore/hermit-abi
+
+Files:
+ vendor/html5ever/*
+ vendor/markup5ever/*
+Copyright: 2014-2018 The html5ever Project Developers
+License: MIT  or  Apache-2.0
+Comment: see https://github.com/servo/html5ever
+
+Files: vendor/humantime/*
+Copyright: 2016-2018 Paul Colomiets <paul@colomiets.name>
+License: MIT or Apache-2.0
+Comment: see https://github.com/tailhook/humantime
+
+Files: vendor/ident_case/*
+Copyright: 2017-2019 Ted Driggs <ted.driggs@outlook.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/TedDriggs/ident_case
+
+Files:
+ vendor/idna/*
+ vendor/idna-0.1.5/*
+ vendor/percent-encoding/*
+ vendor/percent-encoding-1*/*
+ vendor/url/*
+Copyright: 2013-2020 The rust-url developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/servo/rust-url/
+
+Files: vendor/indexmap/*
+Copyright: 2016-2019 bluss
+           2016-2019 Josh Stone <cuviper@gmail.com>
+License: Apache-2.0 or MIT
+Comment: see https://github.com/bluss/indexmap
+
+Files: vendor/is-match/*
+       vendor/toml-query/*
+Copyright: 2017-2018 Matthias Beyer <mail@beyermatthias.de>
+License: MPL-2.0
+Comment: see https://github.com/matthiasbeyer/is-match
+         see https://github.com/matthiasbeyer/toml-query
+
+Files: vendor/matches/*
+Copyright: 2014-2017 Simon Sapin <simon.sapin@exyr.org>
+License: MIT
+Comment: see https://github.com/SimonSapin
+
+Files:
+ vendor/lazy_static/*
+ vendor/lazy_static-0*/*
+Copyright: 2014-2018 Marvin Löbel <loebel.marvin@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/rust-lang-nursery/lazy-static.rs
+ see https://github.com/Kimundi/owning-ref-rs
+
+Files: vendor/mdbook/*
+Copyright: 2015-2017 Mathieu David <mathieudavid@mathieudavid.org>
+License: MPL-2.0
+Comment: see https://github.com/azerupi/mdBook
+
+Files: vendor/measureme/*
+Copyright: 2019-2019 Wesley Wiser <wwiser@gmail.com>
+           2019-2019 Michael Woerister <michaelwoerister@posteo>
+License: MIT OR Apache-2.0
+Comment: see https://github.com/rust-lang/measureme
+
+Files: vendor/memmap/*
+Copyright: 2015-2018 Dan Burkert <dan@danburkert.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/danburkert/memmap-rs
+
+Files:
+ vendor/memoffset/*
+ vendor/memoffset-0*/*
+Copyright: 2017-2019 Gilad Naaman <gilad.naaman@gmail.com>
+License: MIT
+Comment: see https://github.com/Gilnaa/memoffset
+
+Files:
+ vendor/macro-utils/*
+ vendor/minifier/*
+Copyright: 2017-2018 Guillaume Gomez <guillaume1.gomez@gmail.com>
+License: MIT
+Comment:
+ see https://github.com/GuillaumeGomez/macro_utils
+ see https://github.com/GuillaumeGomez/minifier-rs
+
+Files: vendor/new_debug_unreachable/*
+Copyright: 2014-2018 Matt Brubeck <mbrubeck@limpet.net>
+           2014-2018 Jonathan Reem <jonathan.reem@gmail.com>
+License: MIT
+Comment: see https://github.com/mbrubeck/rust-debug-unreachable
+
+Files: vendor/num_cpus/*
+Copyright: 2015 Sean McArthur <sean.monstar@gmail.com>
+License: MIT
+Comment: see https://github.com/seanmonstar/num_cpus
+
+Files: vendor/open/*
+Copyright: 2015-2017 Sebastian Thiel <byronimo@gmail.com>
+License: MIT
+Comment: see https://github.com/Byron/open-rs
+
+Files: vendor/once_cell/*
+Copyright: 2018-2019 Aleksey Kladov <aleksey.kladov@gmail.com>
+License: MIT OR Apache-2.0
+Comment: see https://github.com/matklad/once_cell
+
+Files:
+ vendor/pest/*
+ vendor/pest_derive/*
+ vendor/pest_generator/*
+ vendor/pest_meta/*
+Copyright: 2016-2019 Dragoș Tiselice <dragostiselice@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/dragostis/pest
+ see https://github.com/pest-parser/pest
+
+Files: vendor/polonius-engine/*
+Copyright: 2018-2018 The Rust Project Developers
+           2018-2018 Polonius Developers
+License: Apache-2.0 or MIT
+Comment: see https://github.com/rust-lang-nursery/polonius
+
+Files:
+ vendor/pulldown-cmark/*
+ vendor/pulldown-cmark-0*/*
+Copyright: 2015-2017 Raph Levien <raph@google.com>
+License: MIT
+Comment: see https://github.com/google/pulldown-cmark
+
+Files: vendor/punycode/*
+Copyright: 2015-2019 mcarton <cartonmartin+git@gmail.com>
+License: MIT
+Comment: see https://github.com/mcarton/rust-punycode.git
+
+Files: vendor/quick-error/*
+Copyright: 2015-2017 Paul Colomiets <paul@colomiets.name>
+           2015-2017 Colin Kiegel <kiegel@gmx.de>
+License: MIT or Apache-2.0
+Comment: see http://github.com/tailhook/quick-error
+
+Files:
+ vendor/rayon/*
+ vendor/rayon-core/*
+ vendor/rustc-rayon/*
+ vendor/rustc-rayon-core/*
+Copyright: 2014-2018 Niko Matsakis <niko@alum.mit.edu>
+           2014-2018 Josh Stone <cuviper@gmail.com>
+License: Apache-2.0 or MIT
+Comment:
+ see https://github.com/rayon-rs/rayon
+ see https://github.com/Zoxc/rayon/tree/rustc
+
+Files: vendor/redox_syscall/*
+       vendor/redox_termios/*
+Copyright: 2016-2017 Jeremy Soller <jackpot51@gmail.com>
+License: MIT
+Comment: see https://github.com/redox-os/syscall
+         see https://github.com/redox-os/termios
+
+Files: vendor/remove_dir_all/*
+Copyright: 2017-2018 Aaronepower <theaaronepower@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/Aaronepower/remove_dir_all.git
+
+Files: vendor/rls-data/*
+       vendor/rls-span/*
+Copyright: 2016-2017 Nick Cameron <ncameron@mozilla.com>
+License: Apache-2.0 or MIT
+Comment: see https://github.com/nrc/rls-span
+         see https://github.com/nrc/rls-data
+
+Files: vendor/rustc_version/*
+Copyright: 2015-2018 Marvin Löbel <loebel.marvin@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/Kimundi/rustc-version-rs
+
+Files: vendor/rustfix/*
+Copyright: 2016-2018 Pascal Hertleif <killercup@gmail.com>
+           2016-2018 Oliver Schneider <oli-obk@users.noreply.github.com>
+License: Apache-2.0 or MIT
+Comment: see https://github.com/killercup/rustfix
+
+Files: vendor/ryu/*
+Copyright: 2018-2018 David Tolnay <dtolnay@gmail.com>
+License: Apache-2.0 or BSL-1.0
+Comment: see https://github.com/dtolnay/ryu
+
+Files:
+ vendor/semver/*
+ vendor/semver-parser/*
+Copyright:
+ 2014-2018 Steve Klabnik <steve@steveklabnik.com>
+ 2014-2018 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/steveklabnik/semver
+
+Files: vendor/serde/*
+       vendor/serde_json/*
+Copyright: 2014-2017 Erick Tryzelaar <erick.tryzelaar@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/serde-rs/serde
+ see https://github.com/serde-rs/json
+
+Files: vendor/serde_derive/*
+Copyright: 2014-2017 Erick Tryzelaar <erick.tryzelaar@gmail.com>
+           2016-2017 David Tolnay <dtolnay@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/serde-rs/serde
+
+Files: vendor/siphasher/*
+Copyright: 2016-2018 Frank Denis <github@pureftpd.org>
+License: MIT or Apache-2.0
+Comment: see https://github.com/jedisct1/rust-siphash
+
+Files: vendor/shlex/*
+Copyright: 2015-2015 comex <comexk@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/comex/rust-shlex
+
+Files:
+ vendor/smallvec-0.6.10/*
+ vendor/smallvec/*
+Copyright: 2015-2020 Simon Sapin <simon.sapin@exyr.org>
+License: MPL-2.0
+Comment: see https://github.com/servo/rust-smallvec
+
+Files: vendor/stable_deref_trait/*
+Copyright: 2017-2017 Robert Grosse <n210241048576@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/storyyeller/stable_deref_trait
+
+Files: vendor/strsim/*
+Copyright: 2015 Danny Guo <dannyguo91@gmail.com>
+License: MIT
+Comment: see https://github.com/dguo/strsim-rs
+
+Files:
+ vendor/strum/*
+ vendor/strum_macros/*
+Copyright: 2015-2018 Peter Glotfelty <peglotfe@microsoft.com>
+License: MIT
+
+Files:
+ vendor/synstructure/*
+ vendor/synstructure-0*/*
+Copyright:
+ 2016-2019 Nika Layzell <nika@thelayzells.com>
+License: MIT
+Comment: see https://github.com/mystor/synstructure
+
+Files: vendor/tempfile/*
+Copyright: 2015-2018 Steven Allen <steven@stebalien.com>
+           2015-2018 The Rust Project Developers
+           2015-2018 Ashley Mannix <ashleymannix@live.com.au>
+           2015-2018 Jason White <jasonaw0@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/Stebalien/tempfile
+
+Files: vendor/tendril/*
+Copyright: 2015-2017 Keegan McAllister <mcallister.keegan@gmail.com>
+           2015-2017 Simon Sapin <simon.sapin@exyr.org>
+           2015-2017 Chris Morgan <me@chrismorgan.info>
+License: MIT or Apache-2.0
+Comment: see https://github.com/servo/tendril
+
+Files: vendor/termion/*
+Copyright: 2016-2017 ticki <Ticki@users.noreply.github.com>
+           2016-2017 gycos <alexandre.bury@gmail.com>
+           2016-2017 IGI-111 <igi-111@protonmail.com>
+License: MIT
+Comment: see https://github.com/ticki/termion
+
+Files: vendor/term_size/*
+Copyright: 2016-2018 Kevin K. <kbknapp@gmail.com>
+           2016-2018 Benjamin Sago <ogham@bsago.me>
+License: MIT or Apache-2.0
+Comment: see https://github.com/kbknapp/term_size-rs.git
+
+Files: vendor/textwrap/*
+Copyright: 2016-2017 Martin Geisler <martin@geisler.net>
+License: MIT
+Comment: see https://github.com/mgeisler/textwrap
+
+Files: vendor/toml-query_derive/*
+Copyright: 2017-2019 Matthias Beyer <mail@beyermatthias.de>
+License: MPL-2.0
+Comment: see https://github.com/matthiasbeyer/toml-query
+
+Files:
+ vendor/hashbrown/*
+ vendor/hashbrown-0*/*
+ vendor/lock_api/*
+ vendor/lock_api-0*/*
+ vendor/thread_local/*
+ vendor/parking_lot/*
+ vendor/parking_lot_core/*
+Copyright: 2016-2019 Amanieu d'Antras <amanieu@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/rust-lang/hashbrown
+ see https://github.com/Amanieu/thread_local-rs
+ see https://github.com/Amanieu/parking_lot
+
+Files: vendor/petgraph/*
+Copyright: 2014-2018 bluss
+           2014-2018 mitchmindtree
+License: MIT or Apache-2.0
+Comment: see https://github.com/bluss/petgraph
+
+Files:
+ vendor/phf/*
+ vendor/phf_codegen/*
+ vendor/phf_generator/*
+ vendor/phf_shared/*
+Copyright: 2014-2018 Steven Fackler <sfackler@gmail.com>
+License: MIT
+Comment: see https://github.com/sfackler/rust-phf
+
+Files: vendor/precomputed-hash/*
+Copyright: 2017-2017 Emilio Cobos Álvarez <emilio@crisal.io>
+License: MIT
+Comment: see https://github.com/emilio/precomputed-hash
+
+Files: vendor/pretty_assertions/*
+Copyright: 2017-2018 Colin Kiegel <kiegel@gmx.de>
+           2017-2018 Florent Fayolle <florent.fayolle69@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/colin-kiegel/rust-pretty-assertions
+
+Files: vendor/typenum/*
+Copyright: 2015-2019 Paho Lurie-Gregg <paho@paholg.com>
+           2015-2019 Andre Bogus <bogusandre@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/paholg/typenum
+
+Files: 
+ vendor/version_check/*
+ vendor/version_check-0.1.5/*
+Copyright: 2017-2019 Sergio Benitez <sb@sergio.bz>
+License: MIT or Apache-2.0
+Comment: see https://github.com/SergioBenitez/version_check
+
+Files:
+ vendor/ucd-trie/*
+ vendor/ucd-util/*
+Copyright: 2017-2018 Andrew Gallant <jamslam@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/BurntSushi/rucd
+
+Files: vendor/unicase/*
+Copyright: 2014-2019 Sean McArthur <sean@seanmonstar.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/seanmonstar/unicase
+
+Files:
+ vendor/unicode-normalization/*
+ vendor/unicode-segmentation/*
+ vendor/unicode-width/*
+Copyright: 2015-2019 kwantam <kwantam@gmail.com>
+License: MIT or Apache-2.0
+Comment:
+ see https://github.com/unicode-rs/unicode-normalization
+ see https://github.com/unicode-rs/unicode-segmentation
+ see https://github.com/unicode-rs/unicode-width
+
+Files:
+ vendor/unicode-xid/*
+ vendor/unicode-xid-0*/*
+Copyright: 2015-2017 erick.tryzelaar <erick.tryzelaar@gmail.com>
+           2015-2017 kwantam <kwantam@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/unicode-rs/unicode-xid
+
+Files: vendor/vcpkg/*
+Copyright: 2017-2019 Jim McGrath <jimmc2@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/mcgoo/vcpkg-rs
+
+Files: vendor/vec_map/*
+Copyright: 2015-2017 Alexis Beingessner <a.beingessner@gmail.com>
+           2015-2017 Andrew Paseltiner <apaseltiner@gmail.com>
+           2015-2017 contain-rs developers
+           2015-2017 The Rust Project Developers
+License: MIT or Apache-2.0
+Comment: see https://github.com/contain-rs/vec-map
+
+Files:
+ vendor/mac/*
+Copyright: 2014-2017 Jonathan Reem <jonathan.reem@gmail.com>
+License: MIT
+Comment:
+ see https://github.com/reem/rust-mac.git
+ see https://github.com/reem/rust-unreachable.git
+ see https://github.com/reem/rust-void.git
+
+Files: vendor/utf-8/*
+Copyright: 2015-2018 Simon Sapin <simon.sapin@exyr.org>
+License: MIT OR Apache-2.0
+Comment: see https://github.com/SimonSapin/rust-utf8
+
+Files:
+ vendor/wasi-0*/*
+ vendor/wasi/*
+Copyright: 2019-2020 The Cranelift Project Developers
+License: Apache-2.0 with LLVM exception or Apache-2.0 or MIT
+Comment: see https://github.com/CraneStation/rust-wasi
+
+Files:
+ vendor/kernel32-sys/*
+ vendor/winapi/*
+ vendor/winapi-0*/*
+ vendor/winapi-build/*
+Copyright:
+ 2014-2019 Peter Atashian <retep998@gmail.com>
+ 2014-2019 winapi-rs developers
+License: MIT
+Comment: see https://github.com/retep998/winapi-rs
+
+Files: vendor/winapi-*-pc-windows-gnu/*
+Copyright: 2014-2018 Peter Atashian <retep998@gmail.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/retep998/winapi-rs
+
+Files: vendor/xattr/*
+Copyright: 2015-2017 Steven Allen <steven@stebalien.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/Stebalien/xattr
+
+Files: vendor/yaml-rust/*
+Copyright: 2015-2017 Yuheng Chen <yuhengchen@sensetime.com>
+License: MIT or Apache-2.0
+Comment: see https://github.com/chyh1990/yaml-rust
+
+Files: debian/*
+Copyright: 2013-2018 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+License: MIT or Apache-2.0
+
+Files: debian/icons/rust-logo-32x32-blk.png
+Copyright: Mozilla Foundation
+License: CC-BY
+Comment:
+ Relevant discussion in https://github.com/rust-lang/rust/issues/11562
+
+License: Apache-2.0
+ On Debian systems, the full text of the Apache License Version 2.0
+ can be found in the file `/usr/share/common-licenses/Apache-2.0'.
+
+License: Apache-2.0 with LLVM exception
+ On Debian systems, the full text of the Apache License Version 2.0
+ can be found in the file `/usr/share/common-licenses/Apache-2.0'.
+ Additionally, the LLVM exception is as follows:
+ .
+ As an exception, if, as a result of your compiling your source code, portions
+ of this Software are embedded into an Object form of such source code, you
+ may redistribute such embedded portions in such Object form without complying
+ with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+ .
+ In addition, if you combine or link compiled forms of this Software with
+ software that is licensed under the GPLv2 ("Combined Software") and if a
+ court of competent jurisdiction determines that the patent provision (Section
+ 3), the indemnity provision (Section 9) or other Section of the License
+ conflicts with the conditions of the GPLv2, you may retroactively and
+ prospectively choose to deem waived or otherwise exclude such Section(s) of
+ the License, but only in their entirety and only with respect to the Combined
+ Software.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with
+ or without modification, are permitted provided that the
+ following conditions are met:
+ .
+ 1. Redistributions of source code must retain the above
+    copyright notice, this list of conditions and the
+    following disclaimer.
+ 2. Redistributions in binary form must reproduce the
+    above copyright notice, this list of conditions and
+    the following disclaimer in the documentation and/or
+    other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: CC0-1.0
+ On Debian systems, the full text of the CC0 1.0 Universal
+ License can be found in the file
+ `/usr/share/common-licenses/CC0-1.0'.
+
+License: MIT
+ Permission is hereby granted, free of charge, to any
+ person obtaining a copy of this software and associated
+ documentation files (the "Software"), to deal in the
+ Software without restriction, including without
+ limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of
+ the Software, and to permit persons to whom the Software
+ is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice
+ shall be included in all copies or substantial portions
+ of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+License: BSL-1.0
+ Permission is hereby granted, free of charge, to any person or organization
+ obtaining a copy of the software and accompanying documentation covered by
+ this license (the "Software") to use, reproduce, display, distribute,
+ execute, and transmit the Software, and to prepare derivative works of the
+ Software, and to permit third-parties to whom the Software is furnished to
+ do so, all subject to the following:
+ .
+ The copyright notices in the Software and this entire statement, including
+ the above license grant, this restriction and the following disclaimer,
+ must be included in all copies of the Software, in whole or in part, and
+ all derivative works of the Software, unless such copies or derivative
+ works are solely in the form of machine-executable object code generated by
+ a source language processor.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the organization nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: Unlicense
+ This is free and unencumbered software released into the public domain.
+ .
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this software, either in source code form or as a compiled
+ binary, for any purpose, commercial or non-commercial, and by any
+ means.
+ .
+ In jurisdictions that recognize copyright laws, the author or authors
+ of this software dedicate any and all copyright interest in the
+ software to the public domain. We make this dedication for the
+ benefit of the public at large and to the detriment of our heirs and
+ successors. We intend this dedication to be an overt act of
+ relinquishment in perpetuity of all present and future rights to this
+ software under copyright law.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ .
+ For more information, please refer to <http://unlicense.org/>
+
+License: SIL-OPEN-FONT
+ This Font Software is licensed under the SIL Open Font License,
+ Version 1.1.
+ .
+ This license is copied below, and is also available with a FAQ at:
+ http://scripts.sil.org/OFL
+ .
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+ .
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
+ worldwide development of collaborative font projects, to support the font
+ creation efforts of academic and linguistic communities, and to provide
+ a free and open framework in which fonts may be shared and improved in
+ partnership with others.
+ .
+ The OFL allows the licensed fonts to be used, studied, modified and
+ redistributed freely as long as they are not sold by themselves.
+ The fonts, including any derivative works, can be bundled, embedded,
+ redistributed and/or sold with any software provided that any reserved
+ names are not used by derivative works.  The fonts and derivatives,
+ however, cannot be released under any other type of license.  The
+ requirement for fonts to remain under this license does not apply to
+ any document created using the fonts or their derivatives.
+ .
+ DEFINITIONS
+ "Font Software" refers to the set of files released by the Copyright
+ Holder(s) under this license and clearly marked as such.
+ This may include source files, build scripts and documentation.
+ .
+ "Reserved Font Name" refers to any names specified as such after the
+ copyright statement(s).
+ .
+ "Original Version" refers to the collection of Font Software components
+ as distributed by the Copyright Holder(s).
+ .
+ "Modified Version" refers to any derivative made by adding to, deleting,
+ or substituting ? in part or in whole ?
+ any of the components of the Original Version, by changing formats or
+ by porting the Font Software to a new environment.
+ .
+ "Author" refers to any designer, engineer, programmer, technical writer
+ or other person who contributed to the Font Software.
+ .
+ PERMISSION & CONDITIONS
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
+ redistribute, and sell modified and unmodified copies of the Font
+ Software, subject to the following conditions:
+ .
+ 1) Neither the Font Software nor any of its individual components,in
+    Original or Modified Versions, may be sold by itself.
+ .
+ 2) Original or Modified Versions of the Font Software may be bundled,
+    redistributed and/or sold with any software, provided that each copy
+    contains the above copyright notice and this license. These can be
+    included either as stand-alone text files, human-readable headers or
+    in the appropriate machine-readable metadata fields within text or
+    binary files as long as those fields can be easily viewed by the user.
+ .
+ 3) No Modified Version of the Font Software may use the Reserved Font
+    Name(s) unless explicit written permission is granted by the
+    corresponding Copyright Holder. This restriction only applies to the
+    primary font name as presented to the users.
+ .
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+    Software shall not be used to promote, endorse or advertise any
+    Modified Version, except to acknowledge the contribution(s) of the
+    Copyright Holder(s) and the Author(s) or with their explicit written
+    permission.
+ 5) The Font Software, modified or unmodified, in part or in whole, must
+    be distributed entirely under this license, and must not be distributed
+    under any other license. The requirement for fonts to remain under
+    this license does not apply to any document created using the Font
+    Software.
+ .
+ TERMINATION
+ This license becomes null and void if any of the above conditions are not met.
+ .
+ DISCLAIMER
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT.  IN NO EVENT SHALL THE
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF THE USE OR INABILITY
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ .
+ On Debian systems, see /usr/share/common-licenses/GPL-2 for the full
+ text of the GPL version 2.
+
+License: CC-BY
+ Attribution 4.0 International
+ .
+ =======================================================================
+ .
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
+ does not provide legal services or legal advice. Distribution of
+ Creative Commons public licenses does not create a lawyer-client or
+ other relationship. Creative Commons makes its licenses and related
+ information available on an "as-is" basis. Creative Commons gives no
+ warranties regarding its licenses, any material licensed under their
+ terms and conditions, or any related information. Creative Commons
+ disclaims all liability for damages resulting from their use to the
+ fullest extent possible.
+ .
+ Using Creative Commons Public Licenses
+ .
+ Creative Commons public licenses provide a standard set of terms and
+ conditions that creators and other rights holders may use to share
+ original works of authorship and other material subject to copyright
+ and certain other rights specified in the public license below. The
+ following considerations are for informational purposes only, are not
+ exhaustive, and do not form part of our licenses.
+ .
+      Considerations for licensors: Our public licenses are
+      intended for use by those authorized to give the public
+      permission to use material in ways otherwise restricted by
+      copyright and certain other rights. Our licenses are
+      irrevocable. Licensors should read and understand the terms
+      and conditions of the license they choose before applying it.
+      Licensors should also secure all rights necessary before
+      applying our licenses so that the public can reuse the
+      material as expected. Licensors should clearly mark any
+      material not subject to the license. This includes other CC-
+      licensed material, or material used under an exception or
+      limitation to copyright. More considerations for licensors:
+      wiki.creativecommons.org/Considerations_for_licensors
+ .
+      Considerations for the public: By using one of our public
+      licenses, a licensor grants the public permission to use the
+      licensed material under specified terms and conditions. If
+      the licensor's permission is not necessary for any reason--for
+      example, because of any applicable exception or limitation to
+      copyright--then that use is not regulated by the license. Our
+      licenses grant only permissions under copyright and certain
+      other rights that a licensor has authority to grant. Use of
+      the licensed material may still be restricted for other
+      reasons, including because others have copyright or other
+      rights in the material. A licensor may make special requests,
+      such as asking that all changes be marked or described.
+      Although not required by our licenses, you are encouraged to
+      respect those requests where reasonable. More_considerations
+      for the public:
+     wiki.creativecommons.org/Considerations_for_licensees
+ .
+ =======================================================================
+ .
+ Creative Commons Attribution 4.0 International Public License
+ .
+ By exercising the Licensed Rights (defined below), You accept and agree
+ to be bound by the terms and conditions of this Creative Commons
+ Attribution 4.0 International Public License ("Public License"). To the
+ extent this Public License may be interpreted as a contract, You are
+ granted the Licensed Rights in consideration of Your acceptance of
+ these terms and conditions, and the Licensor grants You such rights in
+ consideration of benefits the Licensor receives from making the
+ Licensed Material available under these terms and conditions.
+ .
+ .
+ Section 1 -- Definitions.
+ .
+   a. Adapted Material means material subject to Copyright and Similar
+      Rights that is derived from or based upon the Licensed Material
+      and in which the Licensed Material is translated, altered,
+      arranged, transformed, or otherwise modified in a manner requiring
+      permission under the Copyright and Similar Rights held by the
+      Licensor. For purposes of this Public License, where the Licensed
+      Material is a musical work, performance, or sound recording,
+      Adapted Material is always produced where the Licensed Material is
+      synched in timed relation with a moving image.
+ .
+   b. Adapter's License means the license You apply to Your Copyright
+      and Similar Rights in Your contributions to Adapted Material in
+      accordance with the terms and conditions of this Public License.
+ .
+   c. Copyright and Similar Rights means copyright and/or similar rights
+      closely related to copyright including, without limitation,
+      performance, broadcast, sound recording, and Sui Generis Database
+      Rights, without regard to how the rights are labeled or
+      categorized. For purposes of this Public License, the rights
+      specified in Section 2(b)(1)-(2) are not Copyright and Similar
+      Rights.
+ .
+   d. Effective Technological Measures means those measures that, in the
+      absence of proper authority, may not be circumvented under laws
+      fulfilling obligations under Article 11 of the WIPO Copyright
+      Treaty adopted on December 20, 1996, and/or similar international
+      agreements.
+ .
+   e. Exceptions and Limitations means fair use, fair dealing, and/or
+      any other exception or limitation to Copyright and Similar Rights
+      that applies to Your use of the Licensed Material.
+ .
+   f. Licensed Material means the artistic or literary work, database,
+      or other material to which the Licensor applied this Public
+      License.
+ .
+   g. Licensed Rights means the rights granted to You subject to the
+      terms and conditions of this Public License, which are limited to
+      all Copyright and Similar Rights that apply to Your use of the
+      Licensed Material and that the Licensor has authority to license.
+ .
+   h. Licensor means the individual(s) or entity(ies) granting rights
+      under this Public License.
+ .
+   i. Share means to provide material to the public by any means or
+      process that requires permission under the Licensed Rights, such
+      as reproduction, public display, public performance, distribution,
+      dissemination, communication, or importation, and to make material
+      available to the public including in ways that members of the
+      public may access the material from a place and at a time
+      individually chosen by them.
+ .
+   j. Sui Generis Database Rights means rights other than copyright
+      resulting from Directive 96/9/EC of the European Parliament and of
+      the Council of 11 March 1996 on the legal protection of databases,
+      as amended and/or succeeded, as well as other essentially
+      equivalent rights anywhere in the world.
+ .
+   k. You means the individual or entity exercising the Licensed Rights
+      under this Public License. Your has a corresponding meaning.
+ .
+ .
+ Section 2 -- Scope.
+ .
+   a. License grant.
+ .
+     1. Subject to the terms and conditions of this Public License,
+        the Licensor hereby grants You a worldwide, royalty-free,
+        non-sublicensable, non-exclusive, irrevocable license to
+        exercise the Licensed Rights in the Licensed Material to:
+ .
+          a. reproduce and Share the Licensed Material, in whole or
+         in part; and
+ .
+          b. produce, reproduce, and Share Adapted Material.
+ .
+     2. Exceptions and Limitations. For the avoidance of doubt, where
+        Exceptions and Limitations apply to Your use, this Public
+        License does not apply, and You do not need to comply with
+        its terms and conditions.
+ .
+     3. Term. The term of this Public License is specified in Section
+        6(a).
+ .
+     4. Media and formats; technical modifications allowed. The
+        Licensor authorizes You to exercise the Licensed Rights in
+        all media and formats whether now known or hereafter created,
+        and to make technical modifications necessary to do so. The
+        Licensor waives and/or agrees not to assert any right or
+        authority to forbid You from making technical modifications
+        necessary to exercise the Licensed Rights, including
+        technical modifications necessary to circumvent Effective
+        Technological Measures. For purposes of this Public License,
+        simply making modifications authorized by this Section 2(a)
+        (4) never produces Adapted Material.
+ .
+     5. Downstream recipients.
+ .
+          a. Offer from the Licensor -- Licensed Material. Every
+         recipient of the Licensed Material automatically
+         receives an offer from the Licensor to exercise the
+         Licensed Rights under the terms and conditions of this
+         Public License.
+ .
+          b. No downstream restrictions. You may not offer or impose
+         any additional or different terms or conditions on, or
+         apply any Effective Technological Measures to, the
+         Licensed Material if doing so restricts exercise of the
+         Licensed Rights by any recipient of the Licensed
+         Material.
+ .
+     6. No endorsement. Nothing in this Public License constitutes or
+        may be construed as permission to assert or imply that You
+        are, or that Your use of the Licensed Material is, connected
+        with, or sponsored, endorsed, or granted official status by,
+        the Licensor or others designated to receive attribution as
+        provided in Section 3(a)(1)(A)(i).
+ .
+   b. Other rights.
+ .
+     1. Moral rights, such as the right of integrity, are not
+        licensed under this Public License, nor are publicity,
+        privacy, and/or other similar personality rights; however, to
+        the extent possible, the Licensor waives and/or agrees not to
+        assert any such rights held by the Licensor to the limited
+        extent necessary to allow You to exercise the Licensed
+        Rights, but not otherwise.
+ .
+     2. Patent and trademark rights are not licensed under this
+        Public License.
+ .
+     3. To the extent possible, the Licensor waives any right to
+        collect royalties from You for the exercise of the Licensed
+        Rights, whether directly or through a collecting society
+        under any voluntary or waivable statutory or compulsory
+        licensing scheme. In all other cases the Licensor expressly
+        reserves any right to collect such royalties.
+ .
+ .
+ Section 3 -- License Conditions.
+ .
+ Your exercise of the Licensed Rights is expressly made subject to the
+ following conditions.
+ .
+   a. Attribution.
+ .
+     1. If You Share the Licensed Material (including in modified
+        form), You must:
+ .
+          a. retain the following if it is supplied by the Licensor
+         with the Licensed Material:
+ .
+           i. identification of the creator(s) of the Licensed
+              Material and any others designated to receive
+              attribution, in any reasonable manner requested by
+              the Licensor (including by pseudonym if
+              designated);
+ .
+          ii. a copyright notice;
+ .
+         iii. a notice that refers to this Public License;
+ .
+          iv. a notice that refers to the disclaimer of
+              warranties;
+ .
+           v. a URI or hyperlink to the Licensed Material to the
+              extent reasonably practicable;
+ .
+          b. indicate if You modified the Licensed Material and
+         retain an indication of any previous modifications; and
+ .
+          c. indicate the Licensed Material is licensed under this
+         Public License, and include the text of, or the URI or
+         hyperlink to, this Public License.
+ .
+     2. You may satisfy the conditions in Section 3(a)(1) in any
+        reasonable manner based on the medium, means, and context in
+        which You Share the Licensed Material. For example, it may be
+        reasonable to satisfy the conditions by providing a URI or
+        hyperlink to a resource that includes the required
+        information.
+ .
+     3. If requested by the Licensor, You must remove any of the
+        information required by Section 3(a)(1)(A) to the extent
+        reasonably practicable.
+ .
+     4. If You Share Adapted Material You produce, the Adapter's
+        License You apply must not prevent recipients of the Adapted
+        Material from complying with this Public License.
+ .
+ .
+ Section 4 -- Sui Generis Database Rights.
+ .
+ Where the Licensed Rights include Sui Generis Database Rights that
+ apply to Your use of the Licensed Material:
+ .
+   a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+      to extract, reuse, reproduce, and Share all or a substantial
+      portion of the contents of the database;
+ .
+   b. if You include all or a substantial portion of the database
+      contents in a database in which You have Sui Generis Database
+      Rights, then the database in which You have Sui Generis Database
+      Rights (but not its individual contents) is Adapted Material; and
+ .
+   c. You must comply with the conditions in Section 3(a) if You Share
+      all or a substantial portion of the contents of the database.
+ .
+ For the avoidance of doubt, this Section 4 supplements and does not
+ replace Your obligations under this Public License where the Licensed
+ Rights include other Copyright and Similar Rights.
+ .
+ .
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+ .
+   a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+      EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+      AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+      ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+      IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+      WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+      PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+      ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+      KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+      ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+ .
+   b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+      TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+      NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+      INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+      COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+      USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+      ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+      DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+      IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+ .
+   c. The disclaimer of warranties and limitation of liability provided
+      above shall be interpreted in a manner that, to the extent
+      possible, most closely approximates an absolute disclaimer and
+      waiver of all liability.
+ .
+ .
+ Section 6 -- Term and Termination.
+ .
+   a. This Public License applies for the term of the Copyright and
+      Similar Rights licensed here. However, if You fail to comply with
+      this Public License, then Your rights under this Public License
+      terminate automatically.
+ .
+   b. Where Your right to use the Licensed Material has terminated under
+      Section 6(a), it reinstates:
+ .
+     1. automatically as of the date the violation is cured, provided
+        it is cured within 30 days of Your discovery of the
+        violation; or
+ .
+     2. upon express reinstatement by the Licensor.
+ .
+      For the avoidance of doubt, this Section 6(b) does not affect any
+      right the Licensor may have to seek remedies for Your violations
+      of this Public License.
+ .
+   c. For the avoidance of doubt, the Licensor may also offer the
+      Licensed Material under separate terms or conditions or stop
+      distributing the Licensed Material at any time; however, doing so
+      will not terminate this Public License.
+ .
+   d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+      License.
+ .
+ .
+ Section 7 -- Other Terms and Conditions.
+ .
+   a. The Licensor shall not be bound by any additional or different
+      terms or conditions communicated by You unless expressly agreed.
+ .
+   b. Any arrangements, understandings, or agreements regarding the
+      Licensed Material not stated herein are separate from and
+      independent of the terms and conditions of this Public License.
+ .
+ .
+ Section 8 -- Interpretation.
+ .
+   a. For the avoidance of doubt, this Public License does not, and
+      shall not be interpreted to, reduce, limit, restrict, or impose
+      conditions on any use of the Licensed Material that could lawfully
+      be made without permission under this Public License.
+ .
+   b. To the extent possible, if any provision of this Public License is
+      deemed unenforceable, it shall be automatically reformed to the
+      minimum extent necessary to make it enforceable. If the provision
+      cannot be reformed, it shall be severed from this Public License
+      without affecting the enforceability of the remaining terms and
+      conditions.
+ .
+   c. No term or condition of this Public License will be waived and no
+      failure to comply consented to unless expressly agreed to by the
+      Licensor.
+ .
+   d. Nothing in this Public License constitutes or may be interpreted
+      as a limitation upon, or waiver of, any privileges and immunities
+      that apply to the Licensor or You, including from the legal
+      processes of any jurisdiction or authority.
+ .
+ .
+ =======================================================================
+ .
+ Creative Commons is not a party to its public licenses.
+ Notwithstanding, Creative Commons may elect to apply one of its public
+ licenses to material it publishes and in those instances will be
+ considered the "Licensor." Except for the limited purpose of indicating
+ that material is shared under a Creative Commons public license or as
+ otherwise permitted by the Creative Commons policies published at
+ creativecommons.org/policies, Creative Commons does not authorize the
+ use of the trademark "Creative Commons" or any other trademark or logo
+ of Creative Commons without its prior written consent including,
+ without limitation, in connection with any unauthorized modifications
+ to any of its public licenses or any other arrangements,
+ understandings, or agreements concerning use of licensed material. For
+ the avoidance of doubt, this paragraph does not form part of the public
+ licenses.
+ .
+ Creative Commons may be contacted at creativecommons.org.
+
+License: MPL-2.0
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ .
+ On Debian systems, see /usr/share/common-licenses/MPL-2.0 for the full
+ text of the MPL version 2.0.
diff --git a/docs b/docs
new file mode 100644 (file)
index 0000000..b43bf86
--- /dev/null
+++ b/docs
@@ -0,0 +1 @@
+README.md
diff --git a/ensure-patch b/ensure-patch
new file mode 100755 (executable)
index 0000000..b8562f2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+"-N") fwd=-N; rev=-R; verb="applied";;
+"-R") fwd=-R; rev=-N; verb="reversed";;
+*) echo >&2 "Usage: $0 <-N|-R> <patch-file>"; exit 2;;
+esac
+
+if patch --dry-run -F0 -f $rev -p1 < "$2" >/dev/null; then
+       echo >&2 "patch already $verb: $2"
+       exit 0
+fi
+patch --dry-run -F0 -f $fwd -p1 < "$2"
+patch -F0 -f $fwd -p1 < "$2"
diff --git a/gbp.conf b/gbp.conf
new file mode 100644 (file)
index 0000000..d568e69
--- /dev/null
+++ b/gbp.conf
@@ -0,0 +1,7 @@
+[DEFAULT]
+pristine-tar = True
+ignore-branch = True
+
+[import-orig]
+upstream-branch = upstream/experimental
+debian-branch = debian/experimental
diff --git a/get-stage0.py b/get-stage0.py
new file mode 100755 (executable)
index 0000000..1f55c53
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/python3
+# Sometimes this might fail due to upstream changes.
+# In that case, you probably just need to override the failing step in our
+# DownloadOnlyRustBuild class below.
+
+import sys
+
+import bootstrap
+from bootstrap import RustBuild
+
+class DownloadOnlyRustBuild(RustBuild):
+    triple = None
+    def build_bootstrap(self):
+        pass
+    def run(self, *args):
+        pass
+    def build_triple(self):
+        return self.triple
+    def update_submodules(self):
+        pass
+    def bootstrap_binary(self):
+        return "true"
+
+def main(argv):
+    triple = argv.pop(1)
+    DownloadOnlyRustBuild.triple = triple
+    bootstrap.RustBuild = DownloadOnlyRustBuild
+    bootstrap.bootstrap(False)
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/icons/rust-logo-32x32-blk.png b/icons/rust-logo-32x32-blk.png
new file mode 100644 (file)
index 0000000..9cc1452
Binary files /dev/null and b/icons/rust-logo-32x32-blk.png differ
diff --git a/libstd-rust-1.41.lintian-overrides b/libstd-rust-1.41.lintian-overrides
new file mode 100644 (file)
index 0000000..f4e4913
--- /dev/null
@@ -0,0 +1,13 @@
+# "libstd" just seemed too generic
+libstd-rust-1.41 binary: package-name-doesnt-match-sonames
+libstd-rust-1.41 binary: sharedobject-in-library-directory-missing-soname
+
+# Rust doesn't use dev shlib symlinks nor any of the other shlib support stuff
+libstd-rust-1.41 binary: dev-pkg-without-shlib-symlink
+libstd-rust-1.41 binary: shlib-without-versioned-soname
+libstd-rust-1.41 binary: unused-shlib-entry-in-control-file
+
+# Libraries that use libc symbols (libterm, libstd, etc) *are* linked
+# to libc.  Lintian gets upset that some Rust libraries don't need
+# libc, boo hoo.
+libstd-rust-1.41 binary: library-not-linked-against-libc
diff --git a/libstd-rust-dev-wasm32-cross.lintian-overrides b/libstd-rust-dev-wasm32-cross.lintian-overrides
new file mode 100644 (file)
index 0000000..3a770a2
--- /dev/null
@@ -0,0 +1,3 @@
+# wasm object files count as arch-independent for now,
+# at least until we starting offering Debian in wasm
+libstd-rust-dev-wasm32-cross binary: arch-independent-package-contains-binary-or-object usr/lib/rustlib/wasm32-*/lib/lib*.rlib
diff --git a/libstd-rust-dev.lintian-overrides b/libstd-rust-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..2e7ca28
--- /dev/null
@@ -0,0 +1,8 @@
+# I assure you, dear lintian, that "/usr/lib/rustlib/x86_64-unknown-linux-gnu/"
+# is indeed an arch-specific directory.
+libstd-rust-dev binary: arch-dependent-file-not-in-arch-specific-directory
+
+# See debhelper bug #875780. This override is commented out because it's not
+# always needed, but we want it here for documentation purposes. Basically,
+# if you see it then you probably don't need to worry about it.
+#libstd-rust-dev binary: unstripped-static-library usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/lib*.rlib(*)
diff --git a/lintian-to-copyright.sh b/lintian-to-copyright.sh
new file mode 100755 (executable)
index 0000000..9a766da
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Pipe the output of lintian into this.
+sed -ne 's/.* file-without-copyright-information //p' | cut -d/ -f1-2 | sort -u | while read x; do
+       /usr/share/cargo/scripts/guess-crate-copyright "$x"
+done
diff --git a/llvm-upstream-patch.sh b/llvm-upstream-patch.sh
new file mode 100755 (executable)
index 0000000..fc87971
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Run this on https://github.com/llvm-mirror/llvm
+# Or another repo where the above is the "upstream" remote
+set -e
+head=$(git rev-parse --verify -q remotes/upstream/master || git rev-parse --verify -q remotes/origin/master)
+test -n "$head"
+for i in "$@"; do
+       git show $(git rev-list "$head" -n1 --grep='git-svn-id: .*@'"$i") > rL"$i".patch
+done
diff --git a/make_orig-stage0_tarball.sh b/make_orig-stage0_tarball.sh
new file mode 100755 (executable)
index 0000000..994a232
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+# See README.Debian "Bootstrapping" for details.
+#
+# You may want to use `debian/rules source_orig-stage0` instead of calling this
+# directly.
+
+set -e
+
+upstream_version="$(dpkg-parsechangelog -SVersion | sed -e 's/\(.*\)-.*/\1/g')"
+upstream_bootstrap_arch="${upstream_bootstrap_arch:-amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x}"
+
+rm -f stage0/*/*.sha256
+mkdir -p stage0 build && ln -sf ../stage0 build/cache
+if [ -n "$(find stage0/ -type f)" ]; then
+       echo >&2 "$0: NOTE: extra artifacts in stage0/ will be included:"
+       find stage0/ -type f
+fi
+for deb_host_arch in $upstream_bootstrap_arch; do
+       make -s --no-print-directory -f debian/architecture-test.mk "rust-for-deb_${deb_host_arch}" | {
+       read deb_host_arch rust_triplet
+       PYTHONPATH=src/bootstrap debian/get-stage0.py "${rust_triplet}"
+       rm -rf "${rust_triplet}"
+       }
+done
+
+echo >&2 "building stage0 tar file now, this will take a while..."
+stamp=@${SOURCE_DATE_EPOCH:-$(date +%s)}
+touch --date="$stamp" stage0/dpkg-source-dont-rename-parent-directory
+tar --mtime="$stamp" --clamp-mtime \
+  --owner=root --group=root \
+  -cJf "../rustc_${upstream_version}.orig-stage0.tar.xz" \
+  --transform "s/^stage0\///" \
+  stage0/*
+
+rm -f src/bootstrap/bootstrap.pyc
+
+cat <<eof
+================================================================================
+orig-stage0 bootstrapping tarball created in ../rustc_${upstream_version}.orig-stage0.tar.xz
+containing the upstream compilers for $upstream_bootstrap_arch
+
+You *probably* now want to do the following steps:
+
+1. Add [$(echo $upstream_bootstrap_arch | sed -e 's/\S*/!\0/g')] to the rustc/cargo Build-Depends in d/control
+2. Update d/changelog
+3. Run \`dpkg-source -b .\` to generate a .dsc that includes this tarball.
+================================================================================
+eof
diff --git a/patches/0001-Fix-compiletest-fallout-from-stage0-bump.patch b/patches/0001-Fix-compiletest-fallout-from-stage0-bump.patch
new file mode 100644 (file)
index 0000000..dfffce9
--- /dev/null
@@ -0,0 +1,24 @@
+From 241d2e765dc7401e642812e43b75dbc3950f2c98 Mon Sep 17 00:00:00 2001
+From: Mark Rousskov <mark.simulacrum@gmail.com>
+Date: Wed, 18 Dec 2019 13:28:14 -0500
+Subject: [PATCH] Fix compiletest fallout from stage0 bump
+
+---
+ src/tools/compiletest/src/main.rs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
+index 15f8abd75d59..32965bbb292d 100644
+--- a/src/tools/compiletest/src/main.rs
++++ b/src/tools/compiletest/src/main.rs
+@@ -569,6 +569,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
+         list: false,
+         options: test::Options::new(),
+         time_options: None,
++        force_run_in_process: false,
+     }
+ }
+-- 
+2.24.1
+
diff --git a/patches/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch b/patches/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch
new file mode 100644 (file)
index 0000000..82d928d
--- /dev/null
@@ -0,0 +1,52 @@
+From b6fd4598c5367e78b5841fd99412484f0e86fc21 Mon Sep 17 00:00:00 2001
+From: Amanieu d'Antras <amanieu@gmail.com>
+Date: Wed, 1 Jan 2020 17:11:45 +0100
+Subject: [PATCH] Update the barrier cache during ARM EHABI unwinding
+
+---
+ src/libpanic_unwind/gcc.rs | 8 +++++++-
+ src/libunwind/libunwind.rs | 2 ++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs
+index 4f572fe21b30..328d0d4ce7be 100644
+--- a/src/libpanic_unwind/gcc.rs
++++ b/src/libpanic_unwind/gcc.rs
+@@ -187,7 +187,13 @@ cfg_if::cfg_if! {
+                 match eh_action {
+                     EHAction::None |
+                     EHAction::Cleanup(_) => return continue_unwind(exception_object, context),
+-                    EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND,
++                    EHAction::Catch(_) => {
++                        // EHABI requires the personality routine to update the
++                        // SP value in the barrier cache of the exception object.
++                        (*exception_object).private[5] =
++                            uw::_Unwind_GetGR(context, uw::UNWIND_SP_REG);
++                        return uw::_URC_HANDLER_FOUND;
++                    }
+                     EHAction::Terminate => return uw::_URC_FAILURE,
+                 }
+             } else {
+diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs
+index 0b39503c0d03..30658ce328d8 100644
+--- a/src/libunwind/libunwind.rs
++++ b/src/libunwind/libunwind.rs
+@@ -23,6 +23,7 @@ pub type _Unwind_Word = uintptr_t;
+ pub type _Unwind_Ptr = uintptr_t;
+ pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut c_void)
+                                           -> _Unwind_Reason_Code;
++
+ #[cfg(target_arch = "x86")]
+ pub const unwinder_private_data_size: usize = 5;
+@@ -151,6 +152,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
+     use _Unwind_VRS_DataRepresentation::*;
+     pub const UNWIND_POINTER_REG: c_int = 12;
++    pub const UNWIND_SP_REG: c_int = 13;
+     pub const UNWIND_IP_REG: c_int = 15;
+     #[cfg_attr(all(feature = "llvm-libunwind",
+-- 
+2.24.1
+
diff --git a/patches/d-0000-ignore-removed-submodules.patch b/patches/d-0000-ignore-removed-submodules.patch
new file mode 100644 (file)
index 0000000..dcb1f5f
--- /dev/null
@@ -0,0 +1,199 @@
+Description: Ignore submodules that we're not building, or that are unused like
+ mdbook-linkcheck that pull in a ton of dependencies that are unneeded.
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: not-needed
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -6,7 +6,6 @@
+   "src/libtest",
+   "src/librustc_codegen_llvm",
+   "src/tools/cargotest",
+-  "src/tools/clippy",
+   "src/tools/compiletest",
+   "src/tools/error_index_generator",
+   "src/tools/linkchecker",
+@@ -14,14 +13,8 @@
+   "src/tools/unstable-book-gen",
+   "src/tools/tidy",
+   "src/tools/build-manifest",
+-  "src/tools/remote-test-client",
+-  "src/tools/remote-test-server",
+   "src/tools/rust-installer",
+-  "src/tools/cargo",
+   "src/tools/rustdoc",
+-  "src/tools/rls",
+-  "src/tools/rustfmt",
+-  "src/tools/miri",
+   "src/tools/rustdoc-themes",
+ ]
+ exclude = [
+@@ -46,29 +39,10 @@
+ debug = false
+ debug-assertions = false
+-# We want the RLS to use the version of Cargo that we've got vendored in this
+-# repository to ensure that the same exact version of Cargo is used by both the
+-# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository
+-# so we use a `[patch]` here to override the github repository with our local
+-# vendored copy.
+-[patch."https://github.com/rust-lang/cargo"]
+-cargo = { path = "src/tools/cargo" }
+-
+ [patch.crates-io]
+-# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
+-# that we're shipping as well (to ensure that the rustfmt in RLS and the
+-# `rustfmt` executable are the same exact version).
+-rustfmt-nightly = { path = "src/tools/rustfmt" }
+-
+-# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
+-# here
+-rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
+ # See comments in `tools/rustc-std-workspace-core/README.md` for what's going on
+ # here
+ rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
+ rustc-std-workspace-alloc = { path = 'src/tools/rustc-std-workspace-alloc' }
+ rustc-std-workspace-std = { path = 'src/tools/rustc-std-workspace-std' }
+-
+-[patch."https://github.com/rust-lang/rust-clippy"]
+-clippy_lints = { path = "src/tools/clippy/clippy_lints" }
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -656,10 +656,6 @@
+                 os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
+         for _ in range(1, self.verbose):
+             args.append("--verbose")
+-        if self.use_locked_deps:
+-            args.append("--locked")
+-        if self.use_vendored_sources:
+-            args.append("--frozen")
+         run(args, env=env, verbose=self.verbose)
+     def build_triple(self):
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -454,8 +454,6 @@
+                 dist::Miri,
+                 dist::LlvmTools,
+                 dist::Lldb,
+-                dist::Extended,
+-                dist::HashSign
+             ),
+             Kind::Install => describe!(
+                 install::Docs,
+@@ -1235,10 +1233,7 @@
+             }
+         }
+-        if self.config.locked_deps {
+-            cargo.arg("--locked");
+-        }
+-        if self.config.vendor || self.is_sudo {
++        if self.is_sudo {
+             cargo.arg("--frozen");
+         }
+--- a/src/bootstrap/doc.rs
++++ b/src/bootstrap/doc.rs
+@@ -113,7 +113,7 @@
+ impl Step for CargoBook {
+     type Output = ();
+-    const DEFAULT: bool = true;
++    const DEFAULT: bool = false;
+     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+         let builder = run.builder;
+--- a/src/doc/index.md
++++ b/src/doc/index.md
+@@ -87,7 +87,7 @@
+ ## The Cargo Book
+-[The Cargo Book](cargo/index.html) is a guide to Cargo, Rust's build tool and dependency manager.
++[The Cargo Book](../../cargo-doc/doc/index.html) is a guide to Cargo, Rust's build tool and dependency manager.
+ ## The Rustdoc Book
+--- a/src/bootstrap/test.rs
++++ b/src/bootstrap/test.rs
+@@ -1585,14 +1585,14 @@
+     }
+     fn run(self, builder: &Builder<'_>) {
+-        let src = builder.src.join("src/doc/rustc-guide");
+-        let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
+-        let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) {
+-            ToolState::TestPass
+-        } else {
+-            ToolState::TestFail
+-        };
+-        builder.save_toolstate("rustc-guide", toolstate);
++        //let src = builder.src.join("src/doc/rustc-guide");
++        //let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
++        //let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) {
++        //    ToolState::TestPass
++        //} else {
++        //    ToolState::TestFail
++        //};
++        builder.save_toolstate("rustc-guide", ToolState::TestPass);
+     }
+ }
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -277,14 +277,14 @@
+ }
+ fn rustbook_features() -> Vec<String> {
+-    let mut features = Vec::new();
++    let features = Vec::new();
+     // Due to CI budged and risk of spurious failures we want to limit jobs running this check.
+     // At same time local builds should run it regardless of the platform.
+     // `CiEnv::None` means it's local build and `CHECK_LINKS` is defined in x86_64-gnu-tools to
+     // explicitly enable it on single job
+     if CiEnv::current() == CiEnv::None || env::var("CHECK_LINKS").is_ok() {
+-        features.push("linkcheck".to_string());
++    //    features.push("linkcheck".to_string());
+     }
+     features
+--- a/src/tools/rustbook/Cargo.toml
++++ b/src/tools/rustbook/Cargo.toml
+@@ -6,21 +6,15 @@
+ edition = "2018"
+ [features]
+-linkcheck = ["mdbook-linkcheck", "codespan-reporting"]
++linkcheck = []
+ [dependencies]
+ clap = "2.25.0"
+ failure = "0.1"
+-mdbook-linkcheck = { version = "0.5.0", optional = true }
+ # Keep in sync with mdbook-linkcheck.
+ codespan-reporting = { version = "0.5", optional = true }
+-# A noop dependency that changes in the Rust repository, it's a bit of a hack.
+-# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
+-# for more information.
+-rustc-workspace-hack = "1.0.0"
+-
+ [dependencies.mdbook]
+ version = "0.3.0"
+ default-features = false
+--- a/src/tools/tidy/src/deps.rs
++++ b/src/tools/tidy/src/deps.rs
+@@ -404,8 +404,8 @@
+         // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times
+         // under control.
+-        "cargo",
+-        "rustc-ap-syntax",
++        //"cargo",
++        //"rustc-ap-syntax",
+     ];
+     let mut name_to_id: HashMap<_, Vec<_>> = HashMap::new();
+     for node in resolve.nodes.iter() {
diff --git a/patches/d-0001-disable-miniz.patch b/patches/d-0001-disable-miniz.patch
new file mode 100644 (file)
index 0000000..3627962
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/vendor/flate2/Cargo.toml
++++ b/vendor/flate2/Cargo.toml
+@@ -40,14 +40,6 @@ version = "0.2"
+ version = "1.0"
+ optional = true
+-[dependencies.miniz-sys]
+-version = "0.1.11"
+-optional = true
+-
+-[dependencies.miniz_oxide]
+-version = "0.3.2"
+-optional = true
+-
+ [dependencies.tokio-io]
+ version = "0.1.11"
+ optional = true
+@@ -71,12 +63,10 @@ version = "0.1.3"
+ version = "0.1.10"
+ [features]
+-default = ["rust_backend"]
+-rust_backend = ["miniz_oxide"]
++default = ["zlib"]
++rust_backend = ["zlib"]
+ tokio = ["tokio-io", "futures"]
+ zlib = ["libz-sys"]
+-[target."cfg(all(target_arch = \"wasm32\", not(target_os = \"emscripten\")))".dependencies.miniz_oxide]
+-version = "0.3.2"
+ [badges.appveyor]
+ repository = "alexcrichton/flate2-rs"
diff --git a/patches/d-0002-pkg-config-no-special-snowflake.patch b/patches/d-0002-pkg-config-no-special-snowflake.patch
new file mode 100644 (file)
index 0000000..1560f69
--- /dev/null
@@ -0,0 +1,98 @@
+--- a/vendor/pkg-config/src/lib.rs
++++ b/vendor/pkg-config/src/lib.rs
+@@ -9,8 +9,6 @@
+ //! A number of environment variables are available to globally configure how
+ //! this crate will invoke `pkg-config`:
+ //!
+-//! * `PKG_CONFIG_ALLOW_CROSS` - if this variable is not set, then `pkg-config`
+-//!   will automatically be disabled for all cross compiles.
+ //! * `FOO_NO_PKG_CONFIG` - if set, this will disable running `pkg-config` when
+ //!   probing for the library named `foo`.
+ //!
+@@ -81,7 +79,7 @@
+     // Only use pkg-config in host == target situations by default (allowing an
+     // override).
+-    (host == target || env::var_os("PKG_CONFIG_ALLOW_CROSS").is_some())
++    (host == target || true)
+ }
+ #[derive(Clone, Default)]
+@@ -113,9 +111,8 @@
+     /// Contains the name of the responsible environment variable.
+     EnvNoPkgConfig(String),
+-    /// Cross compilation detected.
+-    ///
+-    /// Override with `PKG_CONFIG_ALLOW_CROSS=1`.
++    /// Cross compilation detected. Kept for compatibility;
++    /// the Debian package never emits this.
+     CrossCompilation,
+     /// Failed to run `pkg-config`.
+@@ -137,13 +134,9 @@
+     fn description(&self) -> &str {
+         match *self {
+             Error::EnvNoPkgConfig(_) => "pkg-config requested to be aborted",
+-            Error::CrossCompilation => {
+-                "pkg-config doesn't handle cross compilation. \
+-                 Use PKG_CONFIG_ALLOW_CROSS=1 to override"
+-            }
+             Error::Command { .. } => "failed to run pkg-config",
+             Error::Failure { .. } => "pkg-config did not exit sucessfully",
+-            Error::__Nonexhaustive => panic!(),
++            Error::CrossCompilation | Error::__Nonexhaustive => panic!(),
+         }
+     }
+@@ -214,10 +207,6 @@
+             Error::EnvNoPkgConfig(ref name) => {
+                 write!(f, "Aborted because {} is set", name)
+             }
+-            Error::CrossCompilation => {
+-                write!(f, "Cross compilation detected. \
+-                       Use PKG_CONFIG_ALLOW_CROSS=1 to override")
+-            }
+             Error::Command { ref command, ref cause } => {
+                 write!(f, "Failed to run `{}`: {}", command, cause)
+             }
+@@ -233,7 +222,7 @@
+                 }
+                 Ok(())
+             }
+-            Error::__Nonexhaustive => panic!(),
++            Error::CrossCompilation | Error::__Nonexhaustive => panic!(),
+         }
+     }
+ }
+@@ -388,7 +377,11 @@
+     }
+     fn command(&self, name: &str, args: &[&str]) -> Command {
+-        let exe = self.env_var("PKG_CONFIG").unwrap_or_else(|_| String::from("pkg-config"));
++        let exe = self.env_var("PKG_CONFIG").unwrap_or_else(|_| {
++            self.env_var("DEB_HOST_GNU_TYPE")
++                .map(|t| t.to_string() + "-pkg-config")
++                .unwrap_or_else(|_| String::from("pkg-config"))
++        });
+         let mut cmd = Command::new(exe);
+         if self.is_static(name) {
+             cmd.arg("--static");
+--- a/vendor/pkg-config/tests/test.rs
++++ b/vendor/pkg-config/tests/test.rs
+@@ -29,7 +29,6 @@
+     pkg_config::probe_library(name)
+ }
+-#[test]
+ fn cross_disabled() {
+     let _g = LOCK.lock();
+     reset();
+@@ -41,7 +40,6 @@
+     }
+ }
+-#[test]
+ fn cross_enabled() {
+     let _g = LOCK.lock();
+     reset();
diff --git a/patches/d-0003-mdbook-strip-embedded-libs.patch b/patches/d-0003-mdbook-strip-embedded-libs.patch
new file mode 100644 (file)
index 0000000..dedcaf2
--- /dev/null
@@ -0,0 +1,372 @@
+Description: Use local web resources instead of remote ones
+Author: Matthijs van Otterdijk <matthijs@wirevirt.net>
+Author: Ximin Luo <infinity0@debian.org>
+Bug: https://github.com/azerupi/mdBook/issues/271
+Comment:
+ Use https://github.com/infinity0/mdBook/tree/debian to help you rebase the
+ patch on top of a newer version.
+ .
+ Make sure the paths here match the ones in debian/rust-doc.links
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: rustc-1.37.0-src/src/tools/linkchecker/main.rs
+===================================================================
+--- rustc-1.37.0-src.orig/src/tools/linkchecker/main.rs        2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/src/tools/linkchecker/main.rs     2019-08-22 11:17:30.016767983 -0700
+@@ -173,6 +173,11 @@
+            url.starts_with("irc:") || url.starts_with("data:") {
+             return;
+         }
++        // Ignore parent URLs, so that the package installation process can
++        // provide a symbolic link later
++        if url.starts_with("../") {
++            return;
++        }
+         let mut parts = url.splitn(2, "#");
+         let url = parts.next().unwrap();
+         let fragment = parts.next();
+Index: rustc-1.37.0-src/vendor/mdbook/src/book/init.rs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/book/init.rs       2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/book/init.rs    2019-08-22 11:17:30.016767983 -0700
+@@ -148,12 +148,6 @@
+         let mut js = File::create(themedir.join("book.js"))?;
+         js.write_all(theme::JS)?;
+-        let mut highlight_css = File::create(themedir.join("highlight.css"))?;
+-        highlight_css.write_all(theme::HIGHLIGHT_CSS)?;
+-
+-        let mut highlight_js = File::create(themedir.join("highlight.js"))?;
+-        highlight_js.write_all(theme::HIGHLIGHT_JS)?;
+-
+         Ok(())
+     }
+Index: rustc-1.37.0-src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs   2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs        2019-08-22 11:17:30.020768197 -0700
+@@ -3,7 +3,7 @@
+ use crate::errors::*;
+ use crate::renderer::html_handlebars::helpers;
+ use crate::renderer::{RenderContext, Renderer};
+-use crate::theme::{self, playpen_editor, Theme};
++use crate::theme::{self, Theme};
+ use crate::utils;
+ use std::borrow::Cow;
+@@ -110,7 +110,7 @@
+         &self,
+         destination: &Path,
+         theme: &Theme,
+-        html_config: &HtmlConfig,
++        _html_config: &HtmlConfig,
+     ) -> Result<()> {
+         use crate::utils::fs::write_file;
+@@ -126,62 +126,8 @@
+         write_file(destination, "css/print.css", &theme.print_css)?;
+         write_file(destination, "css/variables.css", &theme.variables_css)?;
+         write_file(destination, "favicon.png", &theme.favicon)?;
+-        write_file(destination, "highlight.css", &theme.highlight_css)?;
+         write_file(destination, "tomorrow-night.css", &theme.tomorrow_night_css)?;
+         write_file(destination, "ayu-highlight.css", &theme.ayu_highlight_css)?;
+-        write_file(destination, "highlight.js", &theme.highlight_js)?;
+-        write_file(destination, "clipboard.min.js", &theme.clipboard_js)?;
+-        write_file(
+-            destination,
+-            "FontAwesome/css/font-awesome.css",
+-            theme::FONT_AWESOME,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/fontawesome-webfont.eot",
+-            theme::FONT_AWESOME_EOT,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/fontawesome-webfont.svg",
+-            theme::FONT_AWESOME_SVG,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/fontawesome-webfont.ttf",
+-            theme::FONT_AWESOME_TTF,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/fontawesome-webfont.woff",
+-            theme::FONT_AWESOME_WOFF,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/fontawesome-webfont.woff2",
+-            theme::FONT_AWESOME_WOFF2,
+-        )?;
+-        write_file(
+-            destination,
+-            "FontAwesome/fonts/FontAwesome.ttf",
+-            theme::FONT_AWESOME_TTF,
+-        )?;
+-
+-        let playpen_config = &html_config.playpen;
+-
+-        // Ace is a very large dependency, so only load it when requested
+-        if playpen_config.editable && playpen_config.copy_js {
+-            // Load the editor
+-            write_file(destination, "editor.js", playpen_editor::JS)?;
+-            write_file(destination, "ace.js", playpen_editor::ACE_JS)?;
+-            write_file(destination, "mode-rust.js", playpen_editor::MODE_RUST_JS)?;
+-            write_file(destination, "theme-dawn.js", playpen_editor::THEME_DAWN_JS)?;
+-            write_file(
+-                destination,
+-                "theme-tomorrow_night.js",
+-                playpen_editor::THEME_TOMORROW_NIGHT_JS,
+-            )?;
+-        }
+         Ok(())
+     }
+Index: rustc-1.37.0-src/vendor/mdbook/src/renderer/html_handlebars/search.rs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/renderer/html_handlebars/search.rs 2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/renderer/html_handlebars/search.rs      2019-08-22 11:17:30.020768197 -0700
+@@ -34,8 +34,6 @@
+             format!("Object.assign(window.search, {});", index).as_bytes(),
+         )?;
+         utils::fs::write_file(destination, "searcher.js", searcher::JS)?;
+-        utils::fs::write_file(destination, "mark.min.js", searcher::MARK_JS)?;
+-        utils::fs::write_file(destination, "elasticlunr.min.js", searcher::ELASTICLUNR_JS)?;
+         debug!("Copying search files ✓");
+     }
+Index: rustc-1.37.0-src/vendor/mdbook/src/theme/index.hbs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/theme/index.hbs    2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/theme/index.hbs 2019-08-22 11:17:43.733501509 -0700
+@@ -20,12 +20,10 @@
+         <link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
+         <!-- Fonts -->
+-        <link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
+-        <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
+-        <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500" rel="stylesheet" type="text/css">
++        <link rel="stylesheet" href="{{ path_to_root }}../font-awesome.min.css">
+         <!-- Highlight.js Stylesheets -->
+-        <link rel="stylesheet" href="{{ path_to_root }}highlight.css">
++        <link rel="stylesheet" href="{{ path_to_root }}../highlight.css">
+         <link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
+         <link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
+@@ -36,7 +34,7 @@
+         {{#if mathjax_support}}
+         <!-- MathJax -->
+-        <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
++        <script async type="text/javascript" src="../mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+         {{/if}}
+     </head>
+     <body>
+@@ -46,46 +44,6 @@
+             var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
+         </script>
+-        <!-- Work around some values being stored in localStorage wrapped in quotes -->
+-        <script type="text/javascript">
+-            try {
+-                var theme = localStorage.getItem('mdbook-theme');
+-                var sidebar = localStorage.getItem('mdbook-sidebar');
+-
+-                if (theme.startsWith('"') && theme.endsWith('"')) {
+-                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
+-                }
+-
+-                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
+-                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
+-                }
+-            } catch (e) { }
+-        </script>
+-
+-        <!-- Set the theme before any content is loaded, prevents flash -->
+-        <script type="text/javascript">
+-            var theme;
+-            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
+-            if (theme === null || theme === undefined) { theme = default_theme; }
+-            var html = document.querySelector('html');
+-            html.classList.remove('no-js')
+-            html.classList.remove('{{ default_theme }}')
+-            html.classList.add(theme);
+-            html.classList.add('js');
+-        </script>
+-
+-        <!-- Hide / unhide sidebar before it is displayed -->
+-        <script type="text/javascript">
+-            var html = document.querySelector('html');
+-            var sidebar = 'hidden';
+-            if (document.body.clientWidth >= 1080) {
+-                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
+-                sidebar = sidebar || 'visible';
+-            }
+-            html.classList.remove('sidebar-visible');
+-            html.classList.add("sidebar-" + sidebar);
+-        </script>
+-
+         <nav id="sidebar" class="sidebar" aria-label="Table of contents">
+             <div id="sidebar-scrollbox" class="sidebar-scrollbox">
+                 {{#toc}}{{/toc}}
+@@ -211,53 +172,7 @@
+         </script>
+         {{/if}}
+-        {{#if google_analytics}}
+-        <!-- Google Analytics Tag -->
+-        <script type="text/javascript">
+-            var localAddrs = ["localhost", "127.0.0.1", ""];
+-
+-            // make sure we don't activate google analytics if the developer is
+-            // inspecting the book locally...
+-            if (localAddrs.indexOf(document.location.hostname) === -1) {
+-                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+-                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+-                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+-                })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+-
+-                ga('create', '{{google_analytics}}', 'auto');
+-                ga('send', 'pageview');
+-            }
+-        </script>
+-        {{/if}}
+-
+-        {{#if playpen_line_numbers}}
+-        <script type="text/javascript">
+-            window.playpen_line_numbers = true;
+-        </script>
+-        {{/if}}
+-        
+-        {{#if playpen_copyable}}
+-        <script type="text/javascript">
+-            window.playpen_copyable = true;
+-        </script>
+-        {{/if}}
+-
+-        {{#if playpen_js}}
+-        <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script>
+-        {{/if}}
+-
+-        {{#if search_js}}
+-        <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script>
+-        {{/if}}
+-
+-        <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script>
+-        <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script>
++        <script src="{{ path_to_root }}../highlight.js" type="text/javascript" charset="utf-8"></script>
+         <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script>
+         <!-- Custom JS scripts -->
+Index: rustc-1.37.0-src/vendor/mdbook/src/theme/mod.rs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/theme/mod.rs       2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/theme/mod.rs    2019-08-22 11:17:30.020768197 -0700
+@@ -1,7 +1,5 @@
+ #![allow(missing_docs)]
+-pub mod playpen_editor;
+-
+ #[cfg(feature = "search")]
+ pub mod searcher;
+@@ -19,19 +17,8 @@
+ pub static VARIABLES_CSS: &[u8] = include_bytes!("css/variables.css");
+ pub static FAVICON: &[u8] = include_bytes!("favicon.png");
+ pub static JS: &[u8] = include_bytes!("book.js");
+-pub static HIGHLIGHT_JS: &[u8] = include_bytes!("highlight.js");
+ pub static TOMORROW_NIGHT_CSS: &[u8] = include_bytes!("tomorrow-night.css");
+-pub static HIGHLIGHT_CSS: &[u8] = include_bytes!("highlight.css");
+ pub static AYU_HIGHLIGHT_CSS: &[u8] = include_bytes!("ayu-highlight.css");
+-pub static CLIPBOARD_JS: &[u8] = include_bytes!("clipboard.min.js");
+-pub static FONT_AWESOME: &[u8] = include_bytes!("FontAwesome/css/font-awesome.min.css");
+-pub static FONT_AWESOME_EOT: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.eot");
+-pub static FONT_AWESOME_SVG: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.svg");
+-pub static FONT_AWESOME_TTF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.ttf");
+-pub static FONT_AWESOME_WOFF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff");
+-pub static FONT_AWESOME_WOFF2: &[u8] =
+-    include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff2");
+-pub static FONT_AWESOME_OTF: &[u8] = include_bytes!("FontAwesome/fonts/FontAwesome.otf");
+ /// The `Theme` struct should be used instead of the static variables because
+ /// the `new()` method will look if the user has a theme directory in their
+@@ -49,11 +36,8 @@
+     pub variables_css: Vec<u8>,
+     pub favicon: Vec<u8>,
+     pub js: Vec<u8>,
+-    pub highlight_css: Vec<u8>,
+     pub tomorrow_night_css: Vec<u8>,
+     pub ayu_highlight_css: Vec<u8>,
+-    pub highlight_js: Vec<u8>,
+-    pub clipboard_js: Vec<u8>,
+ }
+ impl Theme {
+@@ -82,9 +66,6 @@
+                     &mut theme.variables_css,
+                 ),
+                 (theme_dir.join("favicon.png"), &mut theme.favicon),
+-                (theme_dir.join("highlight.js"), &mut theme.highlight_js),
+-                (theme_dir.join("clipboard.min.js"), &mut theme.clipboard_js),
+-                (theme_dir.join("highlight.css"), &mut theme.highlight_css),
+                 (
+                     theme_dir.join("tomorrow-night.css"),
+                     &mut theme.tomorrow_night_css,
+@@ -121,11 +102,8 @@
+             variables_css: VARIABLES_CSS.to_owned(),
+             favicon: FAVICON.to_owned(),
+             js: JS.to_owned(),
+-            highlight_css: HIGHLIGHT_CSS.to_owned(),
+             tomorrow_night_css: TOMORROW_NIGHT_CSS.to_owned(),
+             ayu_highlight_css: AYU_HIGHLIGHT_CSS.to_owned(),
+-            highlight_js: HIGHLIGHT_JS.to_owned(),
+-            clipboard_js: CLIPBOARD_JS.to_owned(),
+         }
+     }
+ }
+@@ -175,11 +153,8 @@
+             "css/print.css",
+             "css/variables.css",
+             "book.js",
+-            "highlight.js",
+             "tomorrow-night.css",
+-            "highlight.css",
+             "ayu-highlight.css",
+-            "clipboard.min.js",
+         ];
+         let temp = TempFileBuilder::new().prefix("mdbook-").tempdir().unwrap();
+@@ -201,11 +176,8 @@
+             variables_css: Vec::new(),
+             favicon: Vec::new(),
+             js: Vec::new(),
+-            highlight_css: Vec::new(),
+             tomorrow_night_css: Vec::new(),
+             ayu_highlight_css: Vec::new(),
+-            highlight_js: Vec::new(),
+-            clipboard_js: Vec::new(),
+         };
+         assert_eq!(got, empty);
+Index: rustc-1.37.0-src/vendor/mdbook/src/theme/searcher/mod.rs
+===================================================================
+--- rustc-1.37.0-src.orig/vendor/mdbook/src/theme/searcher/mod.rs      2019-08-22 11:17:30.020768197 -0700
++++ rustc-1.37.0-src/vendor/mdbook/src/theme/searcher/mod.rs   2019-08-22 11:17:30.020768197 -0700
+@@ -2,5 +2,3 @@
+ //! the "search" cargo feature is disabled.
+ pub static JS: &[u8] = include_bytes!("searcher.js");
+-pub static MARK_JS: &[u8] = include_bytes!("mark.min.js");
+-pub static ELASTICLUNR_JS: &[u8] = include_bytes!("elasticlunr.min.js");
diff --git a/patches/d-add-bootstrap-checksums.patch b/patches/d-add-bootstrap-checksums.patch
new file mode 100644 (file)
index 0000000..491058f
--- /dev/null
@@ -0,0 +1,114 @@
+Description: signatures for stage0 binaries
+
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-aarch64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++9c675cbb2e23f17804938a7b4c4955a6b870c51de4aedbe7551a7b8c04d13e0e  cargo-0.41.0-aarch64-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-armv7-unknown-linux-gnueabihf.tar.xz.sha256
+@@ -0,0 +1 @@
++bbae95c5c4224fed063559c8d7f65b3ee280a62d2471e2c7a01d7a14896d3e04  cargo-0.41.0-armv7-unknown-linux-gnueabihf.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-i686-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++c48bc132f4025ff39b1b6dc52aef9d406c3f926ce05fe92d943ceab7a5fd6058  cargo-0.41.0-i686-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-mips-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++6e2c5b4333176353af182a610a417409c67f06eb6a1b5164189bd8d465da7136  cargo-0.41.0-mips-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-mips64el-unknown-linux-gnuabi64.tar.xz.sha256
+@@ -0,0 +1 @@
++093030a8b2a881a9e939a7a93541b447c2b23a20270463e97c6d3d0828e9d68a  cargo-0.41.0-mips64el-unknown-linux-gnuabi64.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-mipsel-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++08a390d88d1e46419c52384d28e5c22b3a3028f71ae1c1a6a1f3f43fa91b9e92  cargo-0.41.0-mipsel-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-powerpc64le-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++7705f21d938a72ba6f01818661b2dea29183209940a335f18d1761e1e03d3710  cargo-0.41.0-powerpc64le-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-s390x-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++21e285a5f67df44849d6cbaa31dde941f238f860c027ec1c2f10aebce70eb2b5  cargo-0.41.0-s390x-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/cargo-0.41.0-x86_64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++9b6ae643fa240c5ecbc1dc390f4020b6a683f25bac6f7437ebd4b9d32a8d0b6c  cargo-0.41.0-x86_64-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-aarch64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++1abd1865e8339c2cac6992a11f6f98b66fa2b97f67acaddcf1992e39a7001bfc  rust-std-1.40.0-aarch64-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-armv5te-unknown-linux-gnueabi.tar.xz.sha256
+@@ -0,0 +1 @@
++c95b2defe9fa99299d7dd3dc62d2ec3222b7cb247f7b13bb6b6d8b2b42445858  rust-std-1.40.0-armv5te-unknown-linux-gnueabi.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz.sha256
+@@ -0,0 +1 @@
++9d4aad78db894a76e9682f2095ac024cc4748b2933f9f7248bf571923f7693c4  rust-std-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-i686-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++beab29565d12a6b9db4ef471c34d4c034295760095f7edc3f7b6c51fc08589a0  rust-std-1.40.0-i686-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-mips-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++c25790d43e0a01e5f45607b067b22ae96163d5eae877cee1b2b35ce0d43ab9b5  rust-std-1.40.0-mips-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-mips64el-unknown-linux-gnuabi64.tar.xz.sha256
+@@ -0,0 +1 @@
++9a4cfebee845dfd50f0f10c3019b89af3747c3aed1a797042285f3cea5a3eb30  rust-std-1.40.0-mips64el-unknown-linux-gnuabi64.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-mipsel-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++ab738a37c1cac1aaec7cb34556fa9bfff46dc912baf360a27e9d81311120ec4a  rust-std-1.40.0-mipsel-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++4eb3141fb6c3d3e101b5d4493664c9a01d4bb9eebdf4b96f5c26a81188c2452d  rust-std-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-s390x-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++acd6f74c537468d3d7ca8b0fdf9cff536816649ac10a554182c6a25e5db824af  rust-std-1.40.0-s390x-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rust-std-1.40.0-x86_64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++5a0b14a51f51b0194f70a2023749d9cb49c3b2e11f0d4c8232960b91fad336ac  rust-std-1.40.0-x86_64-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-aarch64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++40619bf6316706e9d8f9d842802e9e00018140ffb3e937d807299b5a28af4536  rustc-1.40.0-aarch64-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz.sha256
+@@ -0,0 +1 @@
++bfe3d472f2ff96a456ce0887f1dd445a56170254eadee5f43f0c9ee01a2c97f1  rustc-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-i686-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++257e4789043098a5e3b4fa85ea988019f37d640a10f83d39ada00fb23e057b8a  rustc-1.40.0-i686-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-mips-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++98aef08d3bb880b9cea6e87d82ab53c064ee669b5261f5adc971fed49381866f  rustc-1.40.0-mips-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-mips64el-unknown-linux-gnuabi64.tar.xz.sha256
+@@ -0,0 +1 @@
++f05e32125075eb61d9d90ad2ef3063ce76495ea356842e935ce06b9e8a621627  rustc-1.40.0-mips64el-unknown-linux-gnuabi64.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-mipsel-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++9d77489603614f88dcc4b11a853a66fcff8e12c218907eb492901c93940acc15  rustc-1.40.0-mipsel-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++aa07a07ad272de825da8c18ad8dc4143a25bd28e5538d68c3bced53f060432b4  rustc-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-s390x-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++04ef2b7c298169351944e025e3ce5708d288d450b84718f0af916d61ed0f425e  rustc-1.40.0-s390x-unknown-linux-gnu.tar.xz
+--- /dev/null
++++ rustc-1.41.1+dfsg1/stage0/2019-12-19/rustc-1.40.0-x86_64-unknown-linux-gnu.tar.xz.sha256
+@@ -0,0 +1 @@
++b1c00618b7a98156e88b14682508a503284f85748eab23de749a20dcc8847111  rustc-1.40.0-x86_64-unknown-linux-gnu.tar.xz
diff --git a/patches/d-add-soname.patch b/patches/d-add-soname.patch
new file mode 100644 (file)
index 0000000..7a5c018
--- /dev/null
@@ -0,0 +1,36 @@
+Description: Set DT_SONAME when building dylibs
+ In Rust, library filenames include a version-specific hash to help
+ the run-time linker find the correct version.  Unlike in C/C++, the
+ compiler looks for all libraries matching a glob that ignores the
+ hash and reads embedded metadata to work out versions, etc.
+ .
+ The upshot is that there is no need for the usual "libfoo.so ->
+ libfoo-1.2.3.so" symlink common with C/C++ when building with Rust,
+ and no need to communicate an alternate filename to use at run-time
+ vs compile time.  If linking to a Rust dylib from C/C++ however, a
+ "libfoo.so -> libfoo-$hash.so" symlink may well be useful and in
+ this case DT_SONAME=libfoo-$hash.so would be required.  More
+ mundanely, various tools (eg: dpkg-shlibdeps) complain if they don't
+ find DT_SONAME on shared libraries in public directories.
+ .
+ This patch passes -Wl,-soname=$outfile when building dylibs (and
+ using a GNU linker).
+Author: Angus Lees <gus@debian.org>
+Forwarded: no
+
+--- a/src/librustc_codegen_ssa/back/link.rs
++++ b/src/librustc_codegen_ssa/back/link.rs
+@@ -1034,6 +1034,13 @@
+         cmd.args(&rpath::get_rpath_flags(&mut rpath_config));
+     }
++    if (crate_type == config::CrateType::Dylib || crate_type == config::CrateType::Cdylib)
++       && t.options.linker_is_gnu {
++        let filename = String::from(out_filename.file_name().unwrap().to_str().unwrap());
++        let soname = [String::from("-Wl,-soname=") + &filename];
++        cmd.args(&soname);
++    }
++
+     // Finally add all the linker arguments provided on the command line along
+     // with any #[link_args] attributes found inside the crate
+     if let Some(ref args) = sess.opts.cg.link_args {
diff --git a/patches/d-disable-cargo-vendor.patch b/patches/d-disable-cargo-vendor.patch
new file mode 100644 (file)
index 0000000..a120bf5
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Don't check for cargo-vendor when building from (Debian's) git
+Author: Matthijs van Otterdijk <matthijs@wirevirt.net>
+Forwarded: not-needed
+---
+--- a/src/bootstrap/dist.rs
++++ b/src/bootstrap/dist.rs
+@@ -851,7 +851,10 @@
+         }
+         // If we're building from git sources, we need to vendor a complete distribution.
+-        if builder.rust_info.is_git() {
++        //
++        // Debian: disabling this block because the debian package is also in a git
++        //         repository, but cargo-vendor should not be installed or run.
++        if false && builder.rust_info.is_git() {
+             // Vendor all Cargo dependencies
+             let mut cmd = Command::new(&builder.initial_cargo);
+             cmd.arg("vendor")
diff --git a/patches/d-dont-download-stage0.patch b/patches/d-dont-download-stage0.patch
new file mode 100644 (file)
index 0000000..e9db094
--- /dev/null
@@ -0,0 +1,49 @@
+Description: Don't download SHA256 if it's already available locally
+ In Debian we provide the stage0 tarballs as a separate component so that the
+ buildds don't need to access the network during the build.
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -24,16 +24,18 @@
+ from time import time
+-def get(url, path, verbose=False):
++def get(url, path, verbose=False, use_local_hash_if_present=True):
+     suffix = '.sha256'
+     sha_url = url + suffix
+     with tempfile.NamedTemporaryFile(delete=False) as temp_file:
+         temp_path = temp_file.name
+-    with tempfile.NamedTemporaryFile(suffix=suffix, delete=False) as sha_file:
+-        sha_path = sha_file.name
++    sha_path = path + suffix
+     try:
+-        download(sha_path, sha_url, False, verbose)
++        if use_local_hash_if_present and os.path.exists(sha_path):
++            print("using already-download file " + sha_path)
++        else:
++            download(sha_path, sha_url, False, verbose)
+         if os.path.exists(path):
+             if verify(path, sha_path, False):
+                 if verbose:
+@@ -51,7 +53,6 @@
+             print("moving {} to {}".format(temp_path, path))
+         shutil.move(temp_path, path)
+     finally:
+-        delete_if_present(sha_path, verbose)
+         delete_if_present(temp_path, verbose)
+@@ -401,7 +401,7 @@
+         url = "{}/dist/{}".format(self._download_url, self.date)
+         tarball = os.path.join(rustc_cache, filename)
+-        if not os.path.exists(tarball):
++        if True:
+             get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
+         unpack(tarball, tarball_suffix, self.bin_root(), match=pattern, verbose=self.verbose)
diff --git a/patches/d-fix-mips64el-bootstrap.patch b/patches/d-fix-mips64el-bootstrap.patch
new file mode 100644 (file)
index 0000000..553a048
--- /dev/null
@@ -0,0 +1,12 @@
+Bug: https://github.com/rust-lang/rust/issues/52108
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -632,6 +632,8 @@
+         # preserve existing RUSTFLAGS
+         env.setdefault("RUSTFLAGS", "")
+         env["RUSTFLAGS"] += " -Cdebuginfo=2"
++        if self.build_triple().startswith('mips'):
++            env["RUSTFLAGS"] += " -Cllvm-args=-mxgot"
+         build_section = "target.{}".format(self.build_triple())
+         target_features = []
diff --git a/patches/d-host-duplicates.patch b/patches/d-host-duplicates.patch
new file mode 100644 (file)
index 0000000..6fe1529
--- /dev/null
@@ -0,0 +1,30 @@
+Description: Work around #842634 on some machines, e.g. Debian porterboxes
+ This should remain commented-out in debian/patches/series, it's not needed everywhere
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/libstd/sys_common/net.rs
++++ b/src/libstd/sys_common/net.rs
+@@ -609,21 +609,3 @@
+             .finish()
+     }
+ }
+-
+-#[cfg(test)]
+-mod tests {
+-    use super::*;
+-    use crate::collections::HashMap;
+-
+-    #[test]
+-    fn no_lookup_host_duplicates() {
+-        let mut addrs = HashMap::new();
+-        let lh = match LookupHost::try_from(("localhost", 0)) {
+-            Ok(lh) => lh,
+-            Err(e) => panic!("couldn't resolve `localhost': {}", e)
+-        };
+-        for sa in lh { *addrs.entry(sa).or_insert(0) += 1; };
+-        assert_eq!(addrs.iter().filter(|&(_, &v)| v > 1).collect::<Vec<_>>(), vec![],
+-                   "There should be no duplicate localhost entries");
+-    }
+-}
diff --git a/patches/d-i686-baseline.patch b/patches/d-i686-baseline.patch
new file mode 100644 (file)
index 0000000..2038344
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/librustc_target/spec/i686_unknown_linux_gnu.rs b/src/librustc_target/spec/i686_unknown_linux_gnu.rs
+index c3ff34788..80b296980 100644
+--- a/src/librustc_target/spec/i686_unknown_linux_gnu.rs
++++ b/src/librustc_target/spec/i686_unknown_linux_gnu.rs
+@@ -12,7 +12,7 @@ use spec::{LinkerFlavor, Target, TargetResult};
+ pub fn target() -> TargetResult {
+     let mut base = super::linux_base::opts();
+-    base.cpu = "pentium4".to_string();
++    base.cpu = "pentiumpro".to_string();
+     base.max_atomic_width = Some(64);
+     base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+     base.stack_probes = true;
diff --git a/patches/d-ignore-avx-44056.patch b/patches/d-ignore-avx-44056.patch
new file mode 100644 (file)
index 0000000..bffda4d
--- /dev/null
@@ -0,0 +1,12 @@
+Bug: https://github.com/rust-lang/rust/pull/55667
+Index: rust/src/test/ui/issues/issue-44056.rs
+===================================================================
+--- rust.orig/src/test/ui/issues/issue-44056.rs
++++ rust/src/test/ui/issues/issue-44056.rs
+@@ -1,5 +1,5 @@
+ // build-pass (FIXME(55996): should be run on targets supporting avx)
+-// only-x86_64
++// ignore-test
+ // no-prefer-dynamic
+ // compile-flags: -Ctarget-feature=+avx -Clto
diff --git a/patches/d-ignore-error-detail-diff.patch b/patches/d-ignore-error-detail-diff.patch
new file mode 100644 (file)
index 0000000..69c82d6
--- /dev/null
@@ -0,0 +1,400 @@
+Description: Ignore error details with $SRC_DIR
+ We build with --remap-path-prefix so it doesn't work, see bug below
+Bug: https://github.com/rust-lang/rust/issues/53081
+Index: rust/src/test/ui/impl-trait/impl-generic-mismatch.stderr
+===================================================================
+--- rust.orig/src/test/ui/impl-trait/impl-generic-mismatch.stderr
++++ rust/src/test/ui/impl-trait/impl-generic-mismatch.stderr
+@@ -31,11 +31,6 @@ error[E0643]: method `hash` has incompat
+    |
+ LL |     fn hash(&self, hasher: &mut impl Hasher) {}
+    |                                 ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - declaration in trait here
+ error: aborting due to 3 previous errors
+Index: rust/src/test/ui/closures/closure-move-sync.stderr
+===================================================================
+--- rust.orig/src/test/ui/closures/closure-move-sync.stderr
++++ rust/src/test/ui/closures/closure-move-sync.stderr
+@@ -3,11 +3,6 @@ error[E0277]: `std::sync::mpsc::Receiver
+    |
+ LL |     let t = thread::spawn(|| {
+    |             ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
+-   | 
+-  ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
+-   |
+-LL |     F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
+-   |                          ---- required by this bound in `std::thread::spawn`
+    |
+    = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
+    = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
+@@ -18,11 +13,6 @@ error[E0277]: `std::sync::mpsc::Sender<(
+    |
+ LL |     thread::spawn(|| tx.send(()).unwrap());
+    |     ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
+-   | 
+-  ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
+-   |
+-LL |     F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
+-   |                          ---- required by this bound in `std::thread::spawn`
+    |
+    = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
+    = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
+Index: rust/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
+===================================================================
+--- rust.orig/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
++++ rust/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the trait bound `Error: st
+    |
+ LL |      x: Error
+    |      ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - required by this bound in `std::hash::Hash::hash`
+ error: aborting due to previous error
+Index: rust/src/test/ui/derives/derives-span-Hash-enum.stderr
+===================================================================
+--- rust.orig/src/test/ui/derives/derives-span-Hash-enum.stderr
++++ rust/src/test/ui/derives/derives-span-Hash-enum.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the trait bound `Error: st
+    |
+ LL |      Error
+    |      ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - required by this bound in `std::hash::Hash::hash`
+ error: aborting due to previous error
+Index: rust/src/test/ui/derives/derives-span-Hash-struct.stderr
+===================================================================
+--- rust.orig/src/test/ui/derives/derives-span-Hash-struct.stderr
++++ rust/src/test/ui/derives/derives-span-Hash-struct.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the trait bound `Error: st
+    |
+ LL |     x: Error
+    |     ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - required by this bound in `std::hash::Hash::hash`
+ error: aborting due to previous error
+Index: rust/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
+===================================================================
+--- rust.orig/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
++++ rust/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the trait bound `Error: st
+    |
+ LL |     Error
+    |     ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - required by this bound in `std::hash::Hash::hash`
+ error: aborting due to previous error
+Index: rust/src/test/ui/interior-mutability/interior-mutability.stderr
+===================================================================
+--- rust.orig/src/test/ui/interior-mutability/interior-mutability.stderr
++++ rust/src/test/ui/interior-mutability/interior-mutability.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the type `std::cell::Unsaf
+    |
+ LL |     catch_unwind(|| { x.set(23); });
+    |     ^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+-   | 
+-  ::: $SRC_DIR/libstd/panic.rs:LL:COL
+-   |
+-LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
+-   |                                        ---------- required by this bound in `std::panic::catch_unwind`
+    |
+    = help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
+    = note: required because it appears within the type `std::cell::Cell<i32>`
+Index: rust/src/test/ui/issues/issue-21160.stderr
+===================================================================
+--- rust.orig/src/test/ui/issues/issue-21160.stderr
++++ rust/src/test/ui/issues/issue-21160.stderr
+@@ -3,11 +3,6 @@ error[E0277]: the trait bound `Bar: std:
+    |
+ LL | struct Foo(Bar);
+    |            ^^^ the trait `std::hash::Hash` is not implemented for `Bar`
+-   | 
+-  ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
+-   |
+-LL |     fn hash<H: Hasher>(&self, state: &mut H);
+-   |             - required by this bound in `std::hash::Hash::hash`
+ error: aborting due to previous error
+Index: rust/src/test/ui/no-send-res-ports.stderr
+===================================================================
+--- rust.orig/src/test/ui/no-send-res-ports.stderr
++++ rust/src/test/ui/no-send-res-ports.stderr
+@@ -3,11 +3,6 @@ error[E0277]: `std::rc::Rc<()>` cannot b
+    |
+ LL |     thread::spawn(move|| {
+    |     ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
+-   | 
+-  ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
+-   |
+-LL |     F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
+-   |                          ---- required by this bound in `std::thread::spawn`
+    |
+    = help: within `[closure@$DIR/no-send-res-ports.rs:26:19: 30:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
+    = note: required because it appears within the type `Port<()>`
+Index: rust/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+===================================================================
+--- rust.orig/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
++++ rust/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+@@ -5,11 +5,6 @@ LL | / fn can_parse_zero_as_f32() -> Res
+ LL | |     "0".parse()
+ LL | | }
+    | |_^ `main` can only return types that implement `std::process::Termination`
+-   | 
+-  ::: $SRC_DIR/libtest/lib.rs:LL:COL
+-   |
+-LL |   pub fn assert_test_result<T: Termination>(result: T) {
+-   |                                ----------- required by this bound in `test::assert_test_result`
+    |
+    = help: the trait `std::process::Termination` is not implemented for `std::result::Result<f32, std::num::ParseFloatError>`
+Index: rust/src/test/ui/traits/trait-suggest-where-clause.stderr
+===================================================================
+--- rust.orig/src/test/ui/traits/trait-suggest-where-clause.stderr
++++ rust/src/test/ui/traits/trait-suggest-where-clause.stderr
+@@ -6,11 +6,6 @@ LL | fn check<T: Iterator, U: ?Sized>()
+ LL |     // suggest a where-clause, if needed
+ LL |     mem::size_of::<U>();
+    |                    ^ doesn't have a size known at compile-time
+-   | 
+-  ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL | pub const fn size_of<T>() -> usize {
+-   |                      - required by this bound in `std::mem::size_of`
+    |
+    = help: the trait `std::marker::Sized` is not implemented for `U`
+    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+@@ -23,11 +18,6 @@ LL | fn check<T: Iterator, U: ?Sized>()
+ ...
+ LL |     mem::size_of::<Misc<U>>();
+    |     ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+-   | 
+-  ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL | pub const fn size_of<T>() -> usize {
+-   |                      - required by this bound in `std::mem::size_of`
+    |
+    = help: within `Misc<U>`, the trait `std::marker::Sized` is not implemented for `U`
+    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+@@ -62,11 +52,6 @@ error[E0277]: the size for values of typ
+    |
+ LL |     mem::size_of::<[T]>();
+    |                    ^^^ doesn't have a size known at compile-time
+-   | 
+-  ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL | pub const fn size_of<T>() -> usize {
+-   |                      - required by this bound in `std::mem::size_of`
+    |
+    = help: the trait `std::marker::Sized` is not implemented for `[T]`
+    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+@@ -76,11 +61,6 @@ error[E0277]: the size for values of typ
+    |
+ LL |     mem::size_of::<[&U]>();
+    |     ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+-   | 
+-  ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL | pub const fn size_of<T>() -> usize {
+-   |                      - required by this bound in `std::mem::size_of`
+    |
+    = help: the trait `std::marker::Sized` is not implemented for `[&U]`
+    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+Index: rust/src/test/ui/type_length_limit.stderr
+===================================================================
+--- rust.orig/src/test/ui/type_length_limit.stderr
++++ rust/src/test/ui/type_length_limit.stderr
+@@ -1,8 +1,4 @@
+ error: reached the type-length limit while instantiating `std::mem::drop::<std::option::Op... G), (G, G, G), (G, G, G))))))>>`
+-  --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL | pub fn drop<T>(_x: T) { }
+-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: consider adding a `#![type_length_limit="1094"]` attribute to your crate
+Index: rust/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
+===================================================================
+--- rust.orig/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
++++ rust/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
+@@ -22,10 +22,6 @@ LL |         extern crate std as Vec;
+ LL | define_vec!();
+    | -------------- in this macro invocation
+ note: `Vec` could also refer to the struct defined here
+-  --> $SRC_DIR/libstd/prelude/v1.rs:LL:COL
+-   |
+-LL | pub use crate::vec::Vec;
+-   |         ^^^^^^^^^^^^^^^
+ error: aborting due to 2 previous errors
+Index: rust/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
+===================================================================
+--- rust.orig/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
++++ rust/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
+@@ -3,11 +3,6 @@ error: `impl` item signature doesn't mat
+    |
+ LL |     fn deref(&self) -> &dyn Trait {
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&Struct) -> &dyn Trait
+-   | 
+-  ::: $SRC_DIR/libcore/ops/deref.rs:LL:COL
+-   |
+-LL |     fn deref(&self) -> &Self::Target;
+-   |     --------------------------------- expected fn(&Struct) -> &(dyn Trait + 'static)
+    |
+    = note: expected `fn(&Struct) -> &(dyn Trait + 'static)`
+               found `fn(&Struct) -> &dyn Trait`
+Index: rust/src/test/ui/async-await/issues/issue-62009-1.stderr
+===================================================================
+--- rust.orig/src/test/ui/async-await/issues/issue-62009-1.stderr
++++ rust/src/test/ui/async-await/issues/issue-62009-1.stderr
+@@ -32,11 +32,6 @@ error[E0277]: the trait bound `[closure@
+    |
+ LL |     (|_| 2333).await;
+    |     ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:13:5: 13:15]`
+-   | 
+-  ::: $SRC_DIR/libstd/future.rs:LL:COL
+-   |
+-LL |     F: Future
+-   |        ------ required by this bound in `std::future::poll_with_tls_context`
+ error: aborting due to 4 previous errors
+Index: rust/src/test/ui/consts/const-size_of-cycle.stderr
+===================================================================
+--- rust.orig/src/test/ui/consts/const-size_of-cycle.stderr
++++ rust/src/test/ui/consts/const-size_of-cycle.stderr
+@@ -15,15 +15,7 @@ note: ...which requires const-evaluating
+ LL |     bytes: [u8; std::mem::size_of::<Foo>()]
+    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ note: ...which requires const-evaluating `std::mem::size_of`...
+-  --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
+-   |
+-LL |     intrinsics::size_of::<T>()
+-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
+-  --> $SRC_DIR/libcore/intrinsics.rs:LL:COL
+-   |
+-LL |     pub fn size_of<T>() -> usize;
+-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    = note: ...which requires computing layout of `Foo`...
+    = note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
+    = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
+Index: rust/src/test/ui/consts/offset_from_ub.stderr
+===================================================================
+--- rust.orig/src/test/ui/consts/offset_from_ub.stderr
++++ rust/src/test/ui/consts/offset_from_ub.stderr
+@@ -1,12 +1,5 @@
+ error: any use of this value will cause an error
+-  --> $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+-   |
+-LL |           intrinsics::ptr_offset_from(self, origin)
+-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-   |           |
+-   |           ptr_offset_from cannot compute offset of pointers into different allocations.
+-   |           inside call to `std::ptr::<impl *const Struct>::offset_from` at $DIR/offset_from_ub.rs:19:27
+    | 
+   ::: $DIR/offset_from_ub.rs:13:1
+    |
+ LL | / pub const DIFFERENT_ALLOC: usize = {
+@@ -21,14 +13,7 @@ LL | | };
+    = note: `#[deny(const_err)]` on by default
+ error: any use of this value will cause an error
+-  --> $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+-   |
+-LL |           intrinsics::ptr_offset_from(self, origin)
+-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-   |           |
+-   |           a memory access tried to interpret some bytes as a pointer
+-   |           inside call to `std::ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:25:14
+    | 
+   ::: $DIR/offset_from_ub.rs:23:1
+    |
+ LL | / pub const NOT_PTR: usize = {
+@@ -38,14 +22,7 @@ LL | | };
+    | |__-
+ error: any use of this value will cause an error
+-  --> $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+-   |
+-LL |           intrinsics::ptr_offset_from(self, origin)
+-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-   |           |
+-   |           exact_div: 1 cannot be divided by 2 without remainder
+-   |           inside call to `std::ptr::<impl *const u16>::offset_from` at $DIR/offset_from_ub.rs:33:14
+    | 
+   ::: $DIR/offset_from_ub.rs:28:1
+    |
+ LL | / pub const NOT_MULTIPLE_OF_SIZE: isize = {
+@@ -58,14 +34,7 @@ LL | | };
+    | |__-
+ error: any use of this value will cause an error
+-  --> $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+-   |
+-LL |           intrinsics::ptr_offset_from(self, origin)
+-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-   |           |
+-   |           invalid use of NULL pointer
+-   |           inside call to `std::ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:39:14
+    | 
+   ::: $DIR/offset_from_ub.rs:36:1
+    |
+ LL | / pub const OFFSET_FROM_NULL: isize = {
+@@ -76,14 +44,7 @@ LL | | };
+    | |__-
+ error: any use of this value will cause an error
+-  --> $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+-   |
+-LL |           intrinsics::ptr_offset_from(self, origin)
+-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-   |           |
+-   |           a memory access tried to interpret some bytes as a pointer
+-   |           inside call to `std::ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:46:14
+    | 
+   ::: $DIR/offset_from_ub.rs:42:1
+    |
+ LL | / pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
+Index: rust/src/test/ui/issues/issue-27033.stderr
+===================================================================
+--- rust.orig/src/test/ui/issues/issue-27033.stderr
++++ rust/src/test/ui/issues/issue-27033.stderr
+@@ -3,11 +3,6 @@ error[E0530]: match bindings cannot shad
+    |
+ LL |         None @ _ => {}
+    |         ^^^^ cannot be named the same as a unit variant
+-   | 
+-  ::: $SRC_DIR/libstd/prelude/v1.rs:LL:COL
+-   |
+-LL | pub use crate::option::Option::{self, None, Some};
+-   |                                       ---- the unit variant `None` is defined here
+ error[E0530]: match bindings cannot shadow constants
+   --> $DIR/issue-27033.rs:8:9
diff --git a/patches/d-no-jemalloc.patch b/patches/d-no-jemalloc.patch
new file mode 100644 (file)
index 0000000..d19de87
--- /dev/null
@@ -0,0 +1,17 @@
+Index: rust/src/rustc/Cargo.toml
+===================================================================
+--- rust.orig/src/rustc/Cargo.toml
++++ rust/src/rustc/Cargo.toml
+@@ -15,12 +15,5 @@ rustc_driver = { path = "../librustc_dri
+ # Make sure rustc_codegen_ssa ends up in the sysroot, because this
+ # crate is intended to be used by codegen backends, which may not be in-tree.
+ rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
+-
+-[dependencies.jemalloc-sys]
+-version = '0.3.0'
+-optional = true
+-features = ['unprefixed_malloc_on_supported_platforms']
+-
+ [features]
+-jemalloc = ['jemalloc-sys']
+ llvm = ['rustc_driver/llvm']
diff --git a/patches/d-prefer-dynamic.patch b/patches/d-prefer-dynamic.patch
new file mode 100644 (file)
index 0000000..13bb429
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Prefer dynamic linking (currently disabled, not applied)
+ As per Debian policy, we basically revert
+ https://github.com/rust-lang/rfcs/blob/master/text/0404-change-prefer-dynamic.md
+ TODO: this does not yet work: https://github.com/rust-lang/rust/issues/43289
+ Perhaps a better method would be to modify dh-cargo instead of rustc
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: not-needed
+--- a/src/librustc/session/config.rs
++++ b/src/librustc/session/config.rs
+@@ -846,7 +846,7 @@
+         "don't run LLVM's SLP vectorization pass"),
+     soft_float: bool = (false, parse_bool, [TRACKED],
+         "use soft float ABI (*eabihf targets only)"),
+-    prefer_dynamic: bool = (false, parse_bool, [TRACKED],
++    prefer_dynamic: bool = (true, parse_bool, [TRACKED],
+         "prefer dynamic linking to static linking"),
+     no_integrated_as: bool = (false, parse_bool, [TRACKED],
+         "use an external assembler rather than LLVM's integrated one"),
diff --git a/patches/d-read-beta-version-from-file.patch b/patches/d-read-beta-version-from-file.patch
new file mode 100644 (file)
index 0000000..8ebe485
--- /dev/null
@@ -0,0 +1,50 @@
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -883,41 +883,13 @@
+             return s
+         }
+-        let beta = output(
+-            Command::new("git")
+-                .arg("ls-remote")
+-                .arg("origin")
+-                .arg("beta")
+-                .current_dir(&self.src)
+-        );
+-        let beta = beta.trim().split_whitespace().next().unwrap();
+-        let master = output(
+-            Command::new("git")
+-                .arg("ls-remote")
+-                .arg("origin")
+-                .arg("master")
+-                .current_dir(&self.src)
+-        );
+-        let master = master.trim().split_whitespace().next().unwrap();
+-
+-        // Figure out where the current beta branch started.
+-        let base = output(
+-            Command::new("git")
+-                .arg("merge-base")
+-                .arg(beta)
+-                .arg(master)
+-                .current_dir(&self.src),
+-        );
+-        let base = base.trim();
+-
+-        // Next figure out how many merge commits happened since we branched off
+-        // beta. That's our beta number!
++        // Debian: read beta number from "version" file, this is only available
++        // in the rustc upstream tarballs and not their git
+         let count = output(
+-            Command::new("git")
+-                .arg("rev-list")
+-                .arg("--count")
+-                .arg("--merges")
+-                .arg(format!("{}...HEAD", base))
++            Command::new("sed")
++                .arg("-re")
++                .arg(r"s/[0-9]+.[0-9]+.[0-9]+-beta.([0-9]+) \(.*\)/\1/g")
++                .arg("version")
+                 .current_dir(&self.src),
+         );
+         let n = count.trim().parse().unwrap();
diff --git a/patches/d-rust-gdb-paths b/patches/d-rust-gdb-paths
new file mode 100644 (file)
index 0000000..d7045e3
--- /dev/null
@@ -0,0 +1,21 @@
+Description: Hardcode GDB python module directory
+ Debian package installs python modules into a fixed directory, so
+ just hardcode path in wrapper script.
+Author: Angus Lees <gus@debian.org>
+Forwarded: not-needed
+
+--- a/src/etc/rust-gdb
++++ b/src/etc/rust-gdb
+@@ -13,8 +13,10 @@
+ set -e
+ # Find out where the pretty printer Python module is
+-RUSTC_SYSROOT=`rustc --print=sysroot`
+-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
++#RUSTC_SYSROOT=`rustc --print=sysroot`
++#GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
++# We can just hardcode this on Debian, and remove the rustc dependency
++GDB_PYTHON_MODULE_DIRECTORY="/usr/share/rust-gdb"
+ # Run GDB with the additional arguments that load the pretty printers
+ # Set the environment variable `RUST_GDB` to overwrite the call to a
diff --git a/patches/d-rust-lldb-paths b/patches/d-rust-lldb-paths
new file mode 100644 (file)
index 0000000..b7ea342
--- /dev/null
@@ -0,0 +1,26 @@
+Description: Hardcode LLDB python module directory
+ Debian package installs python modules into a fixed directory, so
+ just hardcode path in wrapper script.
+Author: Angus Lees <gus@debian.org>
+Forwarded: not-needed
+
+--- a/src/etc/rust-lldb
++++ b/src/etc/rust-lldb
+@@ -10,7 +10,7 @@
+ RUSTC_SYSROOT=$(rustc --print sysroot)
+ RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"
+-lldb=lldb
++lldb=lldb-7
+ if [ -f "$RUST_LLDB" ]; then
+     lldb="$RUST_LLDB"
+ else
+@@ -31,7 +31,7 @@
+ fi
+ # Prepare commands that will be loaded before any file on the command line has been loaded
+-script_import="command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_rust_formatters.py\""
++script_import="command script import \"$RUSTC_SYSROOT/share/rust-lldb/lldb_rust_formatters.py\""
+ category_definition="type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust"
+ category_enable="type category enable Rust"
diff --git a/patches/d-use-system-compiler-rt.patch b/patches/d-use-system-compiler-rt.patch
new file mode 100644 (file)
index 0000000..22843ae
--- /dev/null
@@ -0,0 +1,40 @@
+Description: Use system compiler-rt from clang
+Forwarded: not-needed
+--- a/src/bootstrap/compile.rs
++++ b/src/bootstrap/compile.rs
+@@ -200,6 +200,12 @@
+         let mut features = builder.std_features();
+         features.push_str(&compiler_builtins_c_feature);
++        // In Debian this is always available
++        let llvm_config = builder.ensure(native::Llvm {
++            target: builder.config.build,
++            emscripten: false,
++        });
++        cargo.env("LLVM_CONFIG", llvm_config);
+         if compiler.stage != 0 && builder.config.sanitizers {
+             // This variable is used by the sanitizer runtime crates, e.g.
+             // rustc_lsan, to build the sanitizer runtime from C code
+@@ -208,11 +214,6 @@
+             // missing
+             // We also only build the runtimes when --enable-sanitizers (or its
+             // config.toml equivalent) is used
+-            let llvm_config = builder.ensure(native::Llvm {
+-                target: builder.config.build,
+-                emscripten: false,
+-            });
+-            cargo.env("LLVM_CONFIG", llvm_config);
+             cargo.env("RUSTC_BUILD_SANITIZERS", "1");
+         }
+--- a/vendor/compiler_builtins/Cargo.toml
++++ b/vendor/compiler_builtins/Cargo.toml
+@@ -49,7 +49,7 @@
+ # LLVM_CONFIG or CLANG (more reliable) must be set.
+ c-system = []
+-c = ["c-vendor"]
++c = ["c-system"]
+ compiler-builtins = []
+ default = ["compiler-builtins"]
+ mangled-names = []
diff --git a/patches/rust-pr68019-in-tree-compiletest.patch b/patches/rust-pr68019-in-tree-compiletest.patch
new file mode 100644 (file)
index 0000000..a0b28bf
--- /dev/null
@@ -0,0 +1,97 @@
+From ed8e55fe8d732d8a87343441db3bfbb974f043df Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone@redhat.com>
+Date: Wed, 8 Jan 2020 09:44:45 -0800
+Subject: [PATCH 1/2] Remove obsolete llvm_tools flag
+
+---
+ src/bootstrap/tool.rs | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
+index 815498047fd5..f785a0989a36 100644
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -293,7 +293,6 @@ fn rustbook_features() -> Vec<String> {
+ macro_rules! bootstrap_tool {
+     ($(
+         $name:ident, $path:expr, $tool_name:expr
+-        $(,llvm_tools = $llvm:expr)*
+         $(,is_external_tool = $external:expr)*
+         $(,features = $features:expr)*
+         ;
+@@ -305,15 +304,6 @@ macro_rules! bootstrap_tool {
+             )+
+         }
+-        impl Tool {
+-            /// Whether this tool requires LLVM to run
+-            pub fn uses_llvm_tools(&self) -> bool {
+-                match self {
+-                    $(Tool::$name => false $(|| $llvm)*,)+
+-                }
+-            }
+-        }
+-
+         impl<'a> Builder<'a> {
+             pub fn tool_exe(&self, tool: Tool) -> PathBuf {
+                 match tool {
+@@ -381,7 +371,7 @@ bootstrap_tool!(
+     Tidy, "src/tools/tidy", "tidy";
+     Linkchecker, "src/tools/linkchecker", "linkchecker";
+     CargoTest, "src/tools/cargotest", "cargotest";
+-    Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true;
++    Compiletest, "src/tools/compiletest", "compiletest";
+     BuildManifest, "src/tools/build-manifest", "build-manifest";
+     RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
+     RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true;
+-- 
+2.24.1
+
+
+From cc4688d66d75e149a0136f701045cbf7ee672725 Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone@redhat.com>
+Date: Wed, 8 Jan 2020 10:04:18 -0800
+Subject: [PATCH 2/2] Build compiletest with in-tree libtest
+
+---
+ src/bootstrap/tool.rs | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
+index f785a0989a36..73a4dda74e88 100644
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -294,6 +294,7 @@ macro_rules! bootstrap_tool {
+     ($(
+         $name:ident, $path:expr, $tool_name:expr
+         $(,is_external_tool = $external:expr)*
++        $(,is_unstable_tool = $unstable:expr)*
+         $(,features = $features:expr)*
+         ;
+     )+) => {
+@@ -344,7 +345,12 @@ macro_rules! bootstrap_tool {
+                     compiler: self.compiler,
+                     target: self.target,
+                     tool: $tool_name,
+-                    mode: Mode::ToolBootstrap,
++                    mode: if false $(|| $unstable)* {
++                        // use in-tree libraries for unstable features
++                        Mode::ToolStd
++                    } else {
++                        Mode::ToolBootstrap
++                    },
+                     path: $path,
+                     is_optional_tool: false,
+                     source_type: if false $(|| $external)* {
+@@ -371,7 +377,7 @@ bootstrap_tool!(
+     Tidy, "src/tools/tidy", "tidy";
+     Linkchecker, "src/tools/linkchecker", "linkchecker";
+     CargoTest, "src/tools/cargotest", "cargotest";
+-    Compiletest, "src/tools/compiletest", "compiletest";
++    Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true;
+     BuildManifest, "src/tools/build-manifest", "build-manifest";
+     RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
+     RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true;
+-- 
+2.24.1
+
diff --git a/patches/series b/patches/series
new file mode 100644 (file)
index 0000000..876fcbd
--- /dev/null
@@ -0,0 +1,54 @@
+# Patches for upstream
+
+# patches from fedora
+0001-Fix-compiletest-fallout-from-stage0-bump.patch
+0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch
+rust-pr68019-in-tree-compiletest.patch
+
+# pending, or forwarded
+u-reproducible-build.patch
+u-prefer-local-css.patch
+u-test-python-3.patch
+u-make-tests-work-without-rpath.patch
+u-tests-ignore-arm.patch
+u-mips-fixes.diff
+#u-allow-system-compiler-rt.patch
+u-riscv64-66899.patch
+u-riscv64-68452.patch
+u-riscv64-libc-1606.patch
+u-riscv64-cc-461.patch
+u-riscv64-cc-465.patch
+u-riscv64-compiletest.patch
+u-wasm32-libc-1625.patch
+
+# not forwarded, or forwarded but unlikely to be merged
+u-rustc-llvm-cross-flags.patch
+u-reproducible-dl-stage0.patch
+
+# Debian-specific patches, not suitable for upstream
+# Patches needed by debian/prune-unused-deps
+d-0000-ignore-removed-submodules.patch
+d-0001-disable-miniz.patch
+d-0002-pkg-config-no-special-snowflake.patch
+d-0003-mdbook-strip-embedded-libs.patch
+# Other patches needed by the full Debian build
+#d-use-system-compiler-rt.patch
+d-ignore-error-detail-diff.patch
+d-disable-cargo-vendor.patch
+d-rust-gdb-paths
+d-rust-lldb-paths
+d-add-soname.patch
+d-dont-download-stage0.patch
+d-read-beta-version-from-file.patch
+d-ignore-avx-44056.patch
+d-i686-baseline.patch
+d-no-jemalloc.patch
+
+# Porter fixes under discussion, not suitable for upstreaming
+# as-is but a proper fix is being discussed
+d-fix-mips64el-bootstrap.patch
+
+# Work around for some porterboxes, keep this commented
+#d-host-duplicates.patch
+
+d-add-bootstrap-checksums.patch
diff --git a/patches/u-allow-system-compiler-rt.patch b/patches/u-allow-system-compiler-rt.patch
new file mode 100644 (file)
index 0000000..3bd874a
--- /dev/null
@@ -0,0 +1,327 @@
+Description: Support linking against system clang libs
+ Note: the above PR only covers the compiler_builtins crate, rustc itself also
+ needs patching as per below once that is accepted.
+Forwarded: https://github.com/rust-lang-nursery/compiler-builtins/pull/296
+--- a/vendor/compiler_builtins/Cargo.toml
++++ b/vendor/compiler_builtins/Cargo.toml
+@@ -43,7 +43,13 @@
+ optional = true
+ [features]
+-c = ["cc"]
++c-vendor = ["cc"]
++
++# Link against system clang_rt.* libraries.
++# LLVM_CONFIG or CLANG (more reliable) must be set.
++c-system = []
++
++c = ["c-vendor"]
+ compiler-builtins = []
+ default = ["compiler-builtins"]
+ mangled-names = []
+--- a/vendor/compiler_builtins/build.rs
++++ b/vendor/compiler_builtins/build.rs
+@@ -37,7 +37,7 @@
+     // mangling names though we assume that we're also in test mode so we don't
+     // build anything and we rely on the upstream implementation of compiler-rt
+     // functions
+-    if !cfg!(feature = "mangled-names") && cfg!(feature = "c") {
++    if !cfg!(feature = "mangled-names") && cfg!(any(feature = "c-vendor", feature = "c-system")) {
+         // Don't use a C compiler for these targets:
+         //
+         // * wasm32 - clang 8 for wasm is somewhat hard to come by and it's
+@@ -47,8 +47,10 @@
+         //   compiler nor is cc-rs ready for compilation to riscv (at this
+         //   time). This can probably be removed in the future
+         if !target.contains("wasm32") && !target.contains("nvptx") && !target.starts_with("riscv") {
+-            #[cfg(feature = "c")]
+-            c::compile(&llvm_target);
++            #[cfg(feature = "c-vendor")]
++            c_vendor::compile(&llvm_target);
++            #[cfg(feature = "c-system")]
++            c_system::compile(&llvm_target);
+         }
+     }
+@@ -70,17 +72,14 @@
+     }
+ }
+-#[cfg(feature = "c")]
+-mod c {
+-    extern crate cc;
+-
++#[cfg(any(feature = "c-vendor", feature = "c-system"))]
++mod sources {
+     use std::collections::BTreeMap;
+     use std::env;
+-    use std::path::PathBuf;
+-    struct Sources {
++    pub struct Sources {
+         // SYMBOL -> PATH TO SOURCE
+-        map: BTreeMap<&'static str, &'static str>,
++        pub map: BTreeMap<&'static str, &'static str>,
+     }
+     impl Sources {
+@@ -117,39 +116,11 @@
+         }
+     }
+-    /// Compile intrinsics from the compiler-rt C source code
+-    pub fn compile(llvm_target: &[&str]) {
++    pub fn get_sources(llvm_target: &[&str]) -> Sources {
+         let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
+         let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
+         let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
+         let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
+-        let cfg = &mut cc::Build::new();
+-
+-        cfg.warnings(false);
+-
+-        if target_env == "msvc" {
+-            // Don't pull in extra libraries on MSVC
+-            cfg.flag("/Zl");
+-
+-            // Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP
+-            cfg.define("__func__", Some("__FUNCTION__"));
+-        } else {
+-            // Turn off various features of gcc and such, mostly copying
+-            // compiler-rt's build system already
+-            cfg.flag("-fno-builtin");
+-            cfg.flag("-fvisibility=hidden");
+-            cfg.flag("-ffreestanding");
+-            // Avoid the following warning appearing once **per file**:
+-            // clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
+-            //
+-            // Note that compiler-rt's build system also checks
+-            //
+-            // `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)`
+-            //
+-            // in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
+-            cfg.flag_if_supported("-fomit-frame-pointer");
+-            cfg.define("VISIBILITY_HIDDEN", None);
+-        }
+         let mut sources = Sources::new();
+         sources.extend(&[
+@@ -411,6 +382,48 @@
+             sources.remove(&["__aeabi_cdcmp", "__aeabi_cfcmp"]);
+         }
++        sources
++    }
++}
++
++#[cfg(feature = "c-vendor")]
++mod c_vendor {
++    extern crate cc;
++
++    use std::env;
++    use std::path::PathBuf;
++    use sources;
++
++    /// Compile intrinsics from the compiler-rt C source code
++    pub fn compile(llvm_target: &[&str]) {
++        let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
++        let cfg = &mut cc::Build::new();
++        cfg.warnings(false);
++
++        if target_env == "msvc" {
++            // Don't pull in extra libraries on MSVC
++            cfg.flag("/Zl");
++
++            // Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP
++            cfg.define("__func__", Some("__FUNCTION__"));
++        } else {
++            // Turn off various features of gcc and such, mostly copying
++            // compiler-rt's build system already
++            cfg.flag("-fno-builtin");
++            cfg.flag("-fvisibility=hidden");
++            cfg.flag("-ffreestanding");
++            // Avoid the following warning appearing once **per file**:
++            // clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
++            //
++            // Note that compiler-rt's build system also checks
++            //
++            // `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)`
++            //
++            // in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
++            cfg.flag_if_supported("-fomit-frame-pointer");
++            cfg.define("VISIBILITY_HIDDEN", None);
++        }
++
+         // When compiling the C code we require the user to tell us where the
+         // source code is, and this is largely done so when we're compiling as
+         // part of rust-lang/rust we can use the same llvm-project repository as
+@@ -423,6 +436,7 @@
+             panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
+         }
++        let sources = sources::get_sources(llvm_target);
+         let src_dir = root.join("lib/builtins");
+         for (sym, src) in sources.map.iter() {
+             let src = src_dir.join(src);
+@@ -434,3 +448,103 @@
+         cfg.compile("libcompiler-rt.a");
+     }
+ }
++
++#[cfg(feature = "c-system")]
++mod c_system {
++    use std::env;
++    use std::process::{Command, Output};
++    use std::str;
++    use std::path::Path;
++    use sources;
++
++    fn success_output(err: &str, cmd: &mut Command) -> Output {
++        let output = cmd.output().expect(err);
++        let status = output.status;
++        if !status.success() {
++            panic!("{}: {:?}", err, status.code());
++        }
++        output
++    }
++
++    // This can be obtained by adding the line:
++    //   message(STATUS "All builtin supported architectures: ${ALL_BUILTIN_SUPPORTED_ARCH}")
++    // to the bottom of compiler-rt/cmake/builtin-config-ix.cmake, then running
++    // cmake and looking at the output.
++    const ALL_SUPPORTED_ARCHES : &'static str = "i386;x86_64;arm;armhf;armv6m;armv7m;armv7em;armv7;armv7s;armv7k;aarch64;hexagon;mips;mipsel;mips64;mips64el;powerpc64;powerpc64le;riscv32;riscv64;wasm32;wasm64";
++
++    // This function recreates the logic of getArchNameForCompilerRTLib,
++    // defined in clang/lib/Driver/ToolChain.cpp.
++    fn get_arch_name_for_compiler_rtlib() -> String {
++        let target = env::var("TARGET").unwrap();
++        let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
++        let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
++        let r = match target_arch.as_str() {
++            "arm" => if target.ends_with("eabihf") && target_os != "windows" {
++                "armhf"
++            } else {
++                "arm"
++            },
++            "x86" => if target_os == "android" {
++                "i686"
++            } else {
++                "i386"
++            },
++            _ => target_arch.as_str(),
++        };
++        r.to_string()
++    }
++
++    /// Link against system clang runtime libraries
++    pub fn compile(llvm_target: &[&str]) {
++        let target = env::var("TARGET").unwrap();
++        let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
++        let compiler_rt_arch = get_arch_name_for_compiler_rtlib();
++
++        if ALL_SUPPORTED_ARCHES.split(";").find(|x| *x == compiler_rt_arch) == None {
++            return;
++        }
++
++        if let Ok(clang) = env::var("CLANG") {
++            let output = success_output(
++                "failed to find clang's compiler-rt",
++                Command::new(clang)
++                    .arg(format!("--target={}", target))
++                    .arg("--rtlib=compiler-rt")
++                    .arg("--print-libgcc-file-name"),
++            );
++            let fullpath = Path::new(str::from_utf8(&output.stdout).unwrap());
++            let libpath = fullpath.parent().unwrap().display();
++            let libname = fullpath
++                .file_stem()
++                .unwrap()
++                .to_str()
++                .unwrap()
++                .trim_start_matches("lib");
++            println!("cargo:rustc-link-search=native={}", libpath);
++            println!("cargo:rustc-link-lib=static={}", libname);
++        } else if let Ok(llvm_config) = env::var("LLVM_CONFIG") {
++            // fallback if clang is not installed
++            let (subpath, libname) = match target_os.as_str() {
++                "linux" => ("linux", format!("clang_rt.builtins-{}", &compiler_rt_arch)),
++                "macos" => ("darwin", "clang_rt.builtins_osx_dynamic".to_string()),
++                _ => panic!("unsupported target os: {}", target_os),
++            };
++            let cmd = format!("ls -1d $({} --libdir)/clang/*/lib/{}", llvm_config, subpath);
++            let output = success_output(
++                "failed to find clang's lib dir",
++                Command::new("sh").args(&["-ec", &cmd]),
++            );
++            for search_dir in str::from_utf8(&output.stdout).unwrap().lines() {
++                println!("cargo:rustc-link-search=native={}", search_dir);
++            }
++            println!("cargo:rustc-link-lib=static={}", libname);
++        } else {
++            panic!("neither CLANG nor LLVM_CONFIG could be read");
++        }
++
++        let sources = sources::get_sources(llvm_target);
++        for (sym, _src) in sources.map.iter() {
++            println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
++        }
++    }
++}
+--- a/src/bootstrap/compile.rs
++++ b/src/bootstrap/compile.rs
+@@ -213,6 +213,7 @@
+                 emscripten: false,
+             });
+             cargo.env("LLVM_CONFIG", llvm_config);
++            cargo.env("RUSTC_BUILD_SANITIZERS", "1");
+         }
+         cargo.arg("--features").arg(features)
+--- a/src/librustc_asan/build.rs
++++ b/src/librustc_asan/build.rs
+@@ -4,6 +4,9 @@
+ use cmake::Config;
+ fn main() {
++    if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
++        return;
++    }
+     if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
+         build_helper::restore_library_path();
+--- a/src/librustc_lsan/build.rs
++++ b/src/librustc_lsan/build.rs
+@@ -4,6 +4,9 @@
+ use cmake::Config;
+ fn main() {
++    if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
++        return;
++    }
+     if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
+         build_helper::restore_library_path();
+--- a/src/librustc_msan/build.rs
++++ b/src/librustc_msan/build.rs
+@@ -4,6 +4,9 @@
+ use cmake::Config;
+ fn main() {
++    if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
++        return;
++    }
+     if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
+         build_helper::restore_library_path();
+--- a/src/librustc_tsan/build.rs
++++ b/src/librustc_tsan/build.rs
+@@ -4,6 +4,9 @@
+ use cmake::Config;
+ fn main() {
++    if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
++        return;
++    }
+     if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
+         build_helper::restore_library_path();
diff --git a/patches/u-make-tests-work-without-rpath.patch b/patches/u-make-tests-work-without-rpath.patch
new file mode 100644 (file)
index 0000000..6eaf01d
--- /dev/null
@@ -0,0 +1,12 @@
+Author: Chris Coulson <chris.coulson@canonical.com>
+Forwarded: TODO
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+@@ -1,2 +1,6 @@
++include ../tools.mk
++
++RUSTC := $(RUSTC_ORIGINAL)
++
+ all:
+-      python3 test.py
++      $(HOST_RPATH_ENV) python3 test.py
diff --git a/patches/u-mips-fixes.diff b/patches/u-mips-fixes.diff
new file mode 100644 (file)
index 0000000..c80ca20
--- /dev/null
@@ -0,0 +1,19 @@
+Description: Various fixes for Rust on MIPS
+Author: Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+Bug-Debian: https://bugs.debian.org/881845
+Last-Update: 2018-10-24
+
+Index: rustc/src/librustc_codegen_llvm/llvm_util.rs
+===================================================================
+--- rustc.orig/src/librustc_codegen_llvm/llvm_util.rs
++++ rustc/src/librustc_codegen_llvm/llvm_util.rs
+@@ -68,6 +68,9 @@ unsafe fn configure_llvm(sess: &Session)
+         // during inlining. Unfortunately these may block other optimizations.
+         add("-preserve-alignment-assumptions-during-inlining=false");
++    if sess.target.target.arch == "mips" ||
++        sess.target.target.arch == "mips64" { add("-fast-isel=0"); }
++
+         for arg in &sess.opts.cg.llvm_args {
+             add(&(*arg));
+         }
diff --git a/patches/u-prefer-local-css.patch b/patches/u-prefer-local-css.patch
new file mode 100644 (file)
index 0000000..a8aa7be
--- /dev/null
@@ -0,0 +1,14 @@
+Description: Prefer local CSS to remote
+Author: Ximin Luo <infinity0@debian.org>
+Bug: https://github.com/rust-lang/rust/pull/45331
+--- a/src/bootstrap/doc.rs
++++ b/src/bootstrap/doc.rs
+@@ -411,7 +411,7 @@
+             if filename == "not_found.md" {
+                 cmd.arg("--markdown-css")
+-                   .arg("https://doc.rust-lang.org/rust.css");
++                   .arg("rust.css");
+             } else {
+                 cmd.arg("--markdown-css").arg("rust.css");
+             }
diff --git a/patches/u-reproducible-build.patch b/patches/u-reproducible-build.patch
new file mode 100644 (file)
index 0000000..4c46a94
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Don't split dwarf debug for a fully-reproducible build
+Author: Ximin Luo <infinity0@debian.org>
+Bug: https://github.com/rust-lang/rust/issues/34902
+
+--- a/src/librustc_llvm/build.rs
++++ b/src/librustc_llvm/build.rs
+@@ -140,6 +140,11 @@
+     let mut cfg = cc::Build::new();
+     cfg.warnings(false);
+     for flag in cxxflags.split_whitespace() {
++        // Split-dwarf gives unreproducible DW_AT_GNU_dwo_id so don't do it
++        if flag == "-gsplit-dwarf" {
++            continue;
++        }
++
+         // Ignore flags like `-m64` when we're doing a cross build
+         if is_crossed && flag.starts_with("-m") {
+             continue;
diff --git a/patches/u-reproducible-dl-stage0.patch b/patches/u-reproducible-dl-stage0.patch
new file mode 100644 (file)
index 0000000..db1ce50
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -88,7 +88,7 @@
+         run(["curl", option,
+              "-y", "30", "-Y", "10",    # timeout if speed is < 10 bytes/sec for > 30 seconds
+              "--connect-timeout", "30", # timeout if cannot connect within 30 seconds
+-             "--retry", "3", "-Sf", "-o", path, url],
++             "--retry", "3", "-Sf", "-o", path, "-R", url],
+             verbose=verbose,
+             exception=exception)
diff --git a/patches/u-riscv64-66899.patch b/patches/u-riscv64-66899.patch
new file mode 100644 (file)
index 0000000..f6495ed
--- /dev/null
@@ -0,0 +1,143 @@
+From b830b673e7369fc67ffa57e9a5140185315549d3 Mon Sep 17 00:00:00 2001
+From: msizanoen1 <qtmlabs@protonmail.com>
+Date: Sat, 23 Nov 2019 14:22:05 +0700
+Subject: [PATCH 1/2] Add support for RISC-V 64-bit GNU/Linux
+
+---
+ src/libpanic_unwind/gcc.rs     | 3 +++
+ src/libstd/env.rs              | 6 ++++++
+ src/libstd/os/linux/raw.rs     | 7 ++++++-
+ src/libstd/os/raw/mod.rs       | 6 ++++--
+ src/libstd/sys/unix/fs.rs      | 2 ++
+ src/libstd/sys_common/alloc.rs | 3 ++-
+ src/libunwind/libunwind.rs     | 3 +++
+ 7 files changed, 26 insertions(+), 4 deletions(-)
+
+diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs
+index e5e8e805b6e8..fc90d103ec64 100644
+--- a/src/libpanic_unwind/gcc.rs
++++ b/src/libpanic_unwind/gcc.rs
+@@ -130,6 +130,9 @@ const UNWIND_DATA_REG: (i32, i32) = (24, 25); // I0, I1
+ #[cfg(target_arch = "hexagon")]
+ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1
++#[cfg(target_arch = "riscv64")]
++const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11
++
+ // The following code is based on GCC's C and C++ personality routines.  For reference, see:
+ // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc
+ // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c
+diff --git a/src/libstd/env.rs b/src/libstd/env.rs
+index 13fe3bda525a..af35a5d9b7c4 100644
+--- a/src/libstd/env.rs
++++ b/src/libstd/env.rs
+@@ -878,6 +878,7 @@ pub mod consts {
+     /// - mips64
+     /// - powerpc
+     /// - powerpc64
++    /// - riscv64
+     /// - s390x
+     /// - sparc64
+     #[stable(feature = "env", since = "1.0.0")]
+@@ -1035,6 +1036,11 @@ mod arch {
+     pub const ARCH: &'static str = "hexagon";
+ }
++#[cfg(target_arch = "riscv64")]
++mod arch {
++    pub const ARCH: &'static str = "riscv64";
++}
++
+ #[cfg(test)]
+ mod tests {
+     use super::*;
+diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs
+index d9b2236047bd..0caec97bb7b9 100644
+--- a/src/libstd/os/linux/raw.rs
++++ b/src/libstd/os/linux/raw.rs
+@@ -230,7 +230,12 @@ mod arch {
+     }
+ }
+-#[cfg(any(target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64"))]
++#[cfg(any(
++    target_arch = "mips64",
++    target_arch = "s390x",
++    target_arch = "sparc64",
++    target_arch = "riscv64"
++))]
+ mod arch {
+     pub use libc::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
+ }
+diff --git a/src/libstd/os/raw/mod.rs b/src/libstd/os/raw/mod.rs
+index e09012007f2d..47daf0cce1b3 100644
+--- a/src/libstd/os/raw/mod.rs
++++ b/src/libstd/os/raw/mod.rs
+@@ -18,7 +18,8 @@
+             target_arch = "hexagon",
+             target_arch = "powerpc",
+             target_arch = "powerpc64",
+-            target_arch = "s390x"
++            target_arch = "s390x",
++            target_arch = "riscv64"
+         )
+     ),
+     all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
+@@ -60,7 +61,8 @@ pub type c_char = u8;
+             target_arch = "hexagon",
+             target_arch = "powerpc",
+             target_arch = "powerpc64",
+-            target_arch = "s390x"
++            target_arch = "s390x",
++            target_arch = "riscv64"
+         )
+     ),
+     all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
+diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
+index 26fb0bf10fe3..1cb6a9d37a98 100644
+--- a/src/libstd/sys/unix/fs.rs
++++ b/src/libstd/sys/unix/fs.rs
+@@ -67,6 +67,7 @@ macro_rules! cfg_has_statx {
+                 // target_arch = "mips64",
+                 // target_arch = "s390x",
+                 target_arch = "sparc64",
++                target_arch = "riscv64",
+             )))] {
+                 $($then_tt)*
+             } else {
+@@ -86,6 +87,7 @@ macro_rules! cfg_has_statx {
+             // target_arch = "mips64",
+             // target_arch = "s390x",
+             target_arch = "sparc64",
++            target_arch = "riscv64",
+         )))]
+         {
+             $($block_inner)*
+diff --git a/src/libstd/sys_common/alloc.rs b/src/libstd/sys_common/alloc.rs
+index 713b9949f646..c66941007859 100644
+--- a/src/libstd/sys_common/alloc.rs
++++ b/src/libstd/sys_common/alloc.rs
+@@ -22,7 +22,8 @@ pub const MIN_ALIGN: usize = 8;
+     target_arch = "aarch64",
+     target_arch = "mips64",
+     target_arch = "s390x",
+-    target_arch = "sparc64"
++    target_arch = "sparc64",
++    target_arch = "riscv64"
+ )))]
+ pub const MIN_ALIGN: usize = 16;
+diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs
+index c03b6bf416cb..dccaf6fd24ca 100644
+--- a/src/libunwind/libunwind.rs
++++ b/src/libunwind/libunwind.rs
+@@ -53,6 +53,9 @@ pub const unwinder_private_data_size: usize = 2;
+ #[cfg(target_arch = "sparc64")]
+ pub const unwinder_private_data_size: usize = 2;
++#[cfg(target_arch = "riscv64")]
++pub const unwinder_private_data_size: usize = 2;
++
+ #[cfg(target_os = "emscripten")]
+ pub const unwinder_private_data_size: usize = 20;
diff --git a/patches/u-riscv64-68452.patch b/patches/u-riscv64-68452.patch
new file mode 100644 (file)
index 0000000..ee816b3
--- /dev/null
@@ -0,0 +1,1344 @@
+From e5901641755dfd2e758c7e855b82ee0bcd8b29c0 Mon Sep 17 00:00:00 2001
+From: msizanoen1 <qtmlabs@protonmail.com>
+Date: Tue, 21 Jan 2020 21:52:19 +0700
+Subject: [PATCH 1/2] Implement proper C ABI lowering for RISC-V
+
+---
+ src/librustc/ty/layout.rs             |   1 +
+ src/librustc_target/abi/call/mod.rs   |  10 +-
+ src/librustc_target/abi/call/riscv.rs | 335 +++++++++++++++++++++++++-
+ 3 files changed, 331 insertions(+), 15 deletions(-)
+
+diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs
+index bda42db40b0a..c70473b667ea 100644
+--- a/src/librustc/ty/layout.rs
++++ b/src/librustc/ty/layout.rs
+@@ -2650,6 +2650,7 @@ where
+                 .map(|(i, ty)| arg_of(ty, Some(i)))
+                 .collect(),
+             c_variadic: sig.c_variadic,
++            fixed_count: inputs.len(),
+             conv,
+         };
+         fn_abi.adjust_for_abi(cx, sig.abi);
+diff --git a/src/librustc_target/abi/call/mod.rs b/src/librustc_target/abi/call/mod.rs
+index af82f9e31837..175eb93e4e55 100644
+--- a/src/librustc_target/abi/call/mod.rs
++++ b/src/librustc_target/abi/call/mod.rs
+@@ -120,6 +120,7 @@ impl Reg {
+     reg_ctor!(i16, Integer, 16);
+     reg_ctor!(i32, Integer, 32);
+     reg_ctor!(i64, Integer, 64);
++    reg_ctor!(i128, Integer, 128);
+     reg_ctor!(f32, Float, 32);
+     reg_ctor!(f64, Float, 64);
+@@ -493,6 +494,12 @@ pub struct FnAbi<'a, Ty> {
+     pub c_variadic: bool,
++    /// The count of non-variadic arguments.
++    ///
++    /// Should only be different from args.len() when c_variadic is true.
++    /// This can be used to know wether an argument is variadic or not.
++    pub fixed_count: usize,
++
+     pub conv: Conv,
+ }
+@@ -534,8 +541,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
+             "nvptx" => nvptx::compute_abi_info(self),
+             "nvptx64" => nvptx64::compute_abi_info(self),
+             "hexagon" => hexagon::compute_abi_info(self),
+-            "riscv32" => riscv::compute_abi_info(self, 32),
+-            "riscv64" => riscv::compute_abi_info(self, 64),
++            "riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
+             "wasm32" if cx.target_spec().target_os != "emscripten"
+                 => wasm32_bindgen_compat::compute_abi_info(self),
+             "wasm32" | "asmjs" => wasm32::compute_abi_info(cx, self),
+diff --git a/src/librustc_target/abi/call/riscv.rs b/src/librustc_target/abi/call/riscv.rs
+index 095e5aff7442..11d6c4d81910 100644
+--- a/src/librustc_target/abi/call/riscv.rs
++++ b/src/librustc_target/abi/call/riscv.rs
+@@ -1,49 +1,358 @@
+ // Reference: RISC-V ELF psABI specification
+ // https://github.com/riscv/riscv-elf-psabi-doc
++//
++// Reference: Clang RISC-V ELF psABI lowering code
++// https://github.com/llvm/llvm-project/blob/8e780252a7284be45cf1ba224cabd884847e8e92/clang/lib/CodeGen/TargetInfo.cpp#L9311-L9773
+-use crate::abi::call::{ArgAbi, FnAbi};
++use crate::abi::call::{ArgAbi, ArgAttribute, CastTarget, FnAbi, PassMode, Reg, RegKind, Uniform};
++use crate::abi::{
++    self, Abi, FieldPlacement, HasDataLayout, LayoutOf, Size, TyLayout, TyLayoutMethods,
++};
++use crate::spec::HasTargetSpec;
++
++#[derive(Copy, Clone)]
++enum RegPassKind {
++    Float(Reg),
++    Integer(Reg),
++    Unknown,
++}
++
++#[derive(Copy, Clone)]
++enum FloatConv {
++    FloatPair(Reg, Reg),
++    Float(Reg),
++    MixedPair(Reg, Reg),
++}
++
++#[derive(Copy, Clone)]
++struct CannotUseFpConv;
++
++fn is_riscv_aggregate<'a, Ty>(arg: &ArgAbi<'a, Ty>) -> bool {
++    match arg.layout.abi {
++        Abi::Vector { .. } => true,
++        _ => arg.layout.is_aggregate(),
++    }
++}
++
++fn should_use_fp_conv_helper<'a, Ty, C>(
++    cx: &C,
++    arg_layout: &TyLayout<'a, Ty>,
++    xlen: u64,
++    flen: u64,
++    field1_kind: &mut RegPassKind,
++    field2_kind: &mut RegPassKind,
++) -> Result<(), CannotUseFpConv>
++where
++    Ty: TyLayoutMethods<'a, C> + Copy,
++    C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>>,
++{
++    match arg_layout.abi {
++        Abi::Scalar(ref scalar) => match scalar.value {
++            abi::Int(..) | abi::Pointer => {
++                if arg_layout.size.bits() > xlen {
++                    return Err(CannotUseFpConv);
++                }
++                match (*field1_kind, *field2_kind) {
++                    (RegPassKind::Unknown, _) => {
++                        *field1_kind = RegPassKind::Integer(Reg {
++                            kind: RegKind::Integer,
++                            size: arg_layout.size,
++                        });
++                    }
++                    (RegPassKind::Float(_), RegPassKind::Unknown) => {
++                        *field2_kind = RegPassKind::Integer(Reg {
++                            kind: RegKind::Integer,
++                            size: arg_layout.size,
++                        });
++                    }
++                    _ => return Err(CannotUseFpConv),
++                }
++            }
++            abi::F32 | abi::F64 => {
++                if arg_layout.size.bits() > flen {
++                    return Err(CannotUseFpConv);
++                }
++                match (*field1_kind, *field2_kind) {
++                    (RegPassKind::Unknown, _) => {
++                        *field1_kind =
++                            RegPassKind::Float(Reg { kind: RegKind::Float, size: arg_layout.size });
++                    }
++                    (_, RegPassKind::Unknown) => {
++                        *field2_kind =
++                            RegPassKind::Float(Reg { kind: RegKind::Float, size: arg_layout.size });
++                    }
++                    _ => return Err(CannotUseFpConv),
++                }
++            }
++        },
++        Abi::Vector { .. } | Abi::Uninhabited => return Err(CannotUseFpConv),
++        Abi::ScalarPair(..) | Abi::Aggregate { .. } => match arg_layout.fields {
++            FieldPlacement::Union(_) => {
++                if !arg_layout.is_zst() {
++                    return Err(CannotUseFpConv);
++                }
++            }
++            FieldPlacement::Array { count, .. } => {
++                for _ in 0..count {
++                    let elem_layout = arg_layout.field(cx, 0);
++                    should_use_fp_conv_helper(
++                        cx,
++                        &elem_layout,
++                        xlen,
++                        flen,
++                        field1_kind,
++                        field2_kind,
++                    )?;
++                }
++            }
++            FieldPlacement::Arbitrary { .. } => {
++                match arg_layout.variants {
++                    abi::Variants::Multiple { .. } => return Err(CannotUseFpConv),
++                    abi::Variants::Single { .. } => (),
++                }
++                for i in arg_layout.fields.index_by_increasing_offset() {
++                    let field = arg_layout.field(cx, i);
++                    should_use_fp_conv_helper(cx, &field, xlen, flen, field1_kind, field2_kind)?;
++                }
++            }
++        },
++    }
++    Ok(())
++}
++
++fn should_use_fp_conv<'a, Ty, C>(
++    cx: &C,
++    arg: &TyLayout<'a, Ty>,
++    xlen: u64,
++    flen: u64,
++) -> Option<FloatConv>
++where
++    Ty: TyLayoutMethods<'a, C> + Copy,
++    C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>>,
++{
++    let mut field1_kind = RegPassKind::Unknown;
++    let mut field2_kind = RegPassKind::Unknown;
++    if should_use_fp_conv_helper(cx, arg, xlen, flen, &mut field1_kind, &mut field2_kind).is_err() {
++        return None;
++    }
++    match (field1_kind, field2_kind) {
++        (RegPassKind::Integer(l), RegPassKind::Float(r)) => Some(FloatConv::MixedPair(l, r)),
++        (RegPassKind::Float(l), RegPassKind::Integer(r)) => Some(FloatConv::MixedPair(l, r)),
++        (RegPassKind::Float(l), RegPassKind::Float(r)) => Some(FloatConv::FloatPair(l, r)),
++        (RegPassKind::Float(f), RegPassKind::Unknown) => Some(FloatConv::Float(f)),
++        _ => None,
++    }
++}
++
++fn classify_ret<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, xlen: u64, flen: u64) -> bool
++where
++    Ty: TyLayoutMethods<'a, C> + Copy,
++    C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>>,
++{
++    if let Some(conv) = should_use_fp_conv(cx, &arg.layout, xlen, flen) {
++        match conv {
++            FloatConv::Float(f) => {
++                arg.cast_to(f);
++            }
++            FloatConv::FloatPair(l, r) => {
++                arg.cast_to(CastTarget::pair(l, r));
++            }
++            FloatConv::MixedPair(l, r) => {
++                arg.cast_to(CastTarget::pair(l, r));
++            }
++        }
++        return false;
++    }
++
++    let total = arg.layout.size;
+-fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
+     // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
+     // the argument list with the address."
+     // "Aggregates larger than 2✕XLEN bits are passed by reference and are
+     // replaced in the argument list with the address, as are C++ aggregates
+     // with nontrivial copy constructors, destructors, or vtables."
+-    if arg.layout.size.bits() > 2 * xlen {
+-        arg.make_indirect();
++    if total.bits() > 2 * xlen {
++        // We rely on the LLVM backend lowering code to lower passing a scalar larger than 2*XLEN.
++        if is_riscv_aggregate(arg) {
++            arg.make_indirect();
++        }
++        return true;
++    }
++
++    let xlen_reg = match xlen {
++        32 => Reg::i32(),
++        64 => Reg::i64(),
++        _ => unreachable!("Unsupported XLEN: {}", xlen),
++    };
++    if is_riscv_aggregate(arg) {
++        if total.bits() <= xlen {
++            arg.cast_to(xlen_reg);
++        } else {
++            arg.cast_to(Uniform { unit: xlen_reg, total: Size::from_bits(xlen * 2) });
++        }
++        return false;
+     }
+     // "When passed in registers, scalars narrower than XLEN bits are widened
+     // according to the sign of their type up to 32 bits, then sign-extended to
+     // XLEN bits."
+-    arg.extend_integer_width_to(xlen); // this method only affects integer scalars
++    extend_integer_width(arg, xlen);
++    false
+ }
+-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
++fn classify_arg<'a, Ty, C>(
++    cx: &C,
++    arg: &mut ArgAbi<'a, Ty>,
++    xlen: u64,
++    flen: u64,
++    is_vararg: bool,
++    avail_gprs: &mut u64,
++    avail_fprs: &mut u64,
++) where
++    Ty: TyLayoutMethods<'a, C> + Copy,
++    C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>>,
++{
++    if !is_vararg {
++        match should_use_fp_conv(cx, &arg.layout, xlen, flen) {
++            Some(FloatConv::Float(f)) if *avail_fprs >= 1 => {
++                *avail_fprs -= 1;
++                arg.cast_to(f);
++                return;
++            }
++            Some(FloatConv::FloatPair(l, r)) if *avail_fprs >= 2 => {
++                *avail_fprs -= 2;
++                arg.cast_to(CastTarget::pair(l, r));
++                return;
++            }
++            Some(FloatConv::MixedPair(l, r)) if *avail_fprs >= 1 && *avail_gprs >= 1 => {
++                *avail_gprs -= 1;
++                *avail_fprs -= 1;
++                arg.cast_to(CastTarget::pair(l, r));
++                return;
++            }
++            _ => (),
++        }
++    }
++
++    let total = arg.layout.size;
++    let align = arg.layout.align.abi.bits();
++
+     // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
+     // the argument list with the address."
+     // "Aggregates larger than 2✕XLEN bits are passed by reference and are
+     // replaced in the argument list with the address, as are C++ aggregates
+     // with nontrivial copy constructors, destructors, or vtables."
+-    if arg.layout.size.bits() > 2 * xlen {
+-        arg.make_indirect();
++    if total.bits() > 2 * xlen {
++        // We rely on the LLVM backend lowering code to lower passing a scalar larger than 2*XLEN.
++        if is_riscv_aggregate(arg) {
++            arg.make_indirect();
++        }
++        if *avail_gprs >= 1 {
++            *avail_gprs -= 1;
++        }
++        return;
++    }
++
++    let double_xlen_reg = match xlen {
++        32 => Reg::i64(),
++        64 => Reg::i128(),
++        _ => unreachable!("Unsupported XLEN: {}", xlen),
++    };
++
++    let xlen_reg = match xlen {
++        32 => Reg::i32(),
++        64 => Reg::i64(),
++        _ => unreachable!("Unsupported XLEN: {}", xlen),
++    };
++
++    if total.bits() > xlen {
++        let align_regs = align > xlen;
++        if is_riscv_aggregate(arg) {
++            arg.cast_to(Uniform {
++                unit: if align_regs { double_xlen_reg } else { xlen_reg },
++                total: Size::from_bits(xlen * 2),
++            });
++        }
++        if align_regs && is_vararg {
++            *avail_gprs -= *avail_gprs % 2;
++        }
++        if *avail_gprs >= 2 {
++            *avail_gprs -= 2;
++        } else {
++            *avail_gprs = 0;
++        }
++        return;
++    } else if is_riscv_aggregate(arg) {
++        arg.cast_to(xlen_reg);
++        if *avail_gprs >= 1 {
++            *avail_gprs -= 1;
++        }
++        return;
+     }
+     // "When passed in registers, scalars narrower than XLEN bits are widened
+     // according to the sign of their type up to 32 bits, then sign-extended to
+     // XLEN bits."
+-    arg.extend_integer_width_to(xlen); // this method only affects integer scalars
++    if *avail_gprs >= 1 {
++        extend_integer_width(arg, xlen);
++        *avail_gprs -= 1;
++    }
+ }
+-pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>, xlen: u64) {
++fn extend_integer_width<'a, Ty>(arg: &mut ArgAbi<'a, Ty>, xlen: u64) {
++    match arg.layout.abi {
++        Abi::Scalar(ref scalar) => {
++            match scalar.value {
++                abi::Int(i, _) => {
++                    // 32-bit integers are always sign-extended
++                    if i.size().bits() == 32 && xlen > 32 {
++                        if let PassMode::Direct(ref mut attrs) = arg.mode {
++                            attrs.set(ArgAttribute::SExt);
++                            return;
++                        }
++                    }
++                }
++                _ => (),
++            }
++        }
++        _ => (),
++    }
++    arg.extend_integer_width_to(xlen);
++}
++
++pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
++where
++    Ty: TyLayoutMethods<'a, C> + Copy,
++    C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
++{
++    let flen = match &cx.target_spec().options.llvm_abiname[..] {
++        "ilp32f" | "lp64f" => 32,
++        "ilp32d" | "lp64d" => 64,
++        _ => 0,
++    };
++    let xlen = cx.data_layout().pointer_size.bits();
++
++    let mut avail_gprs = 8;
++    let mut avail_fprs = 8;
++
+     if !fn_abi.ret.is_ignore() {
+-        classify_ret(&mut fn_abi.ret, xlen);
++        if classify_ret(cx, &mut fn_abi.ret, xlen, flen) {
++            avail_gprs -= 1;
++        }
+     }
+-    for arg in &mut fn_abi.args {
++    for (i, arg) in fn_abi.args.iter_mut().enumerate() {
+         if arg.is_ignore() {
+             continue;
+         }
+-        classify_arg(arg, xlen);
++        classify_arg(
++            cx,
++            arg,
++            xlen,
++            flen,
++            i >= fn_abi.fixed_count,
++            &mut avail_gprs,
++            &mut avail_fprs,
++        );
+     }
+ }
+
+From 39633874ae7d0150669004a80740ff3b0708d08d Mon Sep 17 00:00:00 2001
+From: msizanoen1 <qtmlabs@protonmail.com>
+Date: Mon, 3 Feb 2020 22:04:44 +0700
+Subject: [PATCH 2/2] Add tests for RISC-V C ABI
+
+---
+ src/test/auxiliary/rust_test_helpers.c        |  29 ++
+ .../riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs | 181 +++++++++++
+ .../codegen/riscv-abi/riscv64-lp64d-abi.rs    | 293 ++++++++++++++++++
+ .../riscv-abi/riscv64-lp64f-lp64d-abi.rs      | 277 +++++++++++++++++
+ src/test/ui/abi/struct-enums/struct-return.rs |  52 +++-
+ 5 files changed, 831 insertions(+), 1 deletion(-)
+ create mode 100644 src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+ create mode 100644 src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs
+ create mode 100644 src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
+
+diff --git a/src/test/auxiliary/rust_test_helpers.c b/src/test/auxiliary/rust_test_helpers.c
+index b95b0ca1a89c..22bb54988365 100644
+--- a/src/test/auxiliary/rust_test_helpers.c
++++ b/src/test/auxiliary/rust_test_helpers.c
+@@ -168,6 +168,18 @@ struct floats {
+     double c;
+ };
++struct char_char_double {
++    uint8_t a;
++    uint8_t b;
++    double c;
++};
++
++struct char_char_float {
++    uint8_t a;
++    uint8_t b;
++    float c;
++};
++
+ struct quad
+ rust_dbg_abi_1(struct quad q) {
+     struct quad qq = { q.c + 1,
+@@ -185,6 +197,23 @@ rust_dbg_abi_2(struct floats f) {
+     return ff;
+ }
++struct char_char_double
++rust_dbg_abi_3(struct char_char_double a) {
++    struct char_char_double ccd = { a.a + 1,
++                                    a.b - 1,
++                                    a.c + 1.0 };
++    return ccd;
++}
++
++struct char_char_float
++rust_dbg_abi_4(struct char_char_float a) {
++    struct char_char_float ccd = { a.a + 1,
++                                   a.b - 1,
++                                   a.c + 1.0 };
++    return ccd;
++}
++
++
+ int
+ rust_dbg_static_mut = 3;
+diff --git a/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+new file mode 100644
+index 000000000000..f0f052fe5c55
+--- /dev/null
++++ b/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+@@ -0,0 +1,181 @@
++// ignore-tidy-linelength
++// compile-flags: -C no-prepopulate-passes
++// only-riscv64
++// only-linux
++#![crate_type = "lib"]
++#![allow(improper_ctypes)]
++
++// CHECK: define void @f_void()
++#[no_mangle]
++pub extern "C" fn f_void() {}
++
++// CHECK: define zeroext i1 @f_scalar_0(i1 zeroext %a)
++#[no_mangle]
++pub extern "C" fn f_scalar_0(a: bool) -> bool {
++    a
++}
++
++// CHECK: define signext i8 @f_scalar_1(i8 signext %x)
++#[no_mangle]
++pub extern "C" fn f_scalar_1(x: i8) -> i8 {
++    x
++}
++
++// CHECK: define zeroext i8 @f_scalar_2(i8 zeroext %x)
++#[no_mangle]
++pub extern "C" fn f_scalar_2(x: u8) -> u8 {
++    x
++}
++
++// CHECK: define signext i32 @f_scalar_3(i32 signext %x)
++#[no_mangle]
++pub extern "C" fn f_scalar_3(x: i32) -> u32 {
++    x as u32
++}
++
++// CHECK: define i64 @f_scalar_4(i64 %x)
++#[no_mangle]
++pub extern "C" fn f_scalar_4(x: i64) -> i64 {
++    x
++}
++
++// CHECK: define float @f_fp_scalar_1(float)
++#[no_mangle]
++pub extern "C" fn f_fp_scalar_1(x: f32) -> f32 {
++    x
++}
++// CHECK: define double @f_fp_scalar_2(double)
++#[no_mangle]
++pub extern "C" fn f_fp_scalar_2(x: f64) -> f64 {
++    x
++}
++
++#[repr(C)]
++pub struct Empty {}
++
++// CHECK: define void @f_agg_empty_struct()
++#[no_mangle]
++pub extern "C" fn f_agg_empty_struct(e: Empty) -> Empty {
++    e
++}
++
++#[repr(C)]
++pub struct Tiny {
++    a: u16,
++    b: u16,
++    c: u16,
++    d: u16,
++}
++
++// CHECK: define void @f_agg_tiny(i64)
++#[no_mangle]
++pub extern "C" fn f_agg_tiny(mut e: Tiny) {
++    e.a += e.b;
++    e.c += e.d;
++}
++
++// CHECK: define i64 @f_agg_tiny_ret()
++#[no_mangle]
++pub extern "C" fn f_agg_tiny_ret() -> Tiny {
++    Tiny { a: 1, b: 2, c: 3, d: 4 }
++}
++
++#[repr(C)]
++pub struct Small {
++    a: i64,
++    b: *mut i64,
++}
++
++// CHECK: define void @f_agg_small([2 x i64])
++#[no_mangle]
++pub extern "C" fn f_agg_small(mut x: Small) {
++    x.a += unsafe { *x.b };
++    x.b = &mut x.a;
++}
++
++// CHECK: define [2 x i64] @f_agg_small_ret()
++#[no_mangle]
++pub extern "C" fn f_agg_small_ret() -> Small {
++    Small { a: 1, b: core::ptr::null_mut() }
++}
++
++#[repr(C)]
++pub struct SmallAligned {
++    a: i128,
++}
++
++// CHECK: define void @f_agg_small_aligned(i128)
++#[no_mangle]
++pub extern "C" fn f_agg_small_aligned(mut x: SmallAligned) {
++    x.a += x.a;
++}
++
++#[repr(C)]
++pub struct Large {
++    a: i64,
++    b: i64,
++    c: i64,
++    d: i64,
++}
++
++// CHECK: define void @f_agg_large(%Large* {{.*}}%x)
++#[no_mangle]
++pub extern "C" fn f_agg_large(mut x: Large) {
++    x.a = x.b + x.c + x.d;
++}
++
++// CHECK: define void @f_agg_large_ret(%Large* {{.*}}sret{{.*}}, i32 signext %i, i8 signext %j)
++#[no_mangle]
++pub extern "C" fn f_agg_large_ret(i: i32, j: i8) -> Large {
++    Large { a: 1, b: 2, c: 3, d: 4 }
++}
++
++// CHECK: define void @f_scalar_stack_1(i64, [2 x i64], i128, %Large* {{.*}}%d, i8 zeroext %e, i8 signext %f, i8 %g, i8 %h)
++#[no_mangle]
++pub extern "C" fn f_scalar_stack_1(
++    a: Tiny,
++    b: Small,
++    c: SmallAligned,
++    d: Large,
++    e: u8,
++    f: i8,
++    g: u8,
++    h: i8,
++) {
++}
++
++// CHECK: define void @f_scalar_stack_2(%Large* {{.*}}sret{{.*}}, i64 %a, i128, i128, i64 %d, i8 zeroext %e, i8 %f, i8 %g)
++#[no_mangle]
++pub extern "C" fn f_scalar_stack_2(
++    a: u64,
++    b: SmallAligned,
++    c: SmallAligned,
++    d: u64,
++    e: u8,
++    f: i8,
++    g: u8,
++) -> Large {
++    Large { a: a as i64, b: e as i64, c: f as i64, d: g as i64 }
++}
++
++extern "C" {
++    fn f_va_callee(_: i32, ...) -> i32;
++}
++
++#[no_mangle]
++pub unsafe extern "C" fn f_va_caller() {
++    // CHECK: call signext i32 (i32, ...) @f_va_callee(i32 signext 1, i32 signext 2, i64 3, double {{.*}}, double {{.*}}, i64 {{.*}}, [2 x i64] {{.*}}, i128 {{.*}}, %Large* {{.*}})
++    f_va_callee(
++        1,
++        2i32,
++        3i64,
++        4.0f64,
++        5.0f64,
++        Tiny { a: 1, b: 2, c: 3, d: 4 },
++        Small { a: 10, b: core::ptr::null_mut() },
++        SmallAligned { a: 11 },
++        Large { a: 12, b: 13, c: 14, d: 15 },
++    );
++    // CHECK: call signext i32 (i32, ...) @f_va_callee(i32 signext 1, i32 signext 2, i32 signext 3, i32 signext 4, i128 {{.*}}, i32 signext 6, i32 signext 7, i32 8, i32 9)
++    f_va_callee(1, 2i32, 3i32, 4i32, SmallAligned { a: 5 }, 6i32, 7i32, 8i32, 9i32);
++}
+diff --git a/src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs b/src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs
+new file mode 100644
+index 000000000000..66a3b9e4952a
+--- /dev/null
++++ b/src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs
+@@ -0,0 +1,293 @@
++// ignore-tidy-linelength
++// compile-flags: -C no-prepopulate-passes
++// only-riscv64
++// only-linux
++#![crate_type = "lib"]
++
++// CHECK: define void @f_fpr_tracking(double, double, double, double, double, double, double, double, i8 zeroext %i)
++#[no_mangle]
++pub extern "C" fn f_fpr_tracking(
++    a: f64,
++    b: f64,
++    c: f64,
++    d: f64,
++    e: f64,
++    f: f64,
++    g: f64,
++    h: f64,
++    i: u8,
++) {
++}
++
++#[repr(C)]
++pub struct Double {
++    f: f64,
++}
++
++#[repr(C)]
++pub struct DoubleDouble {
++    f: f64,
++    g: f64,
++}
++
++#[repr(C)]
++pub struct DoubleFloat {
++    f: f64,
++    g: f32,
++}
++
++// CHECK: define void @f_double_s_arg(double)
++#[no_mangle]
++pub extern "C" fn f_double_s_arg(a: Double) {}
++
++// CHECK: define double @f_ret_double_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_s() -> Double {
++    Double { f: 1. }
++}
++
++// CHECK: define void @f_double_double_s_arg({ double, double })
++#[no_mangle]
++pub extern "C" fn f_double_double_s_arg(a: DoubleDouble) {}
++
++// CHECK: define { double, double } @f_ret_double_double_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_double_s() -> DoubleDouble {
++    DoubleDouble { f: 1., g: 2. }
++}
++
++// CHECK: define void @f_double_float_s_arg({ double, float })
++#[no_mangle]
++pub extern "C" fn f_double_float_s_arg(a: DoubleFloat) {}
++
++// CHECK: define { double, float } @f_ret_double_float_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_float_s() -> DoubleFloat {
++    DoubleFloat { f: 1., g: 2. }
++}
++
++// CHECK: define void @f_double_double_s_arg_insufficient_fprs(double, double, double, double, double, double, double, [2 x i64])
++#[no_mangle]
++pub extern "C" fn f_double_double_s_arg_insufficient_fprs(
++    a: f64,
++    b: f64,
++    c: f64,
++    d: f64,
++    e: f64,
++    f: f64,
++    g: f64,
++    h: DoubleDouble,
++) {
++}
++
++#[repr(C)]
++pub struct DoubleInt8 {
++    f: f64,
++    i: i8,
++}
++
++#[repr(C)]
++pub struct DoubleUInt8 {
++    f: f64,
++    i: u8,
++}
++
++#[repr(C)]
++pub struct DoubleInt32 {
++    f: f64,
++    i: i32,
++}
++
++#[repr(C)]
++pub struct DoubleInt64 {
++    f: f64,
++    i: i64,
++}
++
++// CHECK: define void @f_double_int8_s_arg({ double, i8 })
++#[no_mangle]
++pub extern "C" fn f_double_int8_s_arg(a: DoubleInt8) {}
++
++// CHECK: define { double, i8 } @f_ret_double_int8_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_int8_s() -> DoubleInt8 {
++    DoubleInt8 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_double_int32_s_arg({ double, i32 })
++#[no_mangle]
++pub extern "C" fn f_double_int32_s_arg(a: DoubleInt32) {}
++
++// CHECK: define { double, i32 } @f_ret_double_int32_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_int32_s() -> DoubleInt32 {
++    DoubleInt32 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_double_uint8_s_arg({ double, i8 })
++#[no_mangle]
++pub extern "C" fn f_double_uint8_s_arg(a: DoubleUInt8) {}
++
++// CHECK: define { double, i8 } @f_ret_double_uint8_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_uint8_s() -> DoubleUInt8 {
++    DoubleUInt8 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_double_int64_s_arg({ double, i64 })
++#[no_mangle]
++pub extern "C" fn f_double_int64_s_arg(a: DoubleInt64) {}
++
++// CHECK: define { double, i64 } @f_ret_double_int64_s()
++#[no_mangle]
++pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
++    DoubleInt64 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, [2 x i64])
++#[no_mangle]
++pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
++    a: i32,
++    b: i32,
++    c: i32,
++    d: i32,
++    e: i32,
++    f: i32,
++    g: i32,
++    h: i32,
++    i: DoubleInt8,
++) {
++}
++
++// CHECK: define void @f_struct_double_int8_insufficient_fprs(float, double, double, double, double, double, double, double, [2 x i64])
++#[no_mangle]
++pub extern "C" fn f_struct_double_int8_insufficient_fprs(
++    a: f32,
++    b: f64,
++    c: f64,
++    d: f64,
++    e: f64,
++    f: f64,
++    g: f64,
++    h: f64,
++    i: DoubleInt8,
++) {
++}
++
++#[repr(C)]
++pub struct DoubleArr1 {
++    a: [f64; 1],
++}
++
++// CHECK: define void @f_doublearr1_s_arg(double)
++#[no_mangle]
++pub extern "C" fn f_doublearr1_s_arg(a: DoubleArr1) {}
++
++// CHECK: define double @f_ret_doublearr1_s()
++#[no_mangle]
++pub extern "C" fn f_ret_doublearr1_s() -> DoubleArr1 {
++    DoubleArr1 { a: [1.] }
++}
++
++#[repr(C)]
++pub struct DoubleArr2 {
++    a: [f64; 2],
++}
++
++// CHECK: define void @f_doublearr2_s_arg({ double, double })
++#[no_mangle]
++pub extern "C" fn f_doublearr2_s_arg(a: DoubleArr2) {}
++
++// CHECK: define { double, double } @f_ret_doublearr2_s()
++#[no_mangle]
++pub extern "C" fn f_ret_doublearr2_s() -> DoubleArr2 {
++    DoubleArr2 { a: [1., 2.] }
++}
++
++#[repr(C)]
++pub struct Tricky1 {
++    f: [f64; 1],
++}
++
++#[repr(C)]
++pub struct DoubleArr2Tricky1 {
++    g: [Tricky1; 2],
++}
++
++// CHECK: define void @f_doublearr2_tricky1_s_arg({ double, double })
++#[no_mangle]
++pub extern "C" fn f_doublearr2_tricky1_s_arg(a: DoubleArr2Tricky1) {}
++
++// CHECK: define { double, double } @f_ret_doublearr2_tricky1_s()
++#[no_mangle]
++pub extern "C" fn f_ret_doublearr2_tricky1_s() -> DoubleArr2Tricky1 {
++    DoubleArr2Tricky1 { g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
++}
++
++#[repr(C)]
++pub struct EmptyStruct {}
++
++#[repr(C)]
++pub struct DoubleArr2Tricky2 {
++    s: EmptyStruct,
++    g: [Tricky1; 2],
++}
++
++// CHECK: define void @f_doublearr2_tricky2_s_arg({ double, double })
++#[no_mangle]
++pub extern "C" fn f_doublearr2_tricky2_s_arg(a: DoubleArr2Tricky2) {}
++
++// CHECK: define { double, double } @f_ret_doublearr2_tricky2_s()
++#[no_mangle]
++pub extern "C" fn f_ret_doublearr2_tricky2_s() -> DoubleArr2Tricky2 {
++    DoubleArr2Tricky2 { s: EmptyStruct {}, g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
++}
++
++#[repr(C)]
++pub struct IntDoubleInt {
++    a: i32,
++    b: f64,
++    c: i32,
++}
++
++// CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
++#[no_mangle]
++pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}
++
++// CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
++#[no_mangle]
++pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
++    IntDoubleInt { a: 1, b: 2., c: 3 }
++}
++
++#[repr(C)]
++pub struct CharCharDouble {
++    a: u8,
++    b: u8,
++    c: f64,
++}
++
++// CHECK: define void @f_char_char_double_s_arg([2 x i64])
++#[no_mangle]
++pub extern "C" fn f_char_char_double_s_arg(a: CharCharDouble) {}
++
++// CHECK: define [2 x i64] @f_ret_char_char_double_s()
++#[no_mangle]
++pub extern "C" fn f_ret_char_char_double_s() -> CharCharDouble {
++    CharCharDouble { a: 1, b: 2, c: 3. }
++}
++
++#[repr(C)]
++pub union DoubleU {
++    a: f64,
++}
++
++// CHECK: define void @f_double_u_arg(i64)
++#[no_mangle]
++pub extern "C" fn f_double_u_arg(a: DoubleU) {}
++
++// CHECK: define i64 @f_ret_double_u()
++#[no_mangle]
++pub extern "C" fn f_ret_double_u() -> DoubleU {
++    unsafe { DoubleU { a: 1. } }
++}
+diff --git a/src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs b/src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
+new file mode 100644
+index 000000000000..d843331f425d
+--- /dev/null
++++ b/src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
+@@ -0,0 +1,277 @@
++// ignore-tidy-linelength
++// compile-flags: -C no-prepopulate-passes
++// only-riscv64
++// only-linux
++#![crate_type = "lib"]
++
++// CHECK: define void @f_fpr_tracking(float, float, float, float, float, float, float, float, i8 zeroext %i)
++#[no_mangle]
++pub extern "C" fn f_fpr_tracking(
++    a: f32,
++    b: f32,
++    c: f32,
++    d: f32,
++    e: f32,
++    f: f32,
++    g: f32,
++    h: f32,
++    i: u8,
++) {
++}
++
++#[repr(C)]
++pub struct Float {
++    f: f32,
++}
++
++#[repr(C)]
++pub struct FloatFloat {
++    f: f32,
++    g: f32,
++}
++
++// CHECK: define void @f_float_s_arg(float)
++#[no_mangle]
++pub extern "C" fn f_float_s_arg(a: Float) {}
++
++// CHECK: define float @f_ret_float_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_s() -> Float {
++    Float { f: 1. }
++}
++
++// CHECK: define void @f_float_float_s_arg({ float, float })
++#[no_mangle]
++pub extern "C" fn f_float_float_s_arg(a: FloatFloat) {}
++
++// CHECK: define { float, float } @f_ret_float_float_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_float_s() -> FloatFloat {
++    FloatFloat { f: 1., g: 2. }
++}
++
++// CHECK: define void @f_float_float_s_arg_insufficient_fprs(float, float, float, float, float, float, float, i64)
++#[no_mangle]
++pub extern "C" fn f_float_float_s_arg_insufficient_fprs(
++    a: f32,
++    b: f32,
++    c: f32,
++    d: f32,
++    e: f32,
++    f: f32,
++    g: f32,
++    h: FloatFloat,
++) {
++}
++
++#[repr(C)]
++pub struct FloatInt8 {
++    f: f32,
++    i: i8,
++}
++
++#[repr(C)]
++pub struct FloatUInt8 {
++    f: f32,
++    i: u8,
++}
++
++#[repr(C)]
++pub struct FloatInt32 {
++    f: f32,
++    i: i32,
++}
++
++#[repr(C)]
++pub struct FloatInt64 {
++    f: f32,
++    i: i64,
++}
++
++// CHECK: define void @f_float_int8_s_arg({ float, i8 })
++#[no_mangle]
++pub extern "C" fn f_float_int8_s_arg(a: FloatInt8) {}
++
++// CHECK: define { float, i8 } @f_ret_float_int8_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_int8_s() -> FloatInt8 {
++    FloatInt8 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_float_int32_s_arg({ float, i32 })
++#[no_mangle]
++pub extern "C" fn f_float_int32_s_arg(a: FloatInt32) {}
++
++// CHECK: define { float, i32 } @f_ret_float_int32_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_int32_s() -> FloatInt32 {
++    FloatInt32 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_float_uint8_s_arg({ float, i8 })
++#[no_mangle]
++pub extern "C" fn f_float_uint8_s_arg(a: FloatUInt8) {}
++
++// CHECK: define { float, i8 } @f_ret_float_uint8_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_uint8_s() -> FloatUInt8 {
++    FloatUInt8 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_float_int64_s_arg({ float, i64 })
++#[no_mangle]
++pub extern "C" fn f_float_int64_s_arg(a: FloatInt64) {}
++
++// CHECK: define { float, i64 } @f_ret_float_int64_s()
++#[no_mangle]
++pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
++    FloatInt64 { f: 1., i: 2 }
++}
++
++// CHECK: define void @f_float_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, i64)
++#[no_mangle]
++pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
++    a: i32,
++    b: i32,
++    c: i32,
++    d: i32,
++    e: i32,
++    f: i32,
++    g: i32,
++    h: i32,
++    i: FloatInt8,
++) {
++}
++
++// CHECK: define void @f_struct_float_int8_insufficient_fprs(float, float, float, float, float, float, float, float, i64)
++#[no_mangle]
++pub extern "C" fn f_struct_float_int8_insufficient_fprs(
++    a: f32,
++    b: f32,
++    c: f32,
++    d: f32,
++    e: f32,
++    f: f32,
++    g: f32,
++    h: f32,
++    i: FloatInt8,
++) {
++}
++
++#[repr(C)]
++pub struct FloatArr1 {
++    a: [f32; 1],
++}
++
++// CHECK: define void @f_floatarr1_s_arg(float)
++#[no_mangle]
++pub extern "C" fn f_floatarr1_s_arg(a: FloatArr1) {}
++
++// CHECK: define float @f_ret_floatarr1_s()
++#[no_mangle]
++pub extern "C" fn f_ret_floatarr1_s() -> FloatArr1 {
++    FloatArr1 { a: [1.] }
++}
++
++#[repr(C)]
++pub struct FloatArr2 {
++    a: [f32; 2],
++}
++
++// CHECK: define void @f_floatarr2_s_arg({ float, float })
++#[no_mangle]
++pub extern "C" fn f_floatarr2_s_arg(a: FloatArr2) {}
++
++// CHECK: define { float, float } @f_ret_floatarr2_s()
++#[no_mangle]
++pub extern "C" fn f_ret_floatarr2_s() -> FloatArr2 {
++    FloatArr2 { a: [1., 2.] }
++}
++
++#[repr(C)]
++pub struct Tricky1 {
++    f: [f32; 1],
++}
++
++#[repr(C)]
++pub struct FloatArr2Tricky1 {
++    g: [Tricky1; 2],
++}
++
++// CHECK: define void @f_floatarr2_tricky1_s_arg({ float, float })
++#[no_mangle]
++pub extern "C" fn f_floatarr2_tricky1_s_arg(a: FloatArr2Tricky1) {}
++
++// CHECK: define { float, float } @f_ret_floatarr2_tricky1_s()
++#[no_mangle]
++pub extern "C" fn f_ret_floatarr2_tricky1_s() -> FloatArr2Tricky1 {
++    FloatArr2Tricky1 { g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
++}
++
++#[repr(C)]
++pub struct EmptyStruct {}
++
++#[repr(C)]
++pub struct FloatArr2Tricky2 {
++    s: EmptyStruct,
++    g: [Tricky1; 2],
++}
++
++// CHECK: define void @f_floatarr2_tricky2_s_arg({ float, float })
++#[no_mangle]
++pub extern "C" fn f_floatarr2_tricky2_s_arg(a: FloatArr2Tricky2) {}
++
++// CHECK: define { float, float } @f_ret_floatarr2_tricky2_s()
++#[no_mangle]
++pub extern "C" fn f_ret_floatarr2_tricky2_s() -> FloatArr2Tricky2 {
++    FloatArr2Tricky2 { s: EmptyStruct {}, g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
++}
++
++#[repr(C)]
++pub struct IntFloatInt {
++    a: i32,
++    b: f32,
++    c: i32,
++}
++
++// CHECK: define void @f_int_float_int_s_arg([2 x i64])
++#[no_mangle]
++pub extern "C" fn f_int_float_int_s_arg(a: IntFloatInt) {}
++
++// CHECK: define [2 x i64] @f_ret_int_float_int_s()
++#[no_mangle]
++pub extern "C" fn f_ret_int_float_int_s() -> IntFloatInt {
++    IntFloatInt { a: 1, b: 2., c: 3 }
++}
++
++#[repr(C)]
++pub struct CharCharFloat {
++    a: u8,
++    b: u8,
++    c: f32,
++}
++
++// CHECK: define void @f_char_char_float_s_arg(i64)
++#[no_mangle]
++pub extern "C" fn f_char_char_float_s_arg(a: CharCharFloat) {}
++
++// CHECK: define i64 @f_ret_char_char_float_s()
++#[no_mangle]
++pub extern "C" fn f_ret_char_char_float_s() -> CharCharFloat {
++    CharCharFloat { a: 1, b: 2, c: 3. }
++}
++
++#[repr(C)]
++pub union FloatU {
++    a: f32,
++}
++
++// CHECK: define void @f_float_u_arg(i64)
++#[no_mangle]
++pub extern "C" fn f_float_u_arg(a: FloatU) {}
++
++// CHECK: define i64 @f_ret_float_u()
++#[no_mangle]
++pub extern "C" fn f_ret_float_u() -> FloatU {
++    unsafe { FloatU { a: 1. } }
++}
+diff --git a/src/test/ui/abi/struct-enums/struct-return.rs b/src/test/ui/abi/struct-enums/struct-return.rs
+index 5930fc4acbbe..a3e70bbdb080 100644
+--- a/src/test/ui/abi/struct-enums/struct-return.rs
++++ b/src/test/ui/abi/struct-enums/struct-return.rs
+@@ -10,13 +10,23 @@ pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
+ #[derive(Copy, Clone)]
+ pub struct Floats { a: f64, b: u8, c: f64 }
++#[repr(C)]
++#[derive(Copy, Clone)]
++pub struct CharCharDouble { a: u8, b: u8, c: f64 }
++
++#[repr(C)]
++#[derive(Copy, Clone)]
++pub struct CharCharFloat { a: u8, b: u8, c: f32 }
++
+ mod rustrt {
+-    use super::{Floats, Quad};
++    use super::{Floats, Quad, CharCharDouble, CharCharFloat};
+     #[link(name = "rust_test_helpers", kind = "static")]
+     extern {
+         pub fn rust_dbg_abi_1(q: Quad) -> Quad;
+         pub fn rust_dbg_abi_2(f: Floats) -> Floats;
++        pub fn rust_dbg_abi_3(a: CharCharDouble) -> CharCharDouble;
++        pub fn rust_dbg_abi_4(a: CharCharFloat) -> CharCharFloat;
+     }
+ }
+@@ -58,7 +68,47 @@ fn test2() {
+ fn test2() {
+ }
++#[cfg(target_pointer_width = "64")]
++fn test3() {
++    unsafe {
++        let a = CharCharDouble {
++            a: 1,
++            b: 2,
++            c: 3.,
++        };
++        let b = rustrt::rust_dbg_abi_3(a);
++        println!("a: {}", b.a);
++        println!("b: {}", b.b);
++        println!("c: {}", b.c);
++        assert_eq!(b.a, a.a + 1);
++        assert_eq!(b.b, a.b - 1);
++        assert_eq!(b.c, a.c + 1.0);
++    }
++}
++
++#[cfg(target_pointer_width = "32")]
++fn test3() {}
++
++fn test4() {
++    unsafe {
++        let a = CharCharFloat {
++            a: 1,
++            b: 2,
++            c: 3.,
++        };
++        let b = rustrt::rust_dbg_abi_4(a);
++        println!("a: {}", b.a);
++        println!("b: {}", b.b);
++        println!("c: {}", b.c);
++        assert_eq!(b.a, a.a + 1);
++        assert_eq!(b.b, a.b - 1);
++        assert_eq!(b.c, a.c + 1.0);
++    }
++}
++
+ pub fn main() {
+     test1();
+     test2();
++    test3();
++    test4();
+ }
diff --git a/patches/u-riscv64-cc-461.patch b/patches/u-riscv64-cc-461.patch
new file mode 100644 (file)
index 0000000..cd75bc8
--- /dev/null
@@ -0,0 +1,30 @@
+From acdc5c576a565f9d29c0a6a61f3199e8641cd3b7 Mon Sep 17 00:00:00 2001
+From: msizanoen1 <qtmlabs@protonmail.com>
+Date: Thu, 5 Dec 2019 12:22:41 +0700
+Subject: [PATCH] Enable -fPIC on non-bare-metal RISC-V
+
+---
+ src/lib.rs | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib.rs b/src/lib.rs
+index 621d31d6..ab0bdf6c 100644
+--- a/vendor/cc/src/lib.rs
++++ b/vendor/cc/src/lib.rs
+@@ -1365,11 +1365,11 @@ impl Build {
+                     cmd.push_cc_arg("-ffunction-sections".into());
+                     cmd.push_cc_arg("-fdata-sections".into());
+                 }
+-                // Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
+-                if self
+-                    .pic
+-                    .unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv"))
+-                {
++                // Disable generation of PIC on bare-metal RISC-V for now: rust-lld doesn't support this yet
++                if self.pic.unwrap_or(
++                    !target.contains("windows-gnu")
++                        && !(target.contains("riscv") && target.contains("-none-")),
++                ) {
+                     cmd.push_cc_arg("-fPIC".into());
+                     // PLT only applies if code is compiled with PIC support,
+                     // and only for ELF targets.
diff --git a/patches/u-riscv64-cc-465.patch b/patches/u-riscv64-cc-465.patch
new file mode 100644 (file)
index 0000000..6520d62
--- /dev/null
@@ -0,0 +1,23 @@
+From 7099411ed66f42243b4bb89408ff7123097292b8 Mon Sep 17 00:00:00 2001
+From: Ximin Luo <infinity0@pwned.gg>
+Date: Sat, 4 Jan 2020 05:11:21 +0000
+Subject: [PATCH] Add cross prefix for riscv64gc-unknown-linux-gnu =>
+ riscv64-linux-gnu
+
+Add out-of-the-box cross-compiling support for riscv64gc-unknown-linux-gnu
+---
+ src/lib.rs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lib.rs b/src/lib.rs
+index 726d1286..55c9b9d4 100644
+--- a/vendor/cc/src/lib.rs
++++ b/vendor/cc/src/lib.rs
+@@ -2027,6 +2027,7 @@ impl Build {
+                         "riscv32imc-unknown-none-elf" => Some("riscv32-unknown-elf"),
+                         "riscv64gc-unknown-none-elf" => Some("riscv64-unknown-elf"),
+                         "riscv64imac-unknown-none-elf" => Some("riscv64-unknown-elf"),
++                        "riscv64gc-unknown-linux-gnu" => Some("riscv64-linux-gnu"),
+                         "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"),
+                         "sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"),
+                         "sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"),
diff --git a/patches/u-riscv64-compiletest.patch b/patches/u-riscv64-compiletest.patch
new file mode 100644 (file)
index 0000000..c3134ec
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/tools/compiletest/src/util.rs
++++ b/src/tools/compiletest/src/util.rs
+@@ -67,6 +67,7 @@
+     ("powerpc", "powerpc"),
+     ("powerpc64", "powerpc64"),
+     ("powerpc64le", "powerpc64"),
++    ("riscv64gc", "riscv64"),
+     ("s390x", "s390x"),
+     ("sparc", "sparc"),
+     ("sparc64", "sparc64"),
diff --git a/patches/u-riscv64-libc-1606.patch b/patches/u-riscv64-libc-1606.patch
new file mode 100644 (file)
index 0000000..bc5690b
--- /dev/null
@@ -0,0 +1,908 @@
+From 112b7f9cb6ec923ff6e835e64ca149f6c3daddb1 Mon Sep 17 00:00:00 2001
+From: msizanoen1 <qtmlabs@protonmail.com>
+Date: Sat, 23 Nov 2019 14:02:48 +0700
+Subject: [PATCH 1/3] Support for RISC-V 64-bit GNU/Linux
+
+---
+ ci/build.sh                                   |   1 +
+ src/unix/linux_like/linux/gnu/b64/mod.rs      |   3 +
+ .../linux_like/linux/gnu/b64/riscv64/mod.rs   | 861 ++++++++++++++++++
+ src/unix/linux_like/linux/gnu/mod.rs          |   3 +-
+ 4 files changed, 867 insertions(+), 1 deletion(-)
+ create mode 100644 src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+
+diff --git a/src/unix/linux_like/linux/gnu/b64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mod.rs
+index c91da0d98d1..40ce8441a96 100644
+--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
++++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
+@@ -78,6 +78,9 @@ cfg_if! {
+     } else if #[cfg(any(target_arch = "x86_64"))] {
+         mod x86_64;
+         pub use self::x86_64::*;
++    } else if #[cfg(any(target_arch = "riscv64"))] {
++        mod riscv64;
++        pub use self::riscv64::*;
+     } else {
+         // Unknown target_arch
+     }
+diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+new file mode 100644
+index 00000000000..c45c5b230be
+--- /dev/null
++++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+@@ -0,0 +1,861 @@
++//! RISC-V-specific definitions for 64-bit linux-like values
++
++pub type c_char = u8;
++pub type c_long = i64;
++pub type c_ulong = u64;
++pub type wchar_t = ::c_int;
++pub type time_t = ::c_long;
++
++pub type dev_t = ::c_ulong;
++pub type uid_t = ::c_uint;
++pub type gid_t = ::c_uint;
++pub type ino_t = ::c_ulong;
++pub type ino64_t = ::c_ulong;
++pub type mode_t = ::c_uint;
++pub type nlink_t = ::c_uint;
++pub type off_t = ::c_long;
++pub type off64_t = ::c_long;
++pub type pid_t = ::c_int;
++pub type blksize_t = ::c_int;
++pub type blkcnt_t = ::c_long;
++pub type fsblkcnt_t = ::c_ulong;
++pub type fsblkcnt64_t = ::c_ulong;
++pub type fsfilcnt_t = ::c_ulong;
++pub type fsfilcnt64_t = ::c_ulong;
++pub type suseconds_t = i64;
++pub type __u64 = ::c_ulonglong;
++
++s! {
++    pub struct pthread_attr_t {
++        __size: [::c_ulong; 7],
++    }
++
++    pub struct timespec {
++        pub tv_sec: time_t,
++        pub tv_nsec: ::c_long,
++    }
++
++    pub struct stat {
++        pub st_dev: dev_t,
++        pub st_ino: ino_t,
++        pub st_mode: mode_t,
++        pub st_nlink: nlink_t,
++        pub st_uid: uid_t,
++        pub st_gid: gid_t,
++        pub st_rdev: dev_t,
++        pub __pad1: dev_t,
++        pub st_size: off_t,
++        pub st_blksize: blksize_t,
++        pub __pad2: ::c_int,
++        pub st_blocks: blkcnt_t,
++        pub st_atime: time_t,
++        pub st_atime_nsec: ::c_long,
++        pub st_mtime: time_t,
++        pub st_mtime_nsec: ::c_long,
++        pub st_ctime: time_t,
++        pub st_ctime_nsec: ::c_long,
++        pub __unused: [::c_int; 2usize],
++    }
++
++    pub struct stat64 {
++        pub st_dev: dev_t,
++        pub st_ino: ino64_t,
++        pub st_mode: mode_t,
++        pub st_nlink: nlink_t,
++        pub st_uid: uid_t,
++        pub st_gid: gid_t,
++        pub st_rdev: dev_t,
++        pub __pad1: dev_t,
++        pub st_size: off64_t,
++        pub st_blksize: blksize_t,
++        pub __pad2: ::c_int,
++        pub st_blocks: blkcnt_t,
++        pub st_atime: time_t,
++        pub st_atime_nsec: ::c_long,
++        pub st_mtime: time_t,
++        pub st_mtime_nsec: ::c_long,
++        pub st_ctime: time_t,
++        pub st_ctime_nsec: ::c_long,
++        pub __unused: [::c_int; 2],
++    }
++
++    pub struct statfs {
++        pub f_type: ::c_long,
++        pub f_bsize: ::c_long,
++        pub f_blocks: fsblkcnt_t,
++        pub f_bfree: fsblkcnt_t,
++        pub f_bavail: fsblkcnt_t,
++        pub f_files: fsfilcnt_t,
++        pub f_ffree: fsfilcnt_t,
++        pub f_fsid: ::fsid_t,
++        pub f_namelen: ::c_long,
++        pub f_frsize: ::c_long,
++        pub f_flags: ::c_long,
++        pub f_spare: [::c_long; 4],
++    }
++
++    pub struct statfs64 {
++        pub f_type: ::c_long,
++        pub f_bsize: ::c_long,
++        pub f_blocks: fsblkcnt64_t,
++        pub f_bfree: fsblkcnt64_t,
++        pub f_bavail: fsblkcnt64_t,
++        pub f_files: fsfilcnt64_t,
++        pub f_ffree: fsfilcnt64_t,
++        pub f_fsid: ::fsid_t,
++        pub f_namelen: ::c_long,
++        pub f_frsize: ::c_long,
++        pub f_flags: ::c_long,
++        pub f_spare: [::c_long; 4],
++    }
++
++    pub struct statvfs {
++        pub f_bsize: ::c_ulong,
++        pub f_frsize: ::c_ulong,
++        pub f_blocks: fsblkcnt_t,
++        pub f_bfree: fsblkcnt_t,
++        pub f_bavail: fsblkcnt_t,
++        pub f_files: fsfilcnt_t,
++        pub f_ffree: fsfilcnt_t,
++        pub f_favail: fsfilcnt_t,
++        pub f_fsid: ::c_ulong,
++        pub f_flag: ::c_ulong,
++        pub f_namemax: ::c_ulong,
++        pub __f_spare: [::c_int; 6],
++    }
++
++    pub struct statvfs64 {
++        pub f_bsize: ::c_ulong,
++        pub f_frsize: ::c_ulong,
++        pub f_blocks: fsblkcnt64_t,
++        pub f_bfree: fsblkcnt64_t,
++        pub f_bavail: fsblkcnt64_t,
++        pub f_files: fsfilcnt64_t,
++        pub f_ffree: fsfilcnt64_t,
++        pub f_favail: fsfilcnt64_t,
++        pub f_fsid: ::c_ulong,
++        pub f_flag: ::c_ulong,
++        pub f_namemax: ::c_ulong,
++        pub __f_spare: [::c_int; 6],
++    }
++
++    pub struct siginfo_t {
++        pub si_signo: ::c_int,
++        pub si_errno: ::c_int,
++        pub si_code: ::c_int,
++        #[doc(hidden)]
++        #[deprecated(
++            since="0.2.54",
++            note="Please leave a comment on \
++                  https://github.com/rust-lang/libc/pull/1316 if you're using \
++                  this field"
++        )]
++        pub _pad: [::c_int; 29],
++        _align: [u64; 0],
++    }
++
++    pub struct stack_t {
++        pub ss_sp: *mut ::c_void,
++        pub ss_flags: ::c_int,
++        pub ss_size: ::size_t,
++    }
++
++    pub struct sigaction {
++        pub sa_sigaction: ::sighandler_t,
++        pub sa_mask: ::sigset_t,
++        pub sa_flags: ::c_int,
++        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
++    }
++
++    pub struct sigset_t {
++        pub __val: [::c_ulong; 16],
++    }
++
++    pub struct ipc_perm {
++        pub __key: ::key_t,
++        pub uid: uid_t,
++        pub gid: gid_t,
++        pub cuid: uid_t,
++        pub cgid: gid_t,
++        pub mode: ::c_ushort,
++        pub __pad1: ::c_ushort,
++        pub __seq: ::c_ushort,
++        pub __pad2: ::c_ushort,
++        pub __unused1: ::c_ulong,
++        pub __unused2: ::c_ulong,
++    }
++
++    pub struct shmid_ds {
++        pub shm_perm: ipc_perm,
++        pub shm_segsz: ::size_t,
++        pub shm_atime: time_t,
++        pub shm_dtime: time_t,
++        pub shm_ctime: time_t,
++        pub shm_cpid: pid_t,
++        pub shm_lpid: pid_t,
++        pub shm_nattch: ::shmatt_t,
++        pub __unused5: ::c_ulong,
++        pub __unused6: ::c_ulong,
++    }
++
++    pub struct flock {
++        pub l_type: ::c_short,
++        pub l_whence: ::c_short,
++        pub l_start: ::off_t,
++        pub l_len: ::off_t,
++        pub l_pid: ::pid_t,
++    }
++}
++
++pub const POSIX_FADV_DONTNEED: ::c_int = 4;
++pub const POSIX_FADV_NOREUSE: ::c_int = 5;
++pub const VEOF: usize = 4;
++pub const TIOCGSOFTCAR: ::c_ulong = 21529;
++pub const TIOCSSOFTCAR: ::c_ulong = 21530;
++pub const TIOCGRS485: ::c_int = 21550;
++pub const TIOCSRS485: ::c_int = 21551;
++pub const O_APPEND: ::c_int = 1024;
++pub const O_CREAT: ::c_int = 64;
++pub const O_EXCL: ::c_int = 128;
++pub const O_NOCTTY: ::c_int = 256;
++pub const O_NONBLOCK: ::c_int = 2048;
++pub const O_SYNC: ::c_int = 1052672;
++pub const O_RSYNC: ::c_int = 1052672;
++pub const O_DSYNC: ::c_int = 4096;
++pub const O_FSYNC: ::c_int = 1052672;
++pub const O_NOATIME: ::c_int = 262144;
++pub const O_PATH: ::c_int = 2097152;
++pub const O_TMPFILE: ::c_int = 4259840;
++pub const MAP_GROWSDOWN: ::c_int = 256;
++pub const EDEADLK: ::c_int = 35;
++pub const ENAMETOOLONG: ::c_int = 36;
++pub const ENOLCK: ::c_int = 37;
++pub const ENOSYS: ::c_int = 38;
++pub const ENOTEMPTY: ::c_int = 39;
++pub const ELOOP: ::c_int = 40;
++pub const ENOMSG: ::c_int = 42;
++pub const EIDRM: ::c_int = 43;
++pub const ECHRNG: ::c_int = 44;
++pub const EL2NSYNC: ::c_int = 45;
++pub const EL3HLT: ::c_int = 46;
++pub const EL3RST: ::c_int = 47;
++pub const ELNRNG: ::c_int = 48;
++pub const EUNATCH: ::c_int = 49;
++pub const ENOCSI: ::c_int = 50;
++pub const EL2HLT: ::c_int = 51;
++pub const EBADE: ::c_int = 52;
++pub const EBADR: ::c_int = 53;
++pub const EXFULL: ::c_int = 54;
++pub const ENOANO: ::c_int = 55;
++pub const EBADRQC: ::c_int = 56;
++pub const EBADSLT: ::c_int = 57;
++pub const EMULTIHOP: ::c_int = 72;
++pub const EOVERFLOW: ::c_int = 75;
++pub const ENOTUNIQ: ::c_int = 76;
++pub const EBADFD: ::c_int = 77;
++pub const EBADMSG: ::c_int = 74;
++pub const EREMCHG: ::c_int = 78;
++pub const ELIBACC: ::c_int = 79;
++pub const ELIBBAD: ::c_int = 80;
++pub const ELIBSCN: ::c_int = 81;
++pub const ELIBMAX: ::c_int = 82;
++pub const ELIBEXEC: ::c_int = 83;
++pub const EILSEQ: ::c_int = 84;
++pub const ERESTART: ::c_int = 85;
++pub const ESTRPIPE: ::c_int = 86;
++pub const EUSERS: ::c_int = 87;
++pub const ENOTSOCK: ::c_int = 88;
++pub const EDESTADDRREQ: ::c_int = 89;
++pub const EMSGSIZE: ::c_int = 90;
++pub const EPROTOTYPE: ::c_int = 91;
++pub const ENOPROTOOPT: ::c_int = 92;
++pub const EPROTONOSUPPORT: ::c_int = 93;
++pub const ESOCKTNOSUPPORT: ::c_int = 94;
++pub const EOPNOTSUPP: ::c_int = 95;
++pub const EPFNOSUPPORT: ::c_int = 96;
++pub const EAFNOSUPPORT: ::c_int = 97;
++pub const EADDRINUSE: ::c_int = 98;
++pub const EADDRNOTAVAIL: ::c_int = 99;
++pub const ENETDOWN: ::c_int = 100;
++pub const ENETUNREACH: ::c_int = 101;
++pub const ENETRESET: ::c_int = 102;
++pub const ECONNABORTED: ::c_int = 103;
++pub const ECONNRESET: ::c_int = 104;
++pub const ENOBUFS: ::c_int = 105;
++pub const EISCONN: ::c_int = 106;
++pub const ENOTCONN: ::c_int = 107;
++pub const ESHUTDOWN: ::c_int = 108;
++pub const ETOOMANYREFS: ::c_int = 109;
++pub const ETIMEDOUT: ::c_int = 110;
++pub const ECONNREFUSED: ::c_int = 111;
++pub const EHOSTDOWN: ::c_int = 112;
++pub const EHOSTUNREACH: ::c_int = 113;
++pub const EALREADY: ::c_int = 114;
++pub const EINPROGRESS: ::c_int = 115;
++pub const ESTALE: ::c_int = 116;
++pub const EDQUOT: ::c_int = 122;
++pub const ENOMEDIUM: ::c_int = 123;
++pub const EMEDIUMTYPE: ::c_int = 124;
++pub const ECANCELED: ::c_int = 125;
++pub const ENOKEY: ::c_int = 126;
++pub const EKEYEXPIRED: ::c_int = 127;
++pub const EKEYREVOKED: ::c_int = 128;
++pub const EKEYREJECTED: ::c_int = 129;
++pub const EOWNERDEAD: ::c_int = 130;
++pub const ENOTRECOVERABLE: ::c_int = 131;
++pub const EHWPOISON: ::c_int = 133;
++pub const ERFKILL: ::c_int = 132;
++pub const SOL_SOCKET: ::c_int = 1;
++pub const SO_REUSEADDR: ::c_int = 2;
++pub const SO_TYPE: ::c_int = 3;
++pub const SO_ERROR: ::c_int = 4;
++pub const SO_DONTROUTE: ::c_int = 5;
++pub const SO_BROADCAST: ::c_int = 6;
++pub const SO_SNDBUF: ::c_int = 7;
++pub const SO_RCVBUF: ::c_int = 8;
++pub const SO_SNDBUFFORCE: ::c_int = 32;
++pub const SO_RCVBUFFORCE: ::c_int = 33;
++pub const SO_KEEPALIVE: ::c_int = 9;
++pub const SO_OOBINLINE: ::c_int = 10;
++pub const SO_NO_CHECK: ::c_int = 11;
++pub const SO_PRIORITY: ::c_int = 12;
++pub const SO_LINGER: ::c_int = 13;
++pub const SO_BSDCOMPAT: ::c_int = 14;
++pub const SO_REUSEPORT: ::c_int = 15;
++pub const SO_PASSCRED: ::c_int = 16;
++pub const SO_PEERCRED: ::c_int = 17;
++pub const SO_RCVLOWAT: ::c_int = 18;
++pub const SO_SNDLOWAT: ::c_int = 19;
++pub const SO_RCVTIMEO: ::c_int = 20;
++pub const SO_SNDTIMEO: ::c_int = 21;
++pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
++pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
++pub const SO_BINDTODEVICE: ::c_int = 25;
++pub const SO_ATTACH_FILTER: ::c_int = 26;
++pub const SO_DETACH_FILTER: ::c_int = 27;
++pub const SO_GET_FILTER: ::c_int = 26;
++pub const SO_PEERNAME: ::c_int = 28;
++pub const SO_TIMESTAMP: ::c_int = 29;
++pub const SO_ACCEPTCONN: ::c_int = 30;
++pub const SO_PEERSEC: ::c_int = 31;
++pub const SO_PASSSEC: ::c_int = 34;
++pub const SO_TIMESTAMPNS: ::c_int = 35;
++pub const SCM_TIMESTAMPNS: ::c_int = 35;
++pub const SO_MARK: ::c_int = 36;
++pub const SO_PROTOCOL: ::c_int = 38;
++pub const SO_DOMAIN: ::c_int = 39;
++pub const SO_RXQ_OVFL: ::c_int = 40;
++pub const SO_WIFI_STATUS: ::c_int = 41;
++pub const SCM_WIFI_STATUS: ::c_int = 41;
++pub const SO_PEEK_OFF: ::c_int = 42;
++pub const SO_NOFCS: ::c_int = 43;
++pub const SO_LOCK_FILTER: ::c_int = 44;
++pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
++pub const SO_BUSY_POLL: ::c_int = 46;
++pub const SO_MAX_PACING_RATE: ::c_int = 47;
++pub const SO_BPF_EXTENSIONS: ::c_int = 48;
++pub const SO_INCOMING_CPU: ::c_int = 49;
++pub const SO_ATTACH_BPF: ::c_int = 50;
++pub const SO_DETACH_BPF: ::c_int = 27;
++pub const SOCK_STREAM: ::c_int = 1;
++pub const SOCK_DGRAM: ::c_int = 2;
++pub const SA_ONSTACK: ::c_int = 134217728;
++pub const SA_SIGINFO: ::c_int = 4;
++pub const SA_NOCLDWAIT: ::c_int = 2;
++pub const SIGTTIN: ::c_int = 21;
++pub const SIGTTOU: ::c_int = 22;
++pub const SIGXCPU: ::c_int = 24;
++pub const SIGXFSZ: ::c_int = 25;
++pub const SIGVTALRM: ::c_int = 26;
++pub const SIGPROF: ::c_int = 27;
++pub const SIGWINCH: ::c_int = 28;
++pub const SIGCHLD: ::c_int = 17;
++pub const SIGBUS: ::c_int = 7;
++pub const SIGUSR1: ::c_int = 10;
++pub const SIGUSR2: ::c_int = 12;
++pub const SIGCONT: ::c_int = 18;
++pub const SIGSTOP: ::c_int = 19;
++pub const SIGTSTP: ::c_int = 20;
++pub const SIGURG: ::c_int = 23;
++pub const SIGIO: ::c_int = 29;
++pub const SIGSYS: ::c_int = 31;
++pub const SIGSTKFLT: ::c_int = 16;
++pub const SIGPOLL: ::c_int = 29;
++pub const SIGPWR: ::c_int = 30;
++pub const SIG_SETMASK: ::c_int = 2;
++pub const SIG_BLOCK: ::c_int = 0;
++pub const SIG_UNBLOCK: ::c_int = 1;
++pub const POLLWRNORM: ::c_short = 256;
++pub const POLLWRBAND: ::c_short = 512;
++pub const O_ASYNC: ::c_int = 8192;
++pub const O_NDELAY: ::c_int = 2048;
++pub const PTRACE_DETACH: ::c_uint = 17;
++pub const EFD_NONBLOCK: ::c_int = 2048;
++pub const F_GETLK: ::c_int = 5;
++pub const F_GETOWN: ::c_int = 9;
++pub const F_SETOWN: ::c_int = 8;
++pub const F_SETLK: ::c_int = 6;
++pub const F_SETLKW: ::c_int = 7;
++pub const F_RDLCK: ::c_int = 0;
++pub const F_WRLCK: ::c_int = 1;
++pub const F_UNLCK: ::c_int = 2;
++pub const SFD_NONBLOCK: ::c_int = 2048;
++pub const TCSANOW: ::c_int = 0;
++pub const TCSADRAIN: ::c_int = 1;
++pub const TCSAFLUSH: ::c_int = 2;
++pub const TIOCLINUX: ::c_ulong = 21532;
++pub const TIOCGSERIAL: ::c_ulong = 21534;
++pub const TIOCEXCL: ::c_ulong = 21516;
++pub const TIOCNXCL: ::c_ulong = 21517;
++pub const TIOCSCTTY: ::c_ulong = 21518;
++pub const TIOCSTI: ::c_ulong = 21522;
++pub const TIOCMGET: ::c_ulong = 21525;
++pub const TIOCMBIS: ::c_ulong = 21526;
++pub const TIOCMBIC: ::c_ulong = 21527;
++pub const TIOCMSET: ::c_ulong = 21528;
++pub const TIOCCONS: ::c_ulong = 21533;
++pub const TIOCM_ST: ::c_int = 8;
++pub const TIOCM_SR: ::c_int = 16;
++pub const TIOCM_CTS: ::c_int = 32;
++pub const TIOCM_CAR: ::c_int = 64;
++pub const TIOCM_RNG: ::c_int = 128;
++pub const TIOCM_DSR: ::c_int = 256;
++pub const SFD_CLOEXEC: ::c_int = 524288;
++pub const NCCS: usize = 32;
++pub const O_TRUNC: ::c_int = 512;
++pub const O_CLOEXEC: ::c_int = 524288;
++pub const EBFONT: ::c_int = 59;
++pub const ENOSTR: ::c_int = 60;
++pub const ENODATA: ::c_int = 61;
++pub const ETIME: ::c_int = 62;
++pub const ENOSR: ::c_int = 63;
++pub const ENONET: ::c_int = 64;
++pub const ENOPKG: ::c_int = 65;
++pub const EREMOTE: ::c_int = 66;
++pub const ENOLINK: ::c_int = 67;
++pub const EADV: ::c_int = 68;
++pub const ESRMNT: ::c_int = 69;
++pub const ECOMM: ::c_int = 70;
++pub const EPROTO: ::c_int = 71;
++pub const EDOTDOT: ::c_int = 73;
++pub const SA_NODEFER: ::c_int = 1073741824;
++pub const SA_RESETHAND: ::c_int = -2147483648;
++pub const SA_RESTART: ::c_int = 268435456;
++pub const SA_NOCLDSTOP: ::c_int = 1;
++pub const EPOLL_CLOEXEC: ::c_int = 524288;
++pub const EFD_CLOEXEC: ::c_int = 524288;
++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
++pub const O_DIRECT: ::c_int = 16384;
++pub const O_DIRECTORY: ::c_int = 65536;
++pub const O_NOFOLLOW: ::c_int = 131072;
++pub const MAP_HUGETLB: ::c_int = 262144;
++pub const MAP_LOCKED: ::c_int = 8192;
++pub const MAP_NORESERVE: ::c_int = 16384;
++pub const MAP_ANON: ::c_int = 32;
++pub const MAP_ANONYMOUS: ::c_int = 32;
++pub const MAP_DENYWRITE: ::c_int = 2048;
++pub const MAP_EXECUTABLE: ::c_int = 4096;
++pub const MAP_POPULATE: ::c_int = 32768;
++pub const MAP_NONBLOCK: ::c_int = 65536;
++pub const MAP_STACK: ::c_int = 131072;
++pub const EDEADLOCK: ::c_int = 35;
++pub const EUCLEAN: ::c_int = 117;
++pub const ENOTNAM: ::c_int = 118;
++pub const ENAVAIL: ::c_int = 119;
++pub const EISNAM: ::c_int = 120;
++pub const EREMOTEIO: ::c_int = 121;
++pub const FIOCLEX: ::c_ulong = 21585;
++pub const FIONCLEX: ::c_ulong = 21584;
++pub const FIONBIO: ::c_ulong = 21537;
++pub const MCL_CURRENT: ::c_int = 1;
++pub const MCL_FUTURE: ::c_int = 2;
++pub const SIGSTKSZ: ::size_t = 8192;
++pub const MINSIGSTKSZ: ::size_t = 2048;
++pub const CBAUD: ::tcflag_t = 4111;
++pub const TAB1: ::tcflag_t = 2048;
++pub const TAB2: ::tcflag_t = 4096;
++pub const TAB3: ::tcflag_t = 6144;
++pub const CR1: ::tcflag_t = 512;
++pub const CR2: ::tcflag_t = 1024;
++pub const CR3: ::tcflag_t = 1536;
++pub const FF1: ::tcflag_t = 32768;
++pub const BS1: ::tcflag_t = 8192;
++pub const VT1: ::tcflag_t = 16384;
++pub const VWERASE: usize = 14;
++pub const VREPRINT: usize = 12;
++pub const VSUSP: usize = 10;
++pub const VSTART: usize = 8;
++pub const VSTOP: usize = 9;
++pub const VDISCARD: usize = 13;
++pub const VTIME: usize = 5;
++pub const IXON: ::tcflag_t = 1024;
++pub const IXOFF: ::tcflag_t = 4096;
++pub const ONLCR: ::tcflag_t = 4;
++pub const CSIZE: ::tcflag_t = 48;
++pub const CS6: ::tcflag_t = 16;
++pub const CS7: ::tcflag_t = 32;
++pub const CS8: ::tcflag_t = 48;
++pub const CSTOPB: ::tcflag_t = 64;
++pub const CREAD: ::tcflag_t = 128;
++pub const PARENB: ::tcflag_t = 256;
++pub const PARODD: ::tcflag_t = 512;
++pub const HUPCL: ::tcflag_t = 1024;
++pub const CLOCAL: ::tcflag_t = 2048;
++pub const ECHOKE: ::tcflag_t = 2048;
++pub const ECHOE: ::tcflag_t = 16;
++pub const ECHOK: ::tcflag_t = 32;
++pub const ECHONL: ::tcflag_t = 64;
++pub const ECHOPRT: ::tcflag_t = 1024;
++pub const ECHOCTL: ::tcflag_t = 512;
++pub const ISIG: ::tcflag_t = 1;
++pub const ICANON: ::tcflag_t = 2;
++pub const PENDIN: ::tcflag_t = 16384;
++pub const NOFLSH: ::tcflag_t = 128;
++pub const CIBAUD: ::tcflag_t = 269418496;
++pub const CBAUDEX: ::tcflag_t = 4096;
++pub const VSWTC: usize = 7;
++pub const OLCUC: ::tcflag_t = 2;
++pub const NLDLY: ::tcflag_t = 256;
++pub const CRDLY: ::tcflag_t = 1536;
++pub const TABDLY: ::tcflag_t = 6144;
++pub const BSDLY: ::tcflag_t = 8192;
++pub const FFDLY: ::tcflag_t = 32768;
++pub const VTDLY: ::tcflag_t = 16384;
++pub const XTABS: ::tcflag_t = 6144;
++pub const B0: ::speed_t = 0;
++pub const B50: ::speed_t = 1;
++pub const B75: ::speed_t = 2;
++pub const B110: ::speed_t = 3;
++pub const B134: ::speed_t = 4;
++pub const B150: ::speed_t = 5;
++pub const B200: ::speed_t = 6;
++pub const B300: ::speed_t = 7;
++pub const B600: ::speed_t = 8;
++pub const B1200: ::speed_t = 9;
++pub const B1800: ::speed_t = 10;
++pub const B2400: ::speed_t = 11;
++pub const B4800: ::speed_t = 12;
++pub const B9600: ::speed_t = 13;
++pub const B19200: ::speed_t = 14;
++pub const B38400: ::speed_t = 15;
++pub const EXTA: ::speed_t = 14;
++pub const EXTB: ::speed_t = 15;
++pub const B57600: ::speed_t = 4097;
++pub const B115200: ::speed_t = 4098;
++pub const B230400: ::speed_t = 4099;
++pub const B460800: ::speed_t = 4100;
++pub const B500000: ::speed_t = 4101;
++pub const B576000: ::speed_t = 4102;
++pub const B921600: ::speed_t = 4103;
++pub const B1000000: ::speed_t = 4104;
++pub const B1152000: ::speed_t = 4105;
++pub const B1500000: ::speed_t = 4106;
++pub const B2000000: ::speed_t = 4107;
++pub const B2500000: ::speed_t = 4108;
++pub const B3000000: ::speed_t = 4109;
++pub const B3500000: ::speed_t = 4110;
++pub const B4000000: ::speed_t = 4111;
++pub const VEOL: usize = 11;
++pub const VEOL2: usize = 16;
++pub const VMIN: usize = 6;
++pub const IEXTEN: ::tcflag_t = 32768;
++pub const TOSTOP: ::tcflag_t = 256;
++pub const FLUSHO: ::tcflag_t = 4096;
++pub const EXTPROC: ::tcflag_t = 65536;
++pub const TCGETS: ::c_ulong = 21505;
++pub const TCSETS: ::c_ulong = 21506;
++pub const TCSETSW: ::c_ulong = 21507;
++pub const TCSETSF: ::c_ulong = 21508;
++pub const TCGETA: ::c_ulong = 21509;
++pub const TCSETA: ::c_ulong = 21510;
++pub const TCSETAW: ::c_ulong = 21511;
++pub const TCSETAF: ::c_ulong = 21512;
++pub const TCSBRK: ::c_ulong = 21513;
++pub const TCXONC: ::c_ulong = 21514;
++pub const TCFLSH: ::c_ulong = 21515;
++pub const TIOCINQ: ::c_ulong = 21531;
++pub const TIOCGPGRP: ::c_ulong = 21519;
++pub const TIOCSPGRP: ::c_ulong = 21520;
++pub const TIOCOUTQ: ::c_ulong = 21521;
++pub const TIOCGWINSZ: ::c_ulong = 21523;
++pub const TIOCSWINSZ: ::c_ulong = 21524;
++pub const FIONREAD: ::c_ulong = 21531;
++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
++pub const SYS_read: ::c_long = 63;
++pub const SYS_write: ::c_long = 64;
++pub const SYS_close: ::c_long = 57;
++pub const SYS_fstat: ::c_long = 80;
++pub const SYS_lseek: ::c_long = 62;
++pub const SYS_mmap: ::c_long = 222;
++pub const SYS_mprotect: ::c_long = 226;
++pub const SYS_munmap: ::c_long = 215;
++pub const SYS_brk: ::c_long = 214;
++pub const SYS_rt_sigaction: ::c_long = 134;
++pub const SYS_rt_sigprocmask: ::c_long = 135;
++pub const SYS_rt_sigreturn: ::c_long = 139;
++pub const SYS_ioctl: ::c_long = 29;
++pub const SYS_pread64: ::c_long = 67;
++pub const SYS_pwrite64: ::c_long = 68;
++pub const SYS_readv: ::c_long = 65;
++pub const SYS_writev: ::c_long = 66;
++pub const SYS_sched_yield: ::c_long = 124;
++pub const SYS_mremap: ::c_long = 216;
++pub const SYS_msync: ::c_long = 227;
++pub const SYS_mincore: ::c_long = 232;
++pub const SYS_madvise: ::c_long = 233;
++pub const SYS_shmget: ::c_long = 194;
++pub const SYS_shmat: ::c_long = 196;
++pub const SYS_shmctl: ::c_long = 195;
++pub const SYS_dup: ::c_long = 23;
++pub const SYS_nanosleep: ::c_long = 101;
++pub const SYS_getitimer: ::c_long = 102;
++pub const SYS_setitimer: ::c_long = 103;
++pub const SYS_getpid: ::c_long = 172;
++pub const SYS_sendfile: ::c_long = 71;
++pub const SYS_socket: ::c_long = 198;
++pub const SYS_connect: ::c_long = 203;
++pub const SYS_accept: ::c_long = 202;
++pub const SYS_sendto: ::c_long = 206;
++pub const SYS_recvfrom: ::c_long = 207;
++pub const SYS_sendmsg: ::c_long = 211;
++pub const SYS_recvmsg: ::c_long = 212;
++pub const SYS_shutdown: ::c_long = 210;
++pub const SYS_bind: ::c_long = 200;
++pub const SYS_listen: ::c_long = 201;
++pub const SYS_getsockname: ::c_long = 204;
++pub const SYS_getpeername: ::c_long = 205;
++pub const SYS_socketpair: ::c_long = 199;
++pub const SYS_setsockopt: ::c_long = 208;
++pub const SYS_getsockopt: ::c_long = 209;
++pub const SYS_clone: ::c_long = 220;
++pub const SYS_execve: ::c_long = 221;
++pub const SYS_exit: ::c_long = 93;
++pub const SYS_wait4: ::c_long = 260;
++pub const SYS_kill: ::c_long = 129;
++pub const SYS_uname: ::c_long = 160;
++pub const SYS_semget: ::c_long = 190;
++pub const SYS_semop: ::c_long = 193;
++pub const SYS_semctl: ::c_long = 191;
++pub const SYS_shmdt: ::c_long = 197;
++pub const SYS_msgget: ::c_long = 186;
++pub const SYS_msgsnd: ::c_long = 189;
++pub const SYS_msgrcv: ::c_long = 188;
++pub const SYS_msgctl: ::c_long = 187;
++pub const SYS_fcntl: ::c_long = 25;
++pub const SYS_flock: ::c_long = 32;
++pub const SYS_fsync: ::c_long = 82;
++pub const SYS_fdatasync: ::c_long = 83;
++pub const SYS_truncate: ::c_long = 45;
++pub const SYS_ftruncate: ::c_long = 46;
++pub const SYS_getcwd: ::c_long = 17;
++pub const SYS_chdir: ::c_long = 49;
++pub const SYS_fchdir: ::c_long = 50;
++pub const SYS_fchmod: ::c_long = 52;
++pub const SYS_fchown: ::c_long = 55;
++pub const SYS_umask: ::c_long = 166;
++pub const SYS_gettimeofday: ::c_long = 169;
++pub const SYS_getrlimit: ::c_long = 163;
++pub const SYS_getrusage: ::c_long = 165;
++pub const SYS_sysinfo: ::c_long = 179;
++pub const SYS_times: ::c_long = 153;
++pub const SYS_ptrace: ::c_long = 117;
++pub const SYS_getuid: ::c_long = 174;
++pub const SYS_syslog: ::c_long = 116;
++pub const SYS_getgid: ::c_long = 176;
++pub const SYS_setuid: ::c_long = 146;
++pub const SYS_setgid: ::c_long = 144;
++pub const SYS_geteuid: ::c_long = 175;
++pub const SYS_getegid: ::c_long = 177;
++pub const SYS_setpgid: ::c_long = 154;
++pub const SYS_getppid: ::c_long = 173;
++pub const SYS_setsid: ::c_long = 157;
++pub const SYS_setreuid: ::c_long = 145;
++pub const SYS_setregid: ::c_long = 143;
++pub const SYS_getgroups: ::c_long = 158;
++pub const SYS_setgroups: ::c_long = 159;
++pub const SYS_setresuid: ::c_long = 147;
++pub const SYS_getresuid: ::c_long = 148;
++pub const SYS_setresgid: ::c_long = 149;
++pub const SYS_getresgid: ::c_long = 150;
++pub const SYS_getpgid: ::c_long = 155;
++pub const SYS_setfsuid: ::c_long = 151;
++pub const SYS_setfsgid: ::c_long = 152;
++pub const SYS_getsid: ::c_long = 156;
++pub const SYS_capget: ::c_long = 90;
++pub const SYS_capset: ::c_long = 91;
++pub const SYS_rt_sigpending: ::c_long = 136;
++pub const SYS_rt_sigtimedwait: ::c_long = 137;
++pub const SYS_rt_sigqueueinfo: ::c_long = 138;
++pub const SYS_rt_sigsuspend: ::c_long = 133;
++pub const SYS_sigaltstack: ::c_long = 132;
++pub const SYS_personality: ::c_long = 92;
++pub const SYS_statfs: ::c_long = 43;
++pub const SYS_fstatfs: ::c_long = 44;
++pub const SYS_getpriority: ::c_long = 141;
++pub const SYS_setpriority: ::c_long = 140;
++pub const SYS_sched_setparam: ::c_long = 118;
++pub const SYS_sched_getparam: ::c_long = 121;
++pub const SYS_sched_setscheduler: ::c_long = 119;
++pub const SYS_sched_getscheduler: ::c_long = 120;
++pub const SYS_sched_get_priority_max: ::c_long = 125;
++pub const SYS_sched_get_priority_min: ::c_long = 126;
++pub const SYS_sched_rr_get_interval: ::c_long = 127;
++pub const SYS_mlock: ::c_long = 228;
++pub const SYS_munlock: ::c_long = 229;
++pub const SYS_mlockall: ::c_long = 230;
++pub const SYS_munlockall: ::c_long = 231;
++pub const SYS_vhangup: ::c_long = 58;
++pub const SYS_pivot_root: ::c_long = 41;
++pub const SYS_prctl: ::c_long = 167;
++pub const SYS_adjtimex: ::c_long = 171;
++pub const SYS_setrlimit: ::c_long = 164;
++pub const SYS_chroot: ::c_long = 51;
++pub const SYS_sync: ::c_long = 81;
++pub const SYS_acct: ::c_long = 89;
++pub const SYS_settimeofday: ::c_long = 170;
++pub const SYS_mount: ::c_long = 40;
++pub const SYS_umount2: ::c_long = 39;
++pub const SYS_swapon: ::c_long = 224;
++pub const SYS_swapoff: ::c_long = 225;
++pub const SYS_reboot: ::c_long = 142;
++pub const SYS_sethostname: ::c_long = 161;
++pub const SYS_setdomainname: ::c_long = 162;
++pub const SYS_init_module: ::c_long = 105;
++pub const SYS_delete_module: ::c_long = 106;
++pub const SYS_quotactl: ::c_long = 60;
++pub const SYS_nfsservctl: ::c_long = 42;
++pub const SYS_gettid: ::c_long = 178;
++pub const SYS_readahead: ::c_long = 213;
++pub const SYS_setxattr: ::c_long = 5;
++pub const SYS_lsetxattr: ::c_long = 6;
++pub const SYS_fsetxattr: ::c_long = 7;
++pub const SYS_getxattr: ::c_long = 8;
++pub const SYS_lgetxattr: ::c_long = 9;
++pub const SYS_fgetxattr: ::c_long = 10;
++pub const SYS_listxattr: ::c_long = 11;
++pub const SYS_llistxattr: ::c_long = 12;
++pub const SYS_flistxattr: ::c_long = 13;
++pub const SYS_removexattr: ::c_long = 14;
++pub const SYS_lremovexattr: ::c_long = 15;
++pub const SYS_fremovexattr: ::c_long = 16;
++pub const SYS_tkill: ::c_long = 130;
++pub const SYS_futex: ::c_long = 98;
++pub const SYS_sched_setaffinity: ::c_long = 122;
++pub const SYS_sched_getaffinity: ::c_long = 123;
++pub const SYS_io_setup: ::c_long = 0;
++pub const SYS_io_destroy: ::c_long = 1;
++pub const SYS_io_getevents: ::c_long = 4;
++pub const SYS_io_submit: ::c_long = 2;
++pub const SYS_io_cancel: ::c_long = 3;
++pub const SYS_lookup_dcookie: ::c_long = 18;
++pub const SYS_remap_file_pages: ::c_long = 234;
++pub const SYS_getdents64: ::c_long = 61;
++pub const SYS_set_tid_address: ::c_long = 96;
++pub const SYS_restart_syscall: ::c_long = 128;
++pub const SYS_semtimedop: ::c_long = 192;
++pub const SYS_fadvise64: ::c_long = 223;
++pub const SYS_timer_create: ::c_long = 107;
++pub const SYS_timer_settime: ::c_long = 110;
++pub const SYS_timer_gettime: ::c_long = 108;
++pub const SYS_timer_getoverrun: ::c_long = 109;
++pub const SYS_timer_delete: ::c_long = 111;
++pub const SYS_clock_settime: ::c_long = 112;
++pub const SYS_clock_gettime: ::c_long = 113;
++pub const SYS_clock_getres: ::c_long = 114;
++pub const SYS_clock_nanosleep: ::c_long = 115;
++pub const SYS_exit_group: ::c_long = 94;
++pub const SYS_epoll_ctl: ::c_long = 21;
++pub const SYS_tgkill: ::c_long = 131;
++pub const SYS_mbind: ::c_long = 235;
++pub const SYS_set_mempolicy: ::c_long = 237;
++pub const SYS_get_mempolicy: ::c_long = 236;
++pub const SYS_mq_open: ::c_long = 180;
++pub const SYS_mq_unlink: ::c_long = 181;
++pub const SYS_mq_timedsend: ::c_long = 182;
++pub const SYS_mq_timedreceive: ::c_long = 183;
++pub const SYS_mq_notify: ::c_long = 184;
++pub const SYS_mq_getsetattr: ::c_long = 185;
++pub const SYS_kexec_load: ::c_long = 104;
++pub const SYS_waitid: ::c_long = 95;
++pub const SYS_add_key: ::c_long = 217;
++pub const SYS_request_key: ::c_long = 218;
++pub const SYS_keyctl: ::c_long = 219;
++pub const SYS_ioprio_set: ::c_long = 30;
++pub const SYS_ioprio_get: ::c_long = 31;
++pub const SYS_inotify_add_watch: ::c_long = 27;
++pub const SYS_inotify_rm_watch: ::c_long = 28;
++pub const SYS_migrate_pages: ::c_long = 238;
++pub const SYS_openat: ::c_long = 56;
++pub const SYS_mkdirat: ::c_long = 34;
++pub const SYS_mknodat: ::c_long = 33;
++pub const SYS_fchownat: ::c_long = 54;
++pub const SYS_newfstatat: ::c_long = 79;
++pub const SYS_unlinkat: ::c_long = 35;
++pub const SYS_linkat: ::c_long = 37;
++pub const SYS_symlinkat: ::c_long = 36;
++pub const SYS_readlinkat: ::c_long = 78;
++pub const SYS_fchmodat: ::c_long = 53;
++pub const SYS_faccessat: ::c_long = 48;
++pub const SYS_pselect6: ::c_long = 72;
++pub const SYS_ppoll: ::c_long = 73;
++pub const SYS_unshare: ::c_long = 97;
++pub const SYS_set_robust_list: ::c_long = 99;
++pub const SYS_get_robust_list: ::c_long = 100;
++pub const SYS_splice: ::c_long = 76;
++pub const SYS_tee: ::c_long = 77;
++pub const SYS_sync_file_range: ::c_long = 84;
++pub const SYS_vmsplice: ::c_long = 75;
++pub const SYS_move_pages: ::c_long = 239;
++pub const SYS_utimensat: ::c_long = 88;
++pub const SYS_epoll_pwait: ::c_long = 22;
++pub const SYS_timerfd_create: ::c_long = 85;
++pub const SYS_fallocate: ::c_long = 47;
++pub const SYS_timerfd_settime: ::c_long = 86;
++pub const SYS_timerfd_gettime: ::c_long = 87;
++pub const SYS_accept4: ::c_long = 242;
++pub const SYS_signalfd4: ::c_long = 74;
++pub const SYS_eventfd2: ::c_long = 19;
++pub const SYS_epoll_create1: ::c_long = 20;
++pub const SYS_dup3: ::c_long = 24;
++pub const SYS_pipe2: ::c_long = 59;
++pub const SYS_inotify_init1: ::c_long = 26;
++pub const SYS_preadv: ::c_long = 69;
++pub const SYS_pwritev: ::c_long = 70;
++pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
++pub const SYS_perf_event_open: ::c_long = 241;
++pub const SYS_recvmmsg: ::c_long = 243;
++pub const SYS_fanotify_init: ::c_long = 262;
++pub const SYS_fanotify_mark: ::c_long = 263;
++pub const SYS_prlimit64: ::c_long = 261;
++pub const SYS_name_to_handle_at: ::c_long = 264;
++pub const SYS_open_by_handle_at: ::c_long = 265;
++pub const SYS_clock_adjtime: ::c_long = 266;
++pub const SYS_syncfs: ::c_long = 267;
++pub const SYS_sendmmsg: ::c_long = 269;
++pub const SYS_setns: ::c_long = 268;
++pub const SYS_getcpu: ::c_long = 168;
++pub const SYS_process_vm_readv: ::c_long = 270;
++pub const SYS_process_vm_writev: ::c_long = 271;
++pub const SYS_kcmp: ::c_long = 272;
++pub const SYS_finit_module: ::c_long = 273;
++pub const SYS_sched_setattr: ::c_long = 274;
++pub const SYS_sched_getattr: ::c_long = 275;
++pub const SYS_renameat2: ::c_long = 276;
++pub const SYS_seccomp: ::c_long = 277;
++pub const SYS_getrandom: ::c_long = 278;
++pub const SYS_memfd_create: ::c_long = 279;
++pub const SYS_bpf: ::c_long = 280;
++pub const SYS_execveat: ::c_long = 281;
++pub const SYS_userfaultfd: ::c_long = 282;
++pub const SYS_membarrier: ::c_long = 283;
++pub const SYS_mlock2: ::c_long = 284;
++pub const SYS_copy_file_range: ::c_long = 285;
++pub const SYS_preadv2: ::c_long = 286;
++pub const SYS_pwritev2: ::c_long = 287;
++pub const SYS_pkey_mprotect: ::c_long = 288;
++pub const SYS_pkey_alloc: ::c_long = 289;
++pub const SYS_pkey_free: ::c_long = 290;
++pub const SYS_statx: ::c_long = 291;
+diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
+index 6473a041ee6..c0cfd1f866d 100644
+--- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
++++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
+@@ -1031,7 +1031,8 @@ cfg_if! {
+                         target_arch = "powerpc64",
+                         target_arch = "mips64",
+                         target_arch = "s390x",
+-                        target_arch = "sparc64"))] {
++                        target_arch = "sparc64",
++                        target_arch = "riscv64"))] {
+         mod b64;
+         pub use self::b64::*;
+     } else {
diff --git a/patches/u-rustc-llvm-cross-flags.patch b/patches/u-rustc-llvm-cross-flags.patch
new file mode 100644 (file)
index 0000000..46381bf
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/librustc_llvm/build.rs
++++ b/src/librustc_llvm/build.rs
+@@ -229,7 +229,7 @@
+         if lib.starts_with("-LIBPATH:") {
+             println!("cargo:rustc-link-search=native={}", &lib[9..]);
+         } else if is_crossed {
+-            if lib.starts_with("-L") {
++            if lib.starts_with("-L") && lib[2..].contains(&host) {
+                 println!("cargo:rustc-link-search=native={}",
+                          lib[2..].replace(&host, &target));
+             }
diff --git a/patches/u-test-python-3.patch b/patches/u-test-python-3.patch
new file mode 100644 (file)
index 0000000..48c9891
--- /dev/null
@@ -0,0 +1,6 @@
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+@@ -1,2 +1,2 @@
+ all:
+-      python2.7 test.py
++      python3 test.py
diff --git a/patches/u-tests-ignore-arm.patch b/patches/u-tests-ignore-arm.patch
new file mode 100644 (file)
index 0000000..c02b936
--- /dev/null
@@ -0,0 +1,12 @@
+Bug: https://github.com/rust-lang/rust/issues/67242
+Description: this test is new in 1.40 and the failure is present on many
+ previous rust versions without users having complained or noticed, so
+ just ignore the failure until upstream fixes it
+--- a/src/test/run-make-fulldeps/foreign-exceptions/Makefile
++++ b/src/test/run-make-fulldeps/foreign-exceptions/Makefile
+@@ -1,3 +1,5 @@
++# ignore-arm
++
+ -include ../tools.mk
+ all: foo
diff --git a/patches/u-wasm32-libc-1625.patch b/patches/u-wasm32-libc-1625.patch
new file mode 100644 (file)
index 0000000..16026f2
--- /dev/null
@@ -0,0 +1,62 @@
+From 93743ca83972e33411c2812dc285840006d21140 Mon Sep 17 00:00:00 2001
+From: Alex Crichton <alex@alexcrichton.com>
+Date: Mon, 16 Dec 2019 07:57:52 -0800
+Subject: [PATCH] Update bindings for the wasm32-wasi target
+
+This commit performs a number of updates for libc with the `wasm32-wasi`
+target:
+
+* Updates the `wasi-libc` repository commit used (previously known as
+  `wasi-sysroot`)
+* Updates the container to Ubuntu 19.10 which has Clang 9 packaged which
+  is all we need.
+* Avoids building `wasmtime` and instead downloads a precompiled binary.
+* Updates bindings in `src/wasi.rs` to match the current upstream state.
+---
+ ci/docker/wasm32-wasi/Dockerfile | 82 ++++++--------------------------
+ ci/docker/wasm32-wasi/clang.sh   |  2 +-
+ ci/run.sh                        |  6 +--
+ libc-test/build.rs               |  6 ++-
+ src/wasi.rs                      | 13 ++---
+ 5 files changed, 28 insertions(+), 81 deletions(-)
+
+diff --git a/src/wasi.rs b/src/wasi.rs
+index 2e0914dcadc..081141e44d2 100644
+--- a/vendor/libc/src/wasi.rs
++++ b/vendor/libc/src/wasi.rs
+@@ -174,9 +174,9 @@ pub const EXIT_FAILURE: c_int = 1;
+ pub const STDIN_FILENO: c_int = 0;
+ pub const STDOUT_FILENO: c_int = 1;
+ pub const STDERR_FILENO: c_int = 2;
+-pub const SEEK_SET: c_int = 2;
+-pub const SEEK_CUR: c_int = 0;
+-pub const SEEK_END: c_int = 1;
++pub const SEEK_SET: c_int = 0;
++pub const SEEK_CUR: c_int = 1;
++pub const SEEK_END: c_int = 2;
+ pub const _IOFBF: c_int = 0;
+ pub const _IONBF: c_int = 2;
+ pub const _IOLBF: c_int = 1;
+@@ -207,8 +207,8 @@ pub const AT_EACCESS: c_int = 0x0;
+ pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1;
+ pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
+ pub const AT_REMOVEDIR: c_int = 0x4;
+-pub const UTIME_OMIT: c_long = 1073741822;
+-pub const UTIME_NOW: c_long = 1073741823;
++pub const UTIME_OMIT: c_long = 0xfffffffe;
++pub const UTIME_NOW: c_long = 0xffffffff;
+ pub const E2BIG: c_int = 1;
+ pub const EACCES: c_int = 2;
+@@ -728,11 +728,8 @@ extern "C" {
+     pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;
+     pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;
+     pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
+-    pub fn __wasilibc_init_preopen();
+     pub fn __wasilibc_find_relpath(
+         path: *const c_char,
+-        rights_base: __wasi_rights_t,
+-        rights_inheriting: __wasi_rights_t,
+         relative_path: *mut *const c_char,
+     ) -> c_int;
+     pub fn __wasilibc_tell(fd: c_int) -> ::off_t;
diff --git a/prune-checksums b/prune-checksums
new file mode 100755 (executable)
index 0000000..0c895cf
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/python3
+# Copyright: 2015-2017 The Debian Project
+# License: MIT or Apache-2.0
+#
+# Helper to remove removed-files from .cargo-checksum
+# TODO: rewrite to perl and add to dh-cargo, maybe?
+
+from collections import OrderedDict
+import argparse
+import json
+import os
+import sys
+
+def prune_keep(cfile):
+    with open(cfile) as fp:
+        sums = json.load(fp, object_pairs_hook=OrderedDict)
+
+    oldfiles = sums["files"]
+    newfiles = OrderedDict([entry for entry in oldfiles.items() if os.path.exists(entry[0])])
+    sums["files"] = newfiles
+
+    if len(oldfiles) == len(newfiles):
+        return
+
+    with open(cfile, "w") as fp:
+        json.dump(sums, fp, separators=(',', ':'))
+
+def prune(cfile):
+    with open(cfile, "r+") as fp:
+        sums = json.load(fp, object_pairs_hook=OrderedDict)
+        sums["files"] = {}
+        fp.seek(0)
+        json.dump(sums, fp, separators=(',', ':'))
+        fp.truncate()
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser()
+    parser.add_argument("-k", "--keep", action="store_true", help="keep "
+        "checksums of files that still exist, and assume they haven't changed.")
+    parser.add_argument('crates', nargs=argparse.REMAINDER,
+        help="crates whose checksums to prune. (default: ./)")
+    args = parser.parse_args(sys.argv[1:])
+    crates = args.crates or ["."]
+    f = prune_keep if args.keep else prune
+    for c in crates:
+        cfile = os.path.join(c, ".cargo-checksum.json") if os.path.isdir(c) else c
+        f(cfile)
diff --git a/prune-unused-deps b/prune-unused-deps
new file mode 100755 (executable)
index 0000000..ac43fe6
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Run this script in an unpacked upstream tarball directory, and it will update
+# (i.e. overwrite) the "unused deps" part of Files-Excluded in d/copyright.
+
+set -e
+
+scriptdir=$(dirname "$(dirname "$(readlink -f "$0")")")
+had_config_toml=$(if test -e "$scriptdir/debian/config.toml"; then echo true; else echo false; fi)
+
+( cd "$scriptdir" && debian/rules debian/config.toml )
+cp "$scriptdir/debian/config.toml" config.toml
+
+for i in "$scriptdir/debian/patches"/d-00*.patch; do
+       "$scriptdir/debian/ensure-patch" -N "$i"
+done
+test -f Cargo.lock.orig || cp Cargo.lock Cargo.lock.orig
+rm -f Cargo.lock
+./x.py build nonexistent/path/to/trigger/cargo/metadata src/bootstrap
+
+massage_lock_file() {
+       sed -z -e 's/\nname = /name = /g' -e 's/\nversion = /version = /g' "$1"
+}
+
+not_needed() {
+       diff -ru <(massage_lock_file Cargo.lock.orig) <(massage_lock_file Cargo.lock) \
+         | sed -ne 's/-\[\[package\]\]name = "\(.*\)"version = "\(.*\)"/\1 \2/gp'
+}
+
+ghetto_parse_cargo() {
+       cat "$1" \
+        | tr '\n' '\t' \
+        | sed -e 's/\t\[/\n[/g' \
+        | perl -ne 'print if s/^\[(?:package|project)\].*\tname\s*=\s*"(.*?)".*\tversion\s*=\s*"(.*?)".*/\1 \2/g'
+}
+
+pruned_paths() {
+       for i in vendor/*/Cargo.toml; do
+               pkgnamever=
+               pkgnamever=$(ghetto_parse_cargo "$i")
+               if [ -z "$pkgnamever" ]; then
+                       echo >&2 "failed to parse: $i"
+                       exit 1
+               fi
+               echo "$pkgnamever $i"
+       done | grep -F -f <(not_needed) | cut '-d ' -f3 | while read x; do
+               echo " $(dirname $x)"
+       done
+}
+
+header='# DO NOT EDIT below, AUTOGENERATED'
+footer='# DO NOT EDIT above, AUTOGENERATED'
+{
+echo "$header"
+pruned_paths
+echo "$footer"
+} > $scriptdir/debian/copyright.unused-deps
+
+cd $scriptdir/debian
+sed -i -e "/^$header/,/^$footer/d" -e '/^# unused dependencies/rcopyright.unused-deps' copyright
+rm copyright.unused-deps
+$had_config_toml || rm "$scriptdir/debian/config.toml"
diff --git a/rules b/rules
new file mode 100755 (executable)
index 0000000..a54267c
--- /dev/null
+++ b/rules
@@ -0,0 +1,439 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/vendor.mk
+include /usr/share/dpkg/architecture.mk
+SED_VERSION_SHORT := sed -re 's/([^.]+)\.([^.]+)\..*/\1.\2/'
+RUST_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | $(SED_VERSION_SHORT))
+RUST_LONG_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -re 's/([^+]+).*/\1/')
+LIBSTD_PKG := libstd-rust-$(RUST_VERSION)
+# Sed expression that matches the "rustc" we have in our Build-Depends field
+SED_RUSTC_BUILDDEP := sed -ne "/^Build-Depends:/,/^[^[:space:]\#]/{/^ *rustc:native .*,/p}" debian/control
+# Version of /usr/bin/rustc
+LOCAL_RUST_VERSION := $(shell rustc --version --verbose | sed -ne 's/^release: //p')
+
+include /usr/share/dpkg/buildflags.mk
+# TODO: more correct to use `[build] rustflags = []` list syntax in Cargo.toml
+RUSTFLAGS = $(addprefix -C link-args=,$(LDFLAGS))
+RUSTFLAGS += --cap-lints warn --remap-path-prefix=$(CURDIR)=/usr/src/rustc-$(RUST_LONG_VERSION)
+export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
+export CARGO_HOME = $(CURDIR)/debian/cargo
+ifneq (,$(filter $(DEB_BUILD_ARCH), sparc64))
+export CARGO_INCREMENTAL = 0
+endif
+
+# Defines DEB_*_RUST_TYPE triples
+include debian/architecture.mk
+export DEB_HOST_RUST_TYPE
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_DESTDIR := $(CURDIR)/debian/tmp
+
+# Use system LLVM (comment out to use vendored LLVM)
+LLVM_VERSION = 7
+OLD_LLVM_VERSION = 9
+# Make it easier to test against a custom LLVM
+ifneq (,$(LLVM_DESTDIR))
+LLVM_LIBRARY_PATH := $(LLVM_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(LLVM_DESTDIR)/usr/lib
+LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(LLVM_LIBRARY_PATH),$(LLVM_LIBRARY_PATH))
+export LD_LIBRARY_PATH
+endif
+
+RUSTBUILD = RUST_BACKTRACE=1 python3 src/bootstrap/bootstrap.py
+RUSTBUILD_FLAGS = --config debian/config.toml -vvv --on-fail env
+RUSTBUILD_TEST = $(RUSTBUILD) test --no-fail-fast
+# To run a specific test, run something like:
+#   $ debian/rules override_dh_auto_test-arch \
+#     RUSTBUILD_TEST_FLAGS="src/test/run-make --test-args extern-fn-struct"
+# See src/bootstrap/README.md for more options.
+RUSTBUILD_TEST_FLAGS =
+
+update-version:
+       oldver=$(shell $(SED_RUSTC_BUILDDEP) | sed -ne 's/.*(<= \(.*\)).*/\1/gp' | $(SED_VERSION_SHORT)); \
+       newver=$(RUST_VERSION); \
+       debian/update-version.sh $$oldver $$newver $(RUST_LONG_VERSION) $(CARGO_NEW)
+
+# Below we detect how we're supposed to bootstrap the stage0 compiler. See
+# README.Debian for more details of the cases described below.
+#
+PRECONFIGURE_CHECK = :
+HAVE_BINARY_TARBALL := $(shell ls -1 stage0/*/*$(DEB_HOST_RUST_TYPE)* 2>/dev/null | wc -l)
+DOWNLOAD_BOOTSTRAP := false
+# allow not using the binary tarball although it exists
+#ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386 powerpc ppc64el s390x))
+#  HAVE_BINARY_TARBALL := 0
+#endif
+ifeq (0,$(HAVE_BINARY_TARBALL))
+    # Case A (Building from source): the extracted source tree does not include
+    # a bootstrapping tarball for the current architecture e.g. because the
+    # distro already has a rustc for this arch, or the uploader expects that
+    # this requirement be fulfilled in some other way.
+    #
+    # Case A-1: the builder did not select the "pkg.rustc.dlstage0" build profile.
+    # In this case, we use the distro's rustc - either the previous or current version.
+    ifeq (,$(findstring pkg.rustc.dlstage0,$(DEB_BUILD_PROFILES)))
+        # Make it easier to test against a custom rustc
+        ifneq (,$(RUST_DESTDIR))
+        RUST_LIBRARY_PATH := $(RUST_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(RUST_DESTDIR)/usr/lib
+        LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(RUST_LIBRARY_PATH),$(RUST_LIBRARY_PATH))
+        export LD_LIBRARY_PATH
+        endif
+    #
+    # Case A-2: the builder selected the "dlstage0" build profile.
+    # In this case, the rust build scripts will download a stage0 into stage0/ and use that.
+    # We don't need to do anything specific in this build file, so this case is empty.
+    else
+        DOWNLOAD_BOOTSTRAP := true
+    endif
+else
+    # Case B (Bootstrapping a new distro): the extracted source tree does
+    # include a bootstrapping tarball for the current architecture; see the
+    # `source_orig-stage0` target below on how to build this.
+    #
+    # In this case, we'll bootstrap from the stage0 given in that tarball.
+    # To ensure the uploader of the .dsc didn't make a mistake, we first check
+    # that rustc isn't a Build-Depends for the current architecture.
+    ifneq (,$(shell $(SED_RUSTC_BUILDDEP)))
+    ifeq (,$(shell $(SED_RUSTC_BUILDDEP) | grep '!$(DEB_HOST_ARCH)'))
+        PRECONFIGURE_CHECK = $(error found matches for stage0/*/*$(DEB_HOST_RUST_TYPE)*, \
+          but rustc might be a Build-Depends for $(DEB_HOST_ARCH))
+    endif
+    endif
+endif
+
+BUILD_DOCS := true
+ifneq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
+  BUILD_DOCS := false
+endif
+ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
+  BUILD_DOCS := false
+endif
+
+#BUILD_WASM := true
+BUILD_WASM := false
+ifneq (,$(findstring nowasm,$(DEB_BUILD_PROFILES)))
+  BUILD_WASM := false
+endif
+
+MAKE_OPTIMISATIONS := true
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+  MAKE_OPTIMISATIONS := false
+endif
+
+# Build products or non-source files in src/, that shouldn't go in rust-src
+SRC_CLEAN = src/bootstrap/bootstrap.pyc \
+       src/etc/__pycache__/
+
+# Workaround for linux #865549
+ifeq (0,$(shell test $$(uname -s) = "Linux" -a $$(getconf PAGESIZE) -gt 4096; echo $$?))
+  SYSTEM_WORKAROUNDS += ulimit -s $$(expr $$(getconf PAGESIZE) / 1024 '*' 256 + 8192);
+endif
+# Try to work around #933045
+ifneq (,$(filter $(DEB_BUILD_ARCH), mips mipsel))
+  SYSTEM_WORKAROUNDS += export MALLOC_ARENA_MAX=1;
+endif
+
+%:
+       $(SYSTEM_WORKAROUNDS) dh $@ --parallel
+
+.PHONY: build
+build:
+       $(SYSTEM_WORKAROUNDS) dh $@ --parallel
+
+override_dh_clean:
+       # Upstream contains a lot of these
+       dh_clean -XCargo.toml.orig
+
+debian/config.toml: debian/config.toml.in debian/rules
+       u="$(DEB_VERSION_UPSTREAM)"; \
+       if [ "$$u" != "$${u%~beta.*+dfsg*}" ]; then channel="beta"; \
+       else channel="stable"; fi; echo $$channel; \
+       m4  -DRELEASE_CHANNEL="$$channel" \
+               -DDEB_BUILD_RUST_TYPE="$(DEB_BUILD_RUST_TYPE)" \
+               -DDEB_HOST_RUST_TYPE="$(DEB_HOST_RUST_TYPE)" \
+               -DDEB_TARGET_RUST_TYPE="$(DEB_TARGET_RUST_TYPE)" \
+               -DDEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
+               -DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
+               -DDEB_TARGET_GNU_TYPE="$(DEB_TARGET_GNU_TYPE)" \
+               -DMAKE_OPTIMISATIONS="$(MAKE_OPTIMISATIONS)" \
+               -DLLVM_DESTDIR="$(LLVM_DESTDIR)" \
+               -DLLVM_VERSION="$(LLVM_VERSION)" \
+               -DRUST_DESTDIR="$(RUST_DESTDIR)" \
+               "$<" > "$@"
+       if $(DOWNLOAD_BOOTSTRAP) || [ $(HAVE_BINARY_TARBALL) != 0 ]; \
+         then sed -i -e '/^rustc = /d' -e '/^cargo = /d' "$@"; fi
+# Work around low-memory (32-bit) architectures: https://github.com/rust-lang/rust/issues/45854
+ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel i386 mips mipsel powerpc powerpcspe))
+       sed -i -e 's/^debuginfo-level = .*/debuginfo-level = 0/g' "$@"
+endif
+
+debian/rust-src.%: debian/rust-src.%.in
+       m4  -DRUST_LONG_VERSION="$(RUST_LONG_VERSION)" \
+               "$<" > "$@"
+
+debian/dh_auto_configure.stamp: debian/config.toml
+       # fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog
+       #! grep --color=always -i 'll\(..\|d\)-\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude=changelog --exclude='*.patch' --exclude-dir='.debhelper' -R debian
+       # fail the build if we accidentally vendored openssl, indicates we pulled in unnecessary dependencies
+       test ! -e vendor/openssl
+       # fail the build if we didn't update d-ignore-error-detail-diff.patch
+       ! grep -Ri '\$$SRC_DIR' src/test/
+       # fail the build if our version contains ~exp and we are not releasing to experimental
+       v="$(DEB_VERSION)"; test "$$v" = "$${v%~exp*}" -o "$(DEB_DISTRIBUTION)" = "experimental" -o "$(DEB_DISTRIBUTION)" = "UNRELEASED"
+       $(PRECONFIGURE_CHECK)
+       if [ -d stage0 ]; then mkdir -p build && ln -sfT ../stage0 build/cache; fi
+       # work around #842634
+       if test $$(grep "127.0.0.1\s*localhost" /etc/hosts | wc -l) -gt 1; then \
+         debian/ensure-patch -N debian/patches/d-host-duplicates.patch; fi
+       # work around https://github.com/rust-lang/rust/issues/59264
+       # We patched some crates so have to rm the checksums
+       find vendor -name .cargo-checksum.json -execdir "$(CURDIR)/debian/prune-checksums" "{}" +
+       # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16
+       echo 'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > vendor/lzma-sys/build.rs
+       # We don't run ./configure because we use debian/config.toml directly
+       ln -sf debian/config.toml config.toml
+       touch "$@"
+
+override_dh_auto_configure-arch: debian/dh_auto_configure.stamp
+override_dh_auto_configure-indep: debian/dh_auto_configure.stamp
+ifeq (true,$(BUILD_DOCS))
+# Change config.toml now and not later, since that might trigger a rebuild
+       sed -i -e 's/^docs = false/docs = true/' debian/config.toml
+endif
+
+override_dh_auto_clean:
+       $(RM) -rf build tmp .cargo debian/cargo_home config.stamp config.mk Makefile
+       $(RM) -rf $(TEST_LOG) debian/config.toml debian/rust-src.install debian/rust-src.links debian/*.stamp
+       $(RM) -rf $(SRC_CLEAN) config.toml
+
+debian/dh_auto_build.stamp:
+       $(RUSTBUILD) build $(RUSTBUILD_FLAGS)
+
+override_dh_auto_build-arch: debian/dh_auto_build.stamp
+override_dh_auto_build-indep: debian/dh_auto_build.stamp
+ifeq (true,$(BUILD_WASM))
+       $(RUSTBUILD) build $(RUSTBUILD_FLAGS) \
+         --host $(DEB_BUILD_RUST_TYPE) \
+         --target wasm32-unknown-unknown,wasm32-wasi \
+         src/libstd
+endif
+ifeq (true,$(BUILD_DOCS))
+       $(RUSTBUILD) doc $(RUSTBUILD_FLAGS)
+endif
+
+TEST_LOG = debian/rustc-tests.log
+# This is advertised as "5 tests failed" in README.Debian because our counting
+# method is imprecise and in practise we count some failures twice.
+FAILURES_ALLOWED = 8
+ifneq (,$(filter $(DEB_BUILD_ARCH), ppc64 arm64 mips64el i386))
+  FAILURES_ALLOWED = 12
+endif
+ifneq (,$(filter $(DEB_BUILD_ARCH), mips mipsel s390x))
+  FAILURES_ALLOWED = 24
+endif
+ifneq (,$(filter $(DEB_BUILD_ARCH), powerpc powerpcspe riscv64 sparc64 x32))
+  FAILURES_ALLOWED = 180
+endif
+FAILED_TESTS = grep "FAILED\|^command did not execute successfully" $(TEST_LOG) | grep -v '^test result: FAILED'
+override_dh_auto_test-arch:
+       # ensure that rustc_llvm is actually dynamically linked to libLLVM
+       set -e; find build/*/stage2/lib/rustlib/* -name '*rustc_llvm*.so' | \
+       while read x; do \
+               stat -c '%s %n' "$$x"; \
+               objdump -p "$$x" | grep -q "NEEDED.*LLVM"; \
+               test "$$(stat -c %s "$$x")" -lt 6000000; \
+       done
+ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES)))
+ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       { $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS); echo $$?; } | tee -a $(TEST_LOG)
+       # test that the log has at least 1 pass, to prevent e.g. #57709
+       grep -l "^test .* \.\.\. ok$$" $(TEST_LOG)
+       echo "==== Debian rustc test report ===="; \
+       echo "Specific test failures:"; \
+       $(FAILED_TESTS); \
+       num_failures=$$($(FAILED_TESTS) | wc -l); \
+       exit_code=$$(tail -n1 $(TEST_LOG)); \
+       echo "Summary: exit code $$exit_code, counted $$num_failures tests failed."; \
+       echo -n "$(FAILURES_ALLOWED) maximum allowed. "; \
+       if test "$$num_failures" -eq 0 -a "$$exit_code" -ne 0; then \
+         echo "Aborting just in case, because we missed counting some test failures."; \
+         echo "This could happen if we failed to build the tests, or if the testsuite runner is buggy."; \
+         false; \
+       elif test "$$num_failures" -le $(FAILURES_ALLOWED); then \
+         echo "Continuing..."; \
+       else \
+         echo "Aborting the build."; \
+         echo "Check the logs further above for details."; \
+         false; \
+       fi
+# don't continue if RUSTBUILD_TEST_FLAGS is non-empty
+       test -z "$(RUSTBUILD_TEST_FLAGS)"
+endif
+endif
+
+override_dh_auto_test-indep:
+ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES)))
+ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq (true,$(BUILD_WASM))
+       # Ignore failures in these tests, but run them so we see what it's like
+       -PATH=$(CURDIR)/debian/bin:$(PATH) $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS) \
+         --host $(DEB_BUILD_RUST_TYPE) \
+         --target wasm32-unknown-unknown,wasm32-wasi \
+         src/libstd
+endif
+ifeq (true,$(BUILD_DOCS))
+       # Run all rules that test the docs, i.e. that depend on default:doc
+       $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) src/tools/linkchecker
+endif
+       test -z "$(RUSTBUILD_TEST_FLAGS)"
+endif
+endif
+
+run_rustbuild:
+       DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) $(X_CMD) $(RUSTBUILD_FLAGS) $(X_FLAGS)
+
+debian/dh_auto_install.stamp:
+       DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS)
+
+       mkdir -p $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
+       mv $(DEB_DESTDIR)/usr/lib/lib*.so $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
+
+       # Replace duplicated compile-time/run-time dylibs with symlinks
+       @set -e; \
+       for f in $(DEB_DESTDIR)/usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/lib*.so; do \
+         name=$${f##*/}; \
+         if [ -f "$(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/$$name" ]; then \
+           echo "ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f"; \
+           ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f; \
+         fi; \
+       done
+
+       touch "$@"
+
+override_dh_auto_install-arch: debian/dh_auto_install.stamp
+override_dh_auto_install-indep: debian/dh_auto_install.stamp
+ifeq (true,$(BUILD_WASM))
+       DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS) \
+         --host $(DEB_BUILD_RUST_TYPE) \
+         --target wasm32-unknown-unknown,wasm32-wasi \
+         src/libstd
+endif
+ifeq (true,$(BUILD_DOCS))
+       # Brute force to remove privacy-breach-logo lintian warning.
+       # We could have updated the upstream sources but it would complexify
+       # the rebase
+       @set -e; \
+       find $(DEB_DESTDIR)/usr/share/doc/*/html -iname '*.html' | \
+       while read file; do \
+         topdir=$$(echo "$$file" | sed 's,^$(DEB_DESTDIR)/usr/share/doc/rust/html/,,; s,/[^/]*$$,/,; s,^[^/]*$$,,; s,[^/]\+/,../,g'); \
+         sed -i \
+           -e "s,https://\(doc\|www\).rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," \
+           -e 's,<img src="https://img.shields.io/[^"]*" alt="\([^"]*\)" />,<span class="deb-privacy-replace--shields-io">\1</span>,g' "$$file"; \
+       done
+       find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock -o -name '*.inc' \) -delete;
+endif
+
+override_dh_install-arch:
+       dh_install
+       dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/
+       dh_install -plibstd-rust-dev usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/
+
+override_dh_install-indep: debian/rust-src.install debian/rust-src.links
+       dh_install
+ifeq (true,$(BUILD_WASM))
+       dh_install -plibstd-rust-dev-wasm32-cross usr/lib/rustlib/wasm32-*/lib/
+endif
+       chmod -x \
+         debian/rust-gdb/usr/share/rust-gdb/*.py \
+         debian/rust-lldb/usr/share/rust-lldb/*.py
+       $(RM) -rf $(SRC_CLEAN:%=debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION)/%)
+       # Get rid of lintian warnings
+       find debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION) \
+               \( -name .gitignore \
+               -o -name 'LICENSE*' \
+               -o -name 'LICENCE' \
+               -o -name 'license' \
+               -o -name 'COPYING*' \
+               \) -delete
+       # Remove files that autoload remote resources, caught by lintian
+       $(RM) -rf debian/rust-src/usr/src/rustc-*/vendor/cssparser/docs/*.html
+       $(RM) -rf debian/rust-src/usr/src/rustc-*/vendor/kuchiki/docs/*.html
+       $(RM) -rf debian/rust-src/usr/src/rustc-*/vendor/url/docs/*.html
+       $(RM) -rf debian/rust-src/usr/src/rustc-*/vendor/xz2/.gitmodules
+
+override_dh_installchangelogs:
+       dh_installchangelogs RELEASES.md
+
+override_dh_installdocs:
+       dh_installdocs -X.tex -X.aux -X.log -X.out -X.toc
+
+override_dh_missing:
+       dh_missing --list-missing
+
+override_dh_compress:
+       dh_compress -X.woff
+
+# The below override is disabled on advice from #debian-devel, because:
+# - only shared libs get the "split dbgsym package" treatment by dh_strip;
+#   static libs simply get their debuginfo discarded
+# - strip(1) sometimes breaks wasm libs
+#
+#override_dh_strip:
+#      # Work around #35733, #468333
+#      find debian/libstd-rust-dev*/ -name '*.rlib' -execdir mv '{}' '{}.a' \;
+#      # This is expected to print out lots of "File format unrecognized" warnings about
+#      # rust.metadata.bin and *.deflate but the .o files inside the rlibs should be stripped
+#      # Some files are still omitted because of #875780 however.
+#      dh_strip -v
+#      find debian/libstd-rust-dev*/ -name '*.rlib.a' -execdir sh -c 'mv "$$1" "$${1%.a}"' - '{}' \;
+
+override_dh_makeshlibs:
+       dh_makeshlibs -V
+
+       # dh_makeshlibs doesn't support our "libfoo-version.so" naming
+       # structure, so we have to do this ourselves.
+       install -o 0 -g 0 -d debian/$(LIBSTD_PKG)/DEBIAN
+       LC_ALL=C ls debian/$(LIBSTD_PKG)/usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so | \
+       sed -n 's,^.*/\(lib.*\)-\(.\+\)\.so$$,\1 \2,p' | \
+       while read name version; do \
+         echo "$$name $$version $(LIBSTD_PKG) (>= $(DEB_VERSION_UPSTREAM))"; \
+       done > debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+       chmod 644 debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+       chown 0:0 debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+
+override_dh_shlibdeps:
+       dh_shlibdeps -- -x$(LIBSTD_PKG)
+
+QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE = x=$$?; if [ $$x = 2 ]; then exit 0; else exit $$x; fi
+source_orig-stage0:
+       QUILT_PATCHES=debian/patches quilt push -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE)
+       $(MAKE) -f debian/rules clean
+       debian/make_orig-stage0_tarball.sh
+       QUILT_PATCHES=debian/patches quilt pop -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE)
+       rm -rf .pc
+
+get_beta_version = \
+       u="$(DEB_VERSION_UPSTREAM)"; \
+       if [ "$$u" != "$${u%~beta.*+dfsg*}" ]; then \
+       newver=$(shell echo $(RUST_VERSION) | perl -lpe 's/(\d+)\.(\d+)/$$1 . "." . ($$2)/e'); \
+       else \
+       newver=$(shell echo $(RUST_VERSION) | perl -lpe 's/(\d+)\.(\d+)/$$1 . "." . ($$2+1)/e'); \
+       fi
+
+debian/watch-beta: debian/watch-beta.in debian/rules
+       set -e; $(get_beta_version); \
+       m4 -DOLDVER="$$oldver" -DNEWVER="$$newver.0" "$<" > "$@"
+
+source_orig-beta: debian/watch-beta
+       uscan $(USCAN_OPTS) $(if $(USCAN_DESTDIR),--destdir=$(USCAN_DESTDIR),) --verbose --watchfile "$<"
+       set -e; $(get_beta_version); \
+       bd="$(if $(USCAN_DESTDIR),$(USCAN_DESTDIR),..)"; \
+       tar xf $$bd/rustc-$$newver.0-beta.999-src.tar.xz rustc-beta-src/version; \
+       bv="$$(sed -re 's/[0-9]+.[0-9]+.[0-9]+-beta.([0-9]+) \(.*\)/\1/g' rustc-beta-src/version)"; \
+       bash -c 'shopt -s nullglob; for i in '"$$bd"'/rustc*beta.999*; do mv $$i $${i/beta.999/beta.'"$$bv"'}; done'; \
+       rm -f rustc-beta-src/version; \
+       rmdir -p rustc-beta-src; \
+       echo "prepared rustc $$newver.0~beta.$$bv in $$bd"
diff --git a/rust-doc.doc-base.book b/rust-doc.doc-base.book
new file mode 100644 (file)
index 0000000..80c3e08
--- /dev/null
@@ -0,0 +1,13 @@
+Document: rust-book
+Title: The Rust Programming Language
+Section: Programming/Rust
+Abstract:
+ This book will teach you about the Rust Programming Language. Rust is
+ a modern systems programming language focusing on safety and speed. It
+ accomplishes these goals by being memory safe without using garbage
+ collection.
+
+Format: HTML
+Index: /usr/share/doc/rust-doc/html/book/index.html
+Files: /usr/share/doc/rust-doc/html/book/*.html
+       /usr/share/doc/rust-doc/html/book/*/*.html
diff --git a/rust-doc.doc-base.reference b/rust-doc.doc-base.reference
new file mode 100644 (file)
index 0000000..a538f8b
--- /dev/null
@@ -0,0 +1,11 @@
+Document: rust-reference
+Title: The Rust Reference
+Section: Programming/Rust
+Abstract:
+ This document is the primary reference for the Rust programming
+ language.
+
+Format: HTML
+Index: /usr/share/doc/rust-doc/html/reference/index.html
+Files: /usr/share/doc/rust-doc/html/reference/*.html
+       /usr/share/doc/rust-doc/html/reference/*/*.html
diff --git a/rust-doc.docs b/rust-doc.docs
new file mode 100644 (file)
index 0000000..5a0e189
--- /dev/null
@@ -0,0 +1 @@
+debian/tmp/usr/share/doc/rust/html
diff --git a/rust-doc.install b/rust-doc.install
new file mode 100644 (file)
index 0000000..de6024b
--- /dev/null
@@ -0,0 +1 @@
+debian/icons/rust-logo-32x32-blk.png usr/share/doc/rust-doc/html/
diff --git a/rust-doc.links b/rust-doc.links
new file mode 100644 (file)
index 0000000..499b8b6
--- /dev/null
@@ -0,0 +1,10 @@
+# This should eventually become part of a dh_rustdoc program.
+# Something that does e.g.
+# find $(DESTDIR) -name jquery.js -execdir ln -sf -T \
+#        /usr/share/doc/rust-doc/html/jquery.js '{}' \;
+usr/share/javascript/jquery/jquery.min.js                             usr/share/doc/rust-doc/html/jquery.min.js
+usr/share/javascript/mathjax                                          usr/share/doc/rust-doc/html/mathjax
+usr/share/javascript/highlight.js/styles/atelier-dune-light.css       usr/share/doc/rust-doc/html/highlight.css
+usr/share/javascript/highlight.js/highlight.js                        usr/share/doc/rust-doc/html/highlight.js
+usr/share/fonts-font-awesome/css/font-awesome.min.css                 usr/share/doc/rust-doc/html/font-awesome.min.css
+usr/share/fonts-font-awesome/fonts                                    usr/share/doc/rust-doc/fonts
diff --git a/rust-gdb.install b/rust-gdb.install
new file mode 100644 (file)
index 0000000..d274b0b
--- /dev/null
@@ -0,0 +1,3 @@
+src/etc/rust-gdb usr/bin/
+src/etc/gdb_*.py usr/share/rust-gdb/
+src/etc/debugger_pretty_printers_common.py usr/share/rust-gdb/
diff --git a/rust-gdb.links b/rust-gdb.links
new file mode 100644 (file)
index 0000000..51b82a4
--- /dev/null
@@ -0,0 +1 @@
+usr/share/man/man1/gdb.1.gz usr/share/man/man1/rust-gdb.1.gz
diff --git a/rust-lldb.install b/rust-lldb.install
new file mode 100644 (file)
index 0000000..a48bbb6
--- /dev/null
@@ -0,0 +1,3 @@
+src/etc/rust-lldb usr/bin/
+src/etc/lldb_rust_formatters.py usr/share/rust-lldb/
+src/etc/debugger_pretty_printers_common.py usr/share/rust-lldb/
diff --git a/rust-lldb.links b/rust-lldb.links
new file mode 100644 (file)
index 0000000..e078115
--- /dev/null
@@ -0,0 +1 @@
+usr/share/man/man1/lldb-7.1.gz usr/share/man/man1/rust-lldb.1.gz
diff --git a/rust-src.install.in b/rust-src.install.in
new file mode 100644 (file)
index 0000000..ab77d40
--- /dev/null
@@ -0,0 +1,13 @@
+debian/patches  usr/src/rustc-RUST_LONG_VERSION/debian
+# from src/bootstrap/dist.rs:370 onwards
+COPYRIGHT       usr/src/rustc-RUST_LONG_VERSION
+LICENSE-APACHE  usr/src/rustc-RUST_LONG_VERSION
+LICENSE-MIT     usr/src/rustc-RUST_LONG_VERSION
+CONTRIBUTING.md usr/src/rustc-RUST_LONG_VERSION
+README.md       usr/src/rustc-RUST_LONG_VERSION
+RELEASES.md     usr/src/rustc-RUST_LONG_VERSION
+configure       usr/src/rustc-RUST_LONG_VERSION
+x.py            usr/src/rustc-RUST_LONG_VERSION
+config.toml.example    usr/src/rustc-RUST_LONG_VERSION
+Cargo.toml      usr/src/rustc-RUST_LONG_VERSION
+src             usr/src/rustc-RUST_LONG_VERSION
diff --git a/rust-src.links.in b/rust-src.links.in
new file mode 100644 (file)
index 0000000..d323933
--- /dev/null
@@ -0,0 +1 @@
+usr/src/rustc-RUST_LONG_VERSION usr/lib/rustlib/src/rust
diff --git a/rust-src.lintian-overrides b/rust-src.lintian-overrides
new file mode 100644 (file)
index 0000000..ecdd836
--- /dev/null
@@ -0,0 +1,4 @@
+# False positives that change quite often, so just override with a wildcard
+rust-src binary: executable-not-elf-or-script usr/src/rustc-*/*
+rust-src binary: privacy-breach-generic usr/src/rustc-*/*
+rust-src binary: package-contains-eslint-config-file usr/src/rustc-*/src/librustdoc/html/static/.eslintrc.js
diff --git a/rustc.install b/rustc.install
new file mode 100644 (file)
index 0000000..c289154
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/rustc
+usr/bin/rustdoc
+debian/architecture.mk usr/share/rustc/
diff --git a/rustc.links b/rustc.links
new file mode 100644 (file)
index 0000000..0a3b2ba
--- /dev/null
@@ -0,0 +1 @@
+usr/bin/lld-7 usr/bin/rust-lld
diff --git a/rustc.manpages b/rustc.manpages
new file mode 100644 (file)
index 0000000..f153792
--- /dev/null
@@ -0,0 +1,3 @@
+debian/tmp/usr/share/man/man1/rustc.1
+debian/tmp/usr/share/man/man1/rustdoc.1
+
diff --git a/source/format b/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/source/include-binaries b/source/include-binaries
new file mode 100644 (file)
index 0000000..33bec95
--- /dev/null
@@ -0,0 +1,6 @@
+debian/icons/rust-logo-32x32-blk.png
+# if you are here because dpkg-source told you to "add stage0/rustc-** in d/source/include-binaries",
+# ignore that instruction and instead:
+# a) if you want to use the orig-stage0 for your next upload, then extract it into stage0/
+# b) if you don't want to use it, then rename "../rustc_${version}.orig-stage0.tar.xz" to something else
+# see also d/source/options and d/source/local-options and #577113.
diff --git a/source/lintian-overrides b/source/lintian-overrides
new file mode 100644 (file)
index 0000000..deef4ad
--- /dev/null
@@ -0,0 +1,7 @@
+# Long documentation
+rustc source: source-is-missing src/stdarch/crates/stdarch-verify/arm-intrinsics.html line length is * characters (>*)
+# Test data
+rustc source: source-is-missing vendor/minifier/tests/files/minified_main.js line length is * characters (>*)
+# Lintian out-of-date
+rustc source: invalid-profile-name-in-build-profiles-field nowasm *
+rustc source: invalid-profile-name-in-source-relation nowasm *
diff --git a/source/options b/source/options
new file mode 100644 (file)
index 0000000..8a8c93f
--- /dev/null
@@ -0,0 +1,4 @@
+# this helps to prevent accidentally including the orig-stage0 tarball in a non
+# orig-stage0 upload, after running `debian/rules source_orig-stage0`.
+# we can get rid of this after #577113 is fixed
+include-removal
diff --git a/update-version.sh b/update-version.sh
new file mode 100755 (executable)
index 0000000..39c2caf
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Don't run this directly, use "debian/rules update-version" instead
+
+prev_stable() {
+local V=$1
+python3 -c 'import sys; k=list(map(int,sys.argv[1].split("."))); k[1]-=1; print(".".join(map(str,k)))' "$V"
+}
+
+cargo_new() {
+local V=$1
+python3 -c 'import sys; k=list(map(int,sys.argv[1].split("."))); k[1]+='"${2:-1}"'; k[0]-=1; print(".".join(map(str,k)))' "$V"
+}
+
+update() {
+local ORIG=$1 NEW=$2 NEW_LONG=$3
+local CARGO_NEW=${4:-$(cargo_new $NEW)}
+local CARGO_NEXT=${4:-$(cargo_new $NEW 2)}
+
+ORIG_M1=$(prev_stable $ORIG)
+NEW_M1=$(prev_stable $NEW)
+ORIG_R="${ORIG/./\\.}" # match a literal dot, otherwise this might sometimes match e.g. debhelper (>= 9.20141010)
+
+sed -i -e "s|libstd-rust-${ORIG_R}|libstd-rust-$NEW|g" \
+       -e "s|rustc:native\( *\)(<= [^)]*)|rustc:native\1(<= $NEW_LONG++)|g" \
+       -e "s|rustc:native\( *\)(>= ${ORIG_M1/./\\.}|rustc:native\1(>= ${NEW_M1}|g" \
+       -e "s|cargo\( *\)(>= [^)]*)|cargo\1(>= ${CARGO_NEW}.0~~)|g" \
+       -e "s|cargo\( *\)(<< [^)]*)|cargo\1(<< ${CARGO_NEXT}.0~~)|g" \
+       control
+
+if [ "$NEW" != "$ORIG" ]; then
+git mv libstd-rust-$ORIG.lintian-overrides libstd-rust-$NEW.lintian-overrides
+fi
+sed -i -e "s|libstd-rust-${ORIG_R}|libstd-rust-$NEW|g" libstd-rust-$NEW.lintian-overrides
+}
+
+cd $(dirname "$0")
+update "$@"
diff --git a/upstream-tarball-unsuspicious.txt b/upstream-tarball-unsuspicious.txt
new file mode 100644 (file)
index 0000000..dc7c60e
--- /dev/null
@@ -0,0 +1,205 @@
+## In this file we list false-positives of the check-orig-suspicious.sh script
+# so that they can be ignored. You should manually audit all of the files here
+# to confirm that they adhere to Debian Policy and the DFSG. In particular, if
+# you are blindly adding files here just to get the build to work, you are
+# probably Doing It Wrong. Ask in #debian-rust or the mailing list for pointers.
+
+# False-positive, very small so suspicious-source thinks "octet-stream"
+src/test/run-pass/raw-str.rs
+
+# False-positive, file(1) misidentifies mime type
+src/ci/docker/*/patches/glibc/*/*.patch
+vendor/itertools*/examples/iris.data
+vendor/regex/tests/unicode.rs
+
+# False-positive, "verylongtext" but OK
+CONTRIBUTING.md
+src/doc/book/first-edition/src/the-stack-and-the-heap.md
+src/doc/book/*/tools/docx-to-md.xsl
+src/doc/embedded-book/src/*/*.md
+src/doc/rust-by-example/src/trait/dyn.md
+src/doc/rustc/src/lints/groups.md
+src/doc/rustc/src/targets/known-issues.md
+src/doc/rustc-guide/.travis.yml
+src/doc/rustc-guide/src/*.md
+src/doc/rustc-guide/src/*/*.md
+src/doc/*/CODE_OF_CONDUCT.md
+src/doc/unstable-book/src/language-features/unsized-locals.md
+src/etc/third-party/README.txt
+src/librustc_codegen_ssa/README.md
+src/libstd/sys/cloudabi/abi/cloudabi.rs
+src/libstd/os/raw/*.md
+src/libstd/sys/sgx/abi/entry.S
+vendor/*/.travis.yml
+vendor/*/Cargo.toml
+vendor/*/CHANGELOG.md
+vendor/*/CODE_OF_CONDUCT.md
+vendor/*/CONTRIBUTORS.md
+vendor/*/README.md
+vendor/*/README.tpl
+vendor/*/LICENSE
+vendor/*/*/LICENSE
+vendor/*/*/*/LICENSE
+vendor/ammonia/src/lib.rs
+vendor/clap/.github/CONTRIBUTING.md
+vendor/clap/SPONSORS.md
+# ^ author likes to omit line breaks in their comments
+vendor/failure/book/src/bail-and-ensure.md
+# ^ same with this one
+vendor/handlebars/src/lib.rs
+vendor/maplit/README.rst
+vendor/lazy_static/src/lib.rs
+vendor/pulldown-cmark/tests/suite/footnotes.rs
+vendor/pulldown-cmark/third_party/xi-editor/crdt.md
+vendor/pulldown-cmark/specs/footnotes.txt
+vendor/pulldown-cmark-*/tests/suite/footnotes.rs
+vendor/pulldown-cmark-*/third_party/xi-editor/crdt.md
+vendor/pulldown-cmark-*/specs/footnotes.txt
+vendor/rustc-demangle/src/legacy.rs
+vendor/stable_deref_trait/src/lib.rs
+vendor/unicase/src/lib.rs
+vendor/winapi-*/src/winnt.rs
+vendor/winapi/src/lib.rs
+
+# False-positive, audit-vendor-source automatically flags JS/C files
+# The below ones are OK since they're actually part of rust's own source code
+# and are not "embedded libraries".
+src/ci/docker/scripts/qemu-bare-bones-addentropy.c
+src/doc/book/*/ferris.js
+src/doc/book/ferris.js
+src/etc/wasm32-shim.js
+src/grammar/parser-lalr-main.c
+src/librustdoc/html/static/*.js
+src/librustdoc/html/static/.eslintrc.js
+src/test/auxiliary/rust_test_helpers.c
+src/test/run-make/wasm-*/*.js
+src/test/run-make-fulldeps/*.c
+src/test/run-make-fulldeps/*/*.c
+src/test/rustdoc-js/*.js
+src/test/rustdoc-js-std/*.js
+src/tools/rustdoc-js/tester.js
+src/tools/rustdoc-js-std/tester.js
+
+# Embedded libraries, justified in README.source
+vendor/backtrace-sys/src/libbacktrace/configure
+vendor/backtrace-sys/src/libbacktrace/config/libtool.m4
+vendor/backtrace-sys/src/libbacktrace/*.c
+vendor/backtrace-sys/src/android-api.c
+vendor/compiler_builtins/compiler-rt/lib/BlocksRuntime/*.c
+vendor/compiler_builtins/compiler-rt/lib/builtins/*.c
+vendor/compiler_builtins/compiler-rt/lib/builtins/*/*.c
+vendor/compiler_builtins/compiler-rt/utils/generate_*.awk
+vendor/dlmalloc/src/dlmalloc.c
+vendor/mdbook/src/theme/book.js
+vendor/mdbook/src/theme/searcher/searcher.js
+vendor/walkdir/compare/nftw.c
+vendor/walkdir-*/compare/nftw.c
+
+# False-positive, misc
+src/stdarch/.travis.yml
+src/stdarch/crates/core_arch/foo.wasm
+src/test/run-make-fulldeps/target-specs/*.json
+src/test/run-make-fulldeps/libtest-json/output.json
+vendor/clap/.mention-bot
+vendor/cloudabi/cloudabi.rs
+vendor/elasticlunr-rs/src/lang/*.rs
+vendor/markup5ever/data/entities.json
+vendor/num/ci/deploy.enc
+vendor/term-0*/scripts/id_rsa.enc
+
+# False-positive, hand-editable small image
+src/etc/installer/gfx/
+src/doc/embedded-book/src/assets/*.svg
+src/doc/embedded-book/src/assets/f3.jpg
+src/doc/embedded-book/src/assets/nrf52-memory-map.png
+src/doc/embedded-book/src/assets/nrf52-spi-frequency-register.png
+src/doc/embedded-book/src/assets/verify.jpeg
+src/doc/nomicon/src/img/safeandunsafe.svg
+src/doc/book/second-edition/src/img/*.png
+src/doc/book/second-edition/src/img/*.svg
+src/doc/book/src/img/ferris/*.svg
+src/doc/book/src/img/*.png
+src/doc/book/src/img/*.svg
+src/doc/book/2018-edition/src/img/ferris/*.svg
+src/doc/book/2018-edition/src/img/*.svg
+src/doc/book/2018-edition/src/img/*.png
+src/doc/book/tools/docx-to-md.xsl
+src/doc/rustc-guide/src/img/rustc_stages.svg
+src/librustdoc/html/static/*.svg
+src/librustdoc/html/static/rust-logo.png
+src/librustdoc/html/static/favicon.ico
+vendor/difference/assets/*.png
+vendor/fortanix-sgx-abi/images/enclave-execution-lifecycle.png
+vendor/heck/no_step_on_snek.png
+vendor/mdbook/src/theme/favicon.png
+vendor/num/doc/favicon.ico
+vendor/num/doc/rust-logo-128x128-blk-v2.png
+vendor/pest/pest-logo.svg
+vendor/pretty_assertions/examples/*.png
+vendor/termion/logo.svg
+
+# Example code
+vendor/html5ever/examples/capi/tokenize.c
+
+# Test data
+src/stdarch/ci/gba.json
+src/stdarch/crates/stdarch-verify/arm-intrinsics.html
+src/stdarch/crates/stdarch-verify/x86-intel.xml
+src/stdarch/crates/std_detect/src/detect/test_data/*.auxv
+src/test/compile-fail/not-utf8.bin
+src/test/*/*.rs
+src/test/*/issues/*.rs
+src/test/*/*/issues/*.rs
+src/test/*/*.stderr
+src/test/*/*/*.json
+src/test/*/*/*.stderr
+src/test/*/*/*.stdout
+src/test/*/*/*/*.stderr
+src/test/ui/terminal-width/non-whitespace-trimming*.rs
+src/tools/*/tests/*/*.stderr
+vendor/cssparser/src/css-parsing-tests/*.json
+vendor/cssparser/src/big-data-url.css
+vendor/elasticlunr-rs/tests/data/tr.in.txt
+vendor/flate2/tests/*.gz
+vendor/idna/tests/IdnaTest.txt
+vendor/idna/tests/punycode_tests.json
+vendor/idna-0*/tests/IdnaTest.txt
+vendor/idna-0*/tests/punycode_tests.json
+vendor/itertools/examples/iris.data
+vendor/html5ever/data/bench/*.html
+vendor/html5ever/html5lib-tests/*/*.dat
+vendor/html5ever/html5lib-tests/*/*.test
+vendor/libz-sys/src/smoke.c
+vendor/mdbook/src/theme/searcher/searcher.js
+vendor/mdbook/tests/searchindex_fixture.json
+vendor/minifier/tests/files/test.json
+vendor/minifier/tests/files/main.js
+vendor/minifier/tests/files/minified_main.js
+vendor/pest/benches/data.json
+vendor/pretty_assertions/src/format_changeset.rs
+vendor/regex/src/testdata/basic.dat
+vendor/regex/tests/crates_regex.rs
+vendor/regex/tests/fowler.rs
+vendor/regex-0*/src/testdata/basic.dat
+vendor/regex-0*/tests/fowler.rs
+vendor/rustc-demangle/src/lib.rs
+vendor/sha-1/tests/data/*.output.bin
+vendor/tar/tests/archives/*.tar
+vendor/term-0*/tests/data/*
+vendor/toml/tests/*/*.toml
+vendor/toml/tests/*/*.json
+vendor/unicode-segmentation/src/testdata.rs
+vendor/url/tests/*.json
+vendor/url-1*/tests/*.json
+vendor/yaml-rust/tests/specexamples.rs.inc
+
+# Compromise, ideally we'd autogenerate these
+# Should already by documented in debian/copyright
+src/doc/rustc-guide/src/mir/mir_*.svg
+src/librustdoc/html/static/normalize.css
+vendor/pest_meta/src/grammar.rs
+vendor/unicode-normalization/src/tables.rs
+vendor/unicode-segmentation/src/tables.rs
+
+# Compromise, ideally we'd package these in their own package
+src/librustdoc/html/static/*.woff
diff --git a/upstream/signing-key.asc b/upstream/signing-key.asc
new file mode 100644 (file)
index 0000000..93e2282
--- /dev/null
@@ -0,0 +1,86 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQINBFJEwMkBEADlPACa2K7reD4x5zd8afKx75QYKmxqZwywRbgeICeD4bKiQoJZ
+dUjmn1LgrGaXuBMKXJQhyA34e/1YZel/8et+HPE5XpljBfNYXWbVocE1UMUTnFU9
+CKXa4AhJ33f7we2/QmNRMUifw5adPwGMg4D8cDKXk02NdnqQlmFByv0vSaArR5kn
+gZKnLY6o0zZ9Buyy761Im/ShXqv4ATUgYiFc48z33G4j+BDmn0ryGr1aFdP58tHp
+gjWtLZs0iWeFNRDYDje6ODyu/MjOyuAWb2pYDH47Xu7XedMZzenH2TLM9yt/hyOV
+xReDPhvoGkaO8xqHioJMoPQi1gBjuBeewmFyTSPS4deASukhCFOcTsw/enzJagiS
+ZAq6Imehduke+peAL1z4PuRmzDPO2LPhVS7CDXtuKAYqUV2YakTq8MZUempVhw5n
+LqVaJ5/XiyOcv405PnkT25eIVVVghxAgyz6bOU/UMjGQYlkUxI7YZ9tdreLlFyPR
+OUL30E8q/aCd4PGJV24yJ1uit+yS8xjyUiMKm4J7oMP2XdBN98TUfLGw7SKeAxyU
+92BHlxg7yyPfI4TglsCzoSgEIV6xoGOVRRCYlGzSjUfz0bCMCclhTQRBkegKcjB3
+sMTyG3SPZbjTlCqrFHy13e6hGl37Nhs8/MvXUysq2cluEISn5bivTKEeeQARAQAB
+tERSdXN0IExhbmd1YWdlIChUYWcgYW5kIFJlbGVhc2UgU2lnbmluZyBLZXkpIDxy
+dXN0LWtleUBydXN0LWxhbmcub3JnPokCOAQTAQIAIgUCUkTAyQIbAwYLCQgHAwIG
+FQgCCQoLBBYCAwECHgECF4AACgkQhauW5vob5f5fYQ//b1DWK1NSGx5nZ3zYZeHJ
+9mwGCftIaA2IRghAGrNf4Y8DaPqR+w1OdIegWn8kCoGfPfGAVW5XXJg+Oxk6QIaD
+2hJojBUrq1DALeCZVewzTVw6BN4DGuUexsc53a8DcY2Yk5WE3ll6UKq/YPiWiPNX
+9r8FE2MJwMABB6mWZLqJeg4RCrriBiCG26NZxGE7RTtPHyppoVxWKAFDiWyNdJ+3
+UnjldWrT9xFqjqfXWw9Bhz8/EoaGeSSbMIAQDkQQpp1SWpljpgqvctZlc5fHhsG6
+lmzW5RM4NG8OKvq3UrBihvgzwrIfoEDKpXbk3DXqaSs1o81NH5ftVWWbJp/ywM9Q
+uMC6n0YWiMZMQ1cFBy7tukpMkd+VPbPkiSwBhPkfZIzUAWd74nanN5SKBtcnymgJ
++OJcxfZLiUkXRj0aUT1GLA9/7wnikhJI+RvwRfHBgrssXBKNPOfXGWajtIAmZc2t
+kR1E8zjBVLId7r5M8g52HKk+J+y5fVgJY91nxG0zf782JjtYuz9+knQd55JLFJCO
+hhbv3uRvhvkqgauHagR5X9vCMtcvqDseK7LXrRaOdOUDrK/Zg/abi5d+NIyZfEt/
+ObFsv3idAIe/zpU6xa1nYNe3+Ixlb6mlZm3WCWGxWe+GvNW/kq36jZ/v/8pYMyVO
+p/kJqnf9y4dbufuYBg+RLqC5Ag0EUkTAyQEQANxy2tTSeRspfrpBk9+ju+KZ3zc4
+umaIsEa5DxJ2zIKHywVAR67Um0K1YRG07/F5+tD9TIRkdx2pcmpjmSQzqdk3zqa9
+2Zzeijjz2RNyBY8qYmyE08IncjTsFFB8OnvdXcsAgjCFmI1BKnePxrABL/2k8X18
+aysPb0beWqQVsi5FsSpAHu6k1kaLKc+130x6Hf/YJAjeo+S7HeU5NeOz3zD+h5bA
+Q25qMiVHX3FwH7rFKZtFFog9Ogjzi0TkDKKxoeFKyADfIdteJWFjOlCI9KoIhfXq
+Et9JMnxApGqsJElJtfQjIdhMN4Lnep2WkudHAfwJ/412fe7wiW0rcBMvr/BlBGRY
+vM4sTgN058EwIuY9Qmc8RK4gbBf6GsfGNJjWozJ5XmXElmkQCAvbQFoAfi5TGfVb
+77QQrhrQlSpfIYrvfpvjYoqj618SbU6uBhzh758gLllmMB8LOhxWtq9eyn1rMWyR
+KL1fEkfvvMc78zP+Px6yDMa6UIez8jZXQ87Zou9EriLbzF4QfIYAqR9LUSMnLk6K
+o61tSFmFEDobC3tc1jkSg4zZe/wxskn96KOlmnxgMGO0vJ7ASrynoxEnQE8k3WwA
++/YJDwboIR7zDwTy3Jw3mn1FgnH+c7Rb9h9geOzxKYINBFz5Hd0MKx7kZ1U6WobW
+KiYYxcCmoEeguSPHABEBAAGJAh8EGAECAAkFAlJEwMkCGwwACgkQhauW5vob5f7f
+FA//Ra+itJF4NsEyyhx4xYDOPq4uj0VWVjLdabDvFjQtbBLwIyh2bm8uO3AY4r/r
+rM5WWQ8oIXQ2vvXpAQO9g8iNlFez6OLzbfdSG80AG74pQqVVVyCQxD7FanB/KGge
+tAoOstFxaCAg4nxFlarMctFqOOXCFkylWl504JVIOvgbbbyj6I7qCUmbmqazBSMU
+K8c/Nz+FNu2Uf/lYWOeGogRSBgS0CVBcbmPUpnDHLxZWNXDWQOCxbhA1Uf58hcyu
+036kkiWHh2OGgJqlo2WIraPXx1cGw1Ey+U6exbtrZfE5kM9pZzRG7ZY83CXpYWMp
+kyVXNWmf9JcIWWBrXvJmMi0FDvtgg3Pt1tnoxqdilk6yhieFc8LqBn6CZgFUBk0t
+NSaWk3PsN0N6Ut8VXY6sai7MJ0Gih1gE1xadWj2zfZ9sLGyt2jZ6wK++U881YeXA
+ryaGKJ8sIs182hwQb4qN7eiUHzLtIh8oVBHo8Q4BJSat88E5/gOD6IQIpxc42iRL
+T+oNZw1hdwNyPOT1GMkkn86l3o7klwmQUWCPm6vl1aHp3omo+GHC63PpNFO5RncJ
+Ilo3aBKKmoE5lDSMGE8KFso5awTo9z9QnVPkRsk6qeBYit9xE3x3S+iwjcSg0nie
+aAkc0N00nc9V9jfPvt4z/5A5vjHh+NhFwH5h2vBJVPdsz6m5Ag0EVI9keAEQAL3R
+oVsHncJTmjHfBOV4JJsvCum4DuJDZ/rDdxauGcjMUWZaG338ZehnDqG1Yn/ys7zE
+aKYUmqyT+XP+M2IAQRTyxwlU1RsDlemQfWrESfZQCCmbnFScL0E7cBzy4xvtInQe
+UaFgJZ1BmxbzQrx+eBBdOTDv7RLnNVygRmMzmkDhxO1IGEu1+3ETIg/DxFE7VQY0
+It/Ywz+nHu1o4Hemc/GdKxu9hcYvcRVc/Xhueq/zcIM96l0m+CFbs0HMKCj8dgMe
+Ng6pbbDjNM+cV+5BgpRdIpE2l9W7ImpbLihqcZt47J6oWt/RDRVoKOzRxjhULVyV
+2VP9ESr48HnbvxcpvUAEDCQUhsGpur4EKHFJ9AmQ4zf91gWLrDc6QmlACn9o9ARU
+fOV5aFsZI9ni1MJEInJTP37stz/uDECRie4LTL4O6P4Dkto8ROM2wzZq5CiRNfnT
+PP7ARfxlCkpg+gpLYRlxGUvRn6EeYwDtiMQJUQPfpGHSvThUlgDEsDrpp4SQSmdA
+CB+rvaRqCawWKoXs0In/9wylGorRUupeqGC0I0/rh+f5mayFvORzwy/4KK4QIEV9
+aYTXTvSRl35MevfXU1Cumlaqle6SDkLr3ZnFQgJBqap0Y+Nmmz2HfO/pohsbtHPX
+92SN3dKqaoSBvzNGY5WT3CsqxDtik37kR3f9/DHpABEBAAGJBD4EGAECAAkFAlSP
+ZHgCGwICKQkQhauW5vob5f7BXSAEGQECAAYFAlSPZHgACgkQXLSpNHs7CdwemA/+
+KFoGuFqU0uKT9qblN4ugRyil5itmTRVffl4tm5OoWkW8uDnu7Ue3vzdzy+9NV8X2
+wRG835qjXijWP++AGuxgW6LB9nV5OWiKMCHOWnUjJQ6pNQMAgSN69QzkFXVF/q5f
+bkma9TgSbwjrVMyPzLSRwq7HsT3V02Qfr4cyq39QeILGy/NHW5z6LZnBy3BaVSd0
+lGjCEc3yfH5OaB79na4W86WCV5n4IT7cojFM+LdL6P46RgmEtWSG3/CDjnJl6BLR
+WqatRNBWLIMKMpn+YvOOL9TwuP1xbqWr1vZ66wksm53NIDcWhptpp0KEuzbU0/Dt
+OltBhcX8tOmO36LrSadX9rwckSETCVYklmpAHNxPml011YNDThtBidvsicw1vZwR
+HsXn+txlL6RAIRN+J/Rw3uOiJAqN9Qgedpx2q+E15t8MiTg/FXtB9SysnskFT/BH
+z0USNKJUY0btZBw3eXWzUnZf59D8VW1M/9JwznCHAx0c9wy/gRDiwt9w4RoXryJD
+VAwZg8rwByjldoiThUJhkCYvJ0R3xH3kPnPlGXDW49E9R8C2umRC3cYOL4U9dOQ1
+5hSlYydF5urFGCLIvodtE9q80uhpyt8L/5jj9tbwZWv6JLnfBquZSnCGqFZRfXlb
+Jphk9+CBQWwiZSRLZRzqQ4ffl4xyLuolx01PMaatkQbRaw/+JpgRNlurKQ0PsTrO
+8tztO/tpBBj/huc2DGkSwEWvkfWElS5RLDKdoMVs/j5CLYUJzZVikUJRm7m7b+OA
+P3W1nbDhuID+XV1CSBmGifQwpoPTys21stTIGLgznJrIfE5moFviOLqD/LrcYlsq
+CQg0yleu7SjOs//8dM3mC2FyLaE/dCZ8l2DCLhHw0+ynyRAvSK6aGCmZz6jMjmYF
+MXgiy7zESksMnVFMulIJJhR3eB0wx2GitibjY/ZhQ7tD3i0yy9ILR07dFz4pgkVM
+afxpVR7fmrMZ0t+yENd+9qzyAZs0ksxORoc2ze90SCx2jwEX/3K+m4I0hP2H/w5W
+gqdvuRLiqf+4BGW4zqWkLLlNIe/okt0r82SwHtDN0Ui1asmZTGj6sm8SXtwx+5cE
+38MttWqjDiibQOSthRVcETByRYM8KcjYSUCi4PoBc3NpDONkFbZm6XofR/f5mTcl
+2jDw6fIeVc4Hd1jBGajNzEqtneqqbdAkPQaLsuD2TMkQfTDJfE/IljwjrhDa9Mi+
+odtnMWq8vlwOZZ24/8/BNK5qXuCYL67O7AJB4ZQ6BT+g4z96iRLbupzu/XJyXkQF
+rOY/Ghegvn7fDrnt2KC9MpgeFBXzUp+k5rzUdF8jbCx5apVjA1sWXB9Kh3L+DUwF
+Mve696B5tlHyc1KxjHR6w9GRsh4=
+=5FXw
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/watch b/watch
new file mode 100644 (file)
index 0000000..8dd007c
--- /dev/null
+++ b/watch
@@ -0,0 +1,17 @@
+version=4
+# if you need to download other versions replace the URL below with this one:
+# https://static.rust-lang.org/dist/index.html
+# it's a bit slower to download, that's why we use the other one normally
+
+opts="\
+pgpsigurlmangle=s/$/.asc/,\
+uversionmangle=s/(\d)[_.+-]?((beta|alpha)\.?\d*)$/$1~$2/,\
+dversionmangle=s/\+dfsg\d*$//,\
+downloadurlmangle=s/\.[gx]z/.xz/,\
+filenamemangle=s/.*\/(.*)\.[gx]z(\..*)?/$1.xz$2/,\
+repack,\
+repacksuffix=+dfsg1,\
+compression=xz,\
+" \
+ https://forge.rust-lang.org/infra/other-installation-methods.html \
+ (?:.*/)rustc?-(\d[\d.]*(?:-[\w.]+)?)-src\.tar\.[gx]z
diff --git a/watch-beta.in b/watch-beta.in
new file mode 100644 (file)
index 0000000..c492cee
--- /dev/null
@@ -0,0 +1,17 @@
+version=4
+# if you need to download other versions replace the URL below with this one:
+# https://static.rust-lang.org/dist/index.html
+# it's a bit slower to download, that's why we use the other one normally
+
+opts="\
+pgpsigurlmangle=s/$/.asc/,\
+uversionmangle=s/.*/NEWVER~beta.999/,\
+dversionmangle=s/\+dfsg\d*$//,\
+downloadurlmangle=s/rustc-.*-(.*)\.[gx]z/rustc-beta-$1.xz/,\
+filenamemangle=s/.*\/(.*)-[^-]*-(.*)\.[gx]z(\..*)?/$1-NEWVER-beta.999-$2.xz$3/,\
+repack,\
+repacksuffix=+dfsg1,\
+compression=xz,\
+" \
+ https://forge.rust-lang.org/other-installation-methods.html \
+ (?:.*/)rustc?-(.*)-src\.tar\.[gx]z