From 4b5a74a8c0ec80e9f0cb420c6efae6e18ebf0196 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 02 2021 04:29:17 +0000 Subject: import rust-1.48.0-1.module+el8.4.0+9421+23a1353a --- diff --git a/.gitignore b/.gitignore index f20f754..8aad862 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rustc-1.46.0-src.tar.xz +SOURCES/rustc-1.48.0-src.tar.xz diff --git a/.rust.metadata b/.rust.metadata index 8d87924..fdc2db9 100644 --- a/.rust.metadata +++ b/.rust.metadata @@ -1 +1 @@ -7fe631f9d8eb27a1443db17431b8922ca97cffe5 SOURCES/rustc-1.46.0-src.tar.xz +036f83df6255166cef0e2241ef0627e2568244b4 SOURCES/rustc-1.48.0-src.tar.xz diff --git a/SOURCES/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch b/SOURCES/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch deleted file mode 100644 index 1650679..0000000 --- a/SOURCES/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 02fc16aece46abcd23d2ade2d969497f07fe26ab Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 7 Aug 2020 12:50:25 -0700 -Subject: [PATCH] Fix jobserver_exists test on single-cpu systems - -Closes #8595 ---- - tests/testsuite/jobserver.rs | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/tests/testsuite/jobserver.rs b/tests/testsuite/jobserver.rs -index 9e91c956cd75..16518ee2c614 100644 ---- a/tests/testsuite/jobserver.rs -+++ b/tests/testsuite/jobserver.rs -@@ -51,7 +51,10 @@ fn jobserver_exists() { - .file("src/lib.rs", "") - .build(); - -- p.cargo("build").run(); -+ // Explicitly use `-j2` to ensure that there's eventually going to be a -+ // token to read from `valdiate` above, since running the build script -+ // itself consumes a token. -+ p.cargo("build -j2").run(); - } - - #[cargo_test] --- -2.26.2 - diff --git a/SOURCES/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch b/SOURCES/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch new file mode 100644 index 0000000..bf6ef9c --- /dev/null +++ b/SOURCES/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch @@ -0,0 +1,46 @@ +From f200c1e7afdd04b42c01c0108735e5b14ca07d93 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 9 Oct 2020 20:12:26 -0700 +Subject: [PATCH] doc: disambiguate stat in MetadataExt::as_raw_stat + +A few architectures in `os::linux::raw` import `libc::stat`, rather than +defining that type directly. However, that also imports the _function_ +called `stat`, which makes this doc link ambiguous: + + error: `crate::os::linux::raw::stat` is both a struct and a function + --> library/std/src/os/linux/fs.rs:21:19 + | + 21 | /// [`stat`]: crate::os::linux::raw::stat + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link + | + = note: `-D broken-intra-doc-links` implied by `-D warnings` + help: to link to the struct, prefix with the item type + | + 21 | /// [`stat`]: struct@crate::os::linux::raw::stat + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + help: to link to the function, add parentheses + | + 21 | /// [`stat`]: crate::os::linux::raw::stat() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We want the `struct`, so it's now prefixed accordingly. +--- + library/std/src/os/linux/fs.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs +index ff23c3d67e3b..9b7af97616c9 100644 +--- a/library/std/src/os/linux/fs.rs ++++ b/library/std/src/os/linux/fs.rs +@@ -20,7 +20,7 @@ pub trait MetadataExt { + /// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the + /// cross-Unix abstractions contained within the raw stat. + /// +- /// [`stat`]: crate::os::linux::raw::stat ++ /// [`stat`]: struct@crate::os::linux::raw::stat + /// + /// # Examples + /// +-- +2.26.2 + diff --git a/SOURCES/0001-use-NativeEndian-in-symbolize-gimli-Context.patch b/SOURCES/0001-use-NativeEndian-in-symbolize-gimli-Context.patch new file mode 100644 index 0000000..81b7a63 --- /dev/null +++ b/SOURCES/0001-use-NativeEndian-in-symbolize-gimli-Context.patch @@ -0,0 +1,28 @@ +From 6f8efee8c936de65bc31610eea30abd5461a5dd1 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 8 Oct 2020 15:53:49 -0700 +Subject: [PATCH] use NativeEndian in symbolize::gimli::Context + +`Object` uses `NativeEndian`, so the `Context` should too. + +Cc: https://github.com/rust-lang/rust/issues/77410 +--- + src/symbolize/gimli.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/symbolize/gimli.rs b/src/symbolize/gimli.rs +index 58ed8bafca3d..273ff43f1c8c 100644 +--- a/src/symbolize/gimli.rs ++++ b/src/symbolize/gimli.rs +@@ -5,7 +5,7 @@ + //! intended to wholesale replace the `libbacktrace.rs` implementation. + + use self::gimli::read::EndianSlice; +-use self::gimli::LittleEndian as Endian; ++use self::gimli::NativeEndian as Endian; + use self::mmap::Mmap; + use self::stash::Stash; + use super::BytesOrWideString; +-- +2.26.2 + diff --git a/SOURCES/0002-Fix-LTO-with-doctests.patch b/SOURCES/0002-Fix-LTO-with-doctests.patch deleted file mode 100644 index e251c11..0000000 --- a/SOURCES/0002-Fix-LTO-with-doctests.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 2c9deaabf99dab9998f6ddbbe496d19ff7ce31f0 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Fri, 28 Aug 2020 21:56:45 +0200 -Subject: [PATCH 2/2] Fix LTO with doctests - ---- - .../src/cargo/core/compiler/context/mod.rs | 3 +- - .../cargo/src/cargo/core/compiler/mod.rs | 59 +++++---------- - src/tools/cargo/src/cargo/core/profiles.rs | 7 +- - src/tools/cargo/tests/testsuite/lto.rs | 71 ++++++++++++++++--- - 4 files changed, 85 insertions(+), 55 deletions(-) - -diff --git a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -index 52b954dd1..82831f423 100644 ---- a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -+++ b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -@@ -210,7 +210,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> { - // Collect information for `rustdoc --test`. - if unit.mode.is_doc_test() { - let mut unstable_opts = false; -- let args = compiler::extern_args(&self, unit, &mut unstable_opts)?; -+ let mut args = compiler::extern_args(&self, unit, &mut unstable_opts)?; -+ args.extend(compiler::lto_args(&self, unit)); - self.compilation.to_doc_test.push(compilation::Doctest { - unit: unit.clone(), - args, -diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs -index 9399c5042..47d2b9bb4 100644 ---- a/src/tools/cargo/src/cargo/core/compiler/mod.rs -+++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs -@@ -783,49 +783,9 @@ fn build_base_args( - cmd.arg("-C").arg(format!("panic={}", panic)); - } - -- match cx.lto[unit] { -- lto::Lto::Run(None) => { -- cmd.arg("-C").arg("lto"); -- } -- lto::Lto::Run(Some(s)) => { -- cmd.arg("-C").arg(format!("lto={}", s)); -- } -- lto::Lto::Off => { -- cmd.arg("-C").arg("lto=off"); -- } -- lto::Lto::ObjectAndBitcode => {} // this is rustc's default -- lto::Lto::OnlyBitcode => { -- // Note that this compiler flag, like the one below, is just an -- // optimization in terms of build time. If we don't pass it then -- // both object code and bitcode will show up. This is lagely just -- // compat until the feature lands on stable and we can remove the -- // conditional branch. -- if cx -- .bcx -- .target_data -- .info(CompileKind::Host) -- .supports_embed_bitcode -- .unwrap() -- { -- cmd.arg("-Clinker-plugin-lto"); -- } -- } -- lto::Lto::OnlyObject => { -- if cx -- .bcx -- .target_data -- .info(CompileKind::Host) -- .supports_embed_bitcode -- .unwrap() -- { -- cmd.arg("-Cembed-bitcode=no"); -- } -- } -- } -+ cmd.args(<o_args(cx, unit)); - - if let Some(n) = codegen_units { -- // There are some restrictions with LTO and codegen-units, so we -- // only add codegen units when LTO is not used. - cmd.arg("-C").arg(&format!("codegen-units={}", n)); - } - -@@ -952,6 +912,23 @@ fn build_base_args( - Ok(()) - } - -+fn lto_args(cx: &Context<'_, '_>, unit: &Unit) -> Vec { -+ let mut result = Vec::new(); -+ let mut push = |arg: &str| { -+ result.push(OsString::from("-C")); -+ result.push(OsString::from(arg)); -+ }; -+ match cx.lto[unit] { -+ lto::Lto::Run(None) => push("lto"), -+ lto::Lto::Run(Some(s)) => push(&format!("lto={}", s)), -+ lto::Lto::Off => push("lto=off"), -+ lto::Lto::ObjectAndBitcode => {} // this is rustc's default -+ lto::Lto::OnlyBitcode => push("linker-plugin-lto"), -+ lto::Lto::OnlyObject => push("embed-bitcode=no"), -+ } -+ result -+} -+ - fn build_deps_args( - cmd: &mut ProcessBuilder, - cx: &mut Context<'_, '_>, -diff --git a/src/tools/cargo/src/cargo/core/profiles.rs b/src/tools/cargo/src/cargo/core/profiles.rs -index 6a28bd261..ca0c2e417 100644 ---- a/src/tools/cargo/src/cargo/core/profiles.rs -+++ b/src/tools/cargo/src/cargo/core/profiles.rs -@@ -302,7 +302,7 @@ impl Profiles { - }; - - match mode { -- CompileMode::Test | CompileMode::Bench => { -+ CompileMode::Test | CompileMode::Bench | CompileMode::Doctest => { - if release { - ( - InternedString::new("bench"), -@@ -315,10 +315,7 @@ impl Profiles { - ) - } - } -- CompileMode::Build -- | CompileMode::Check { .. } -- | CompileMode::Doctest -- | CompileMode::RunCustomBuild => { -+ CompileMode::Build | CompileMode::Check { .. } | CompileMode::RunCustomBuild => { - // Note: `RunCustomBuild` doesn't normally use this code path. - // `build_unit_profiles` normally ensures that it selects the - // ancestor's profile. However, `cargo clean -p` can hit this --- -2.26.2 - diff --git a/SOURCES/rustc-1.42.0-disable-libssh2.patch b/SOURCES/rustc-1.42.0-disable-libssh2.patch deleted file mode 100644 index 770ad34..0000000 --- a/SOURCES/rustc-1.42.0-disable-libssh2.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700 -+++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700 -@@ -1796,7 +1796,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1813,20 +1812,6 @@ - ] - - [[package]] --name = "libssh2-sys" --version = "0.2.14" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" --dependencies = [ -- "cc", -- "libc", -- "libz-sys", -- "openssl-sys", -- "pkg-config", -- "vcpkg", --] -- --[[package]] - name = "libz-sys" - version = "1.0.25" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700 -+++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700 -@@ -55,7 +55,7 @@ - version = "0.1.39" - - [features] --default = ["ssh", "https", "ssh_key_from_memory"] -+default = ["https"] - https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] - ssh = ["libgit2-sys/ssh"] - ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/SOURCES/rustc-1.45.0-disable-http2.patch b/SOURCES/rustc-1.45.0-disable-http2.patch deleted file mode 100644 index 875b22a..0000000 --- a/SOURCES/rustc-1.45.0-disable-http2.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- rustc-1.45.0-src/Cargo.lock.orig 2020-07-13 09:27:24.000000000 -0700 -+++ rustc-1.45.0-src/Cargo.lock 2020-07-16 12:12:32.253903599 -0700 -@@ -896,7 +896,6 @@ - dependencies = [ - "cc", - "libc", -- "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1875,16 +1874,6 @@ - ] - - [[package]] --name = "libnghttp2-sys" --version = "0.1.2" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" --dependencies = [ -- "cc", -- "libc", --] -- --[[package]] - name = "libz-sys" - version = "1.0.25" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.45.0-src/src/tools/cargo/Cargo.toml.orig 2020-07-13 09:27:49.000000000 -0700 -+++ rustc-1.45.0-src/src/tools/cargo/Cargo.toml 2020-07-16 12:12:32.253903599 -0700 -@@ -25,7 +25,7 @@ - crates-io = { path = "crates/crates-io", version = "0.31.1" } - crossbeam-utils = "0.7" - crypto-hash = "0.3.1" --curl = { version = "0.4.23", features = ["http2"] } -+curl = { version = "0.4.23", features = [] } - curl-sys = "0.4.22" - env_logger = "0.7.0" - pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-07-13 09:27:49.000000000 -0700 -+++ rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-07-16 12:12:32.253903599 -0700 -@@ -393,14 +393,8 @@ - // Also note that pipelining is disabled as curl authors have indicated - // that it's buggy, and we've empirically seen that it's buggy with HTTP - // proxies. -- let mut multi = Multi::new(); -- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); -- multi -- .pipelining(false, multiplexing) -- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood crates.io with connections -- multi.set_max_host_connections(2)?; -+ let multi = Multi::new(); -+ let multiplexing = false; - - Ok(PackageSet { - packages: package_ids -@@ -563,7 +557,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); - } diff --git a/SOURCES/rustc-1.45.0-no-default-pie.patch b/SOURCES/rustc-1.45.0-no-default-pie.patch deleted file mode 100644 index 726df24..0000000 --- a/SOURCES/rustc-1.45.0-no-default-pie.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs -index dcce1d45298c..5c11f7276f26 100644 ---- a/src/librustc_codegen_ssa/back/link.rs -+++ b/src/librustc_codegen_ssa/back/link.rs -@@ -1184,10 +1184,12 @@ fn exec_linker( - } - - fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { -- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, -+ // Only use PIE if explicity specified. -+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); -+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { -+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, - (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, -+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, - (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, - (_, true, _) => LinkOutputKind::StaticDylib, - (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/SOURCES/rustc-1.48.0-disable-http2.patch b/SOURCES/rustc-1.48.0-disable-http2.patch new file mode 100644 index 0000000..a162fd0 --- /dev/null +++ b/SOURCES/rustc-1.48.0-disable-http2.patch @@ -0,0 +1,66 @@ +--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 09:36:19.889728111 -0800 ++++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:36:19.890728089 -0800 +@@ -849,7 +849,6 @@ + dependencies = [ + "cc", + "libc", +- "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1682,16 +1681,6 @@ + ] + + [[package]] +-name = "libnghttp2-sys" +-version = "0.1.4+1.41.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +-dependencies = [ +- "cc", +- "libc", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.48.0-src/src/tools/cargo/Cargo.toml.orig 2020-11-16 06:02:09.000000000 -0800 ++++ rustc-1.48.0-src/src/tools/cargo/Cargo.toml 2020-11-16 09:36:19.890728089 -0800 +@@ -25,7 +25,7 @@ + crates-io = { path = "crates/crates-io", version = "0.31.1" } + crossbeam-utils = "0.7" + crypto-hash = "0.3.1" +-curl = { version = "0.4.23", features = ["http2"] } ++curl = { version = "0.4.23", features = [] } + curl-sys = "0.4.22" + env_logger = "0.7.0" + pretty_env_logger = { version = "0.4", optional = true } +--- rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-11-16 06:02:09.000000000 -0800 ++++ rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-11-16 09:36:19.890728089 -0800 +@@ -396,14 +396,8 @@ + // Also note that pipelining is disabled as curl authors have indicated + // that it's buggy, and we've empirically seen that it's buggy with HTTP + // proxies. +- let mut multi = Multi::new(); +- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); +- multi +- .pipelining(false, multiplexing) +- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood crates.io with connections +- multi.set_max_host_connections(2)?; ++ let multi = Multi::new(); ++ let multiplexing = false; + + Ok(PackageSet { + packages: package_ids +@@ -566,7 +560,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } diff --git a/SOURCES/rustc-1.48.0-disable-libssh2.patch b/SOURCES/rustc-1.48.0-disable-libssh2.patch new file mode 100644 index 0000000..6916e74 --- /dev/null +++ b/SOURCES/rustc-1.48.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800 +@@ -1676,7 +1676,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1693,20 +1692,6 @@ + ] + + [[package]] +-name = "libssh2-sys" +-version = "0.2.19" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800 ++++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800 +@@ -49,7 +49,7 @@ + version = "0.1.39" + + [features] +-default = ["ssh", "https", "ssh_key_from_memory"] ++default = ["https"] + https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] + ssh = ["libgit2-sys/ssh"] + ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/SOURCES/rustc-1.48.0-no-default-pie.patch b/SOURCES/rustc-1.48.0-no-default-pie.patch new file mode 100644 index 0000000..bb6b3d1 --- /dev/null +++ b/SOURCES/rustc-1.48.0-no-default-pie.patch @@ -0,0 +1,18 @@ +--- rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2020-11-16 09:37:15.779516797 -0800 +@@ -1185,10 +1185,12 @@ + } + + fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { +- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { +- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, ++ // Only use PIE if explicity specified. ++ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); ++ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { ++ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, +- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, ++ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, + (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, + (_, true, _) => LinkOutputKind::StaticDylib, + (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/SPECS/rust.spec b/SPECS/rust.spec index f5da281..4c09d81 100644 --- a/SPECS/rust.spec +++ b/SPECS/rust.spec @@ -1,5 +1,5 @@ # Only x86_64 and i686 are Tier 1 platforms at this time. -# https://forge.rust-lang.org/platform-support.html +# https://doc.rust-lang.org/nightly/rustc/platform-support.html #global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x %global rust_arches x86_64 i686 aarch64 ppc64le s390x @@ -10,10 +10,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.45.2 -%global bootstrap_cargo 1.45.2 -%global bootstrap_channel 1.45.2 -%global bootstrap_date 2020-08-03 +%global bootstrap_rust 1.47.0 +%global bootstrap_cargo 1.47.0 +%global bootstrap_channel 1.47.0 +%global bootstrap_date 2020-10-08 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -53,7 +53,7 @@ %endif Name: rust -Version: 1.46.0 +Version: 1.48.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -68,23 +68,24 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/cargo/pull/8598 -Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch -# https://github.com/rust-lang/cargo/pull/8657 (backported) -Patch2: 0002-Fix-LTO-with-doctests.patch +# https://github.com/rust-lang/backtrace-rs/pull/373 +Patch1: 0001-use-NativeEndian-in-symbolize-gimli-Context.patch + +# https://github.com/rust-lang/rust/pull/77777 +Patch2: 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.42.0-disable-libssh2.patch +Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.45.0-disable-http2.patch +Patch101: rustc-1.48.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.45.0-no-default-pie.patch +Patch102: rustc-1.48.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -167,7 +168,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 10.0.1 +Provides: bundled(llvm) = 11.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 @@ -192,9 +193,6 @@ BuildRequires: procps-ng # debuginfo-gdb tests need gdb BuildRequires: gdb -# TODO: work on unbundling these! -Provides: bundled(libbacktrace) = 1.0.20200219 - # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} Provides: rustc%{?_isa} = %{version}-%{release} @@ -300,7 +298,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.0.0 +Provides: bundled(libgit2) = 1.1.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -346,7 +344,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.0.0 +Provides: bundled(libgit2) = 1.1.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -411,7 +409,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -d src/tools/cargo +%patch1 -p1 -d library/backtrace %patch2 -p1 %if %with disabled_libssh2 @@ -424,7 +422,7 @@ rm -rf vendor/libnghttp2-sys/ %endif %if 0%{?rhel} && 0%{?rhel} < 8 -%patch102 -p1 -b .no-pie +%patch102 -p1 %endif %if "%{python}" != "python3" @@ -434,12 +432,14 @@ sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %if %without bundled_llvm rm -rf src/llvm-project/ +mkdir -p src/llvm-project/libunwind/ %endif # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libz-sys/src/zlib/ +rm -rf vendor/libz-sys/src/zlib-ng/ rm -rf vendor/lzma-sys/xz-*/ rm -rf vendor/openssl-src/openssl/ @@ -457,9 +457,6 @@ rm -rf vendor/libssh2-sys/ # This only affects the transient rust-installer, but let it use our dynamic xz-libs sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs -# rename bundled license for packaging -cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} - %if %{with bundled_llvm} && 0%{?epel} == 7 mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake @@ -483,26 +480,23 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' - -%build -# This package fails to build with LTO due to undefined symbols. LTO -# was disabled in OpenSuSE as well, but with no real explanation why -# beyond the undefined symbols. It really should be investigated further. -# Disable LTO -%define _lto_cflags %{nil} - +# Set up shared environment variables for build/install/check +%global rust_env RUSTFLAGS="%{rustflags}" +%if 0%{?cmake_path:1} +%global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" +%endif %if %without bundled_libgit2 # convince libgit2-sys to use the distro libgit2 -export LIBGIT2_SYS_USE_PKG_CONFIG=1 +%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 %endif - %if %without bundled_libssh2 # convince libssh2-sys to use the distro libssh2 -export LIBSSH2_SYS_USE_PKG_CONFIG=1 +%global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} + +%build +export %{rust_env} # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -556,12 +550,11 @@ fi --release-channel=%{channel} %{python} ./x.py build -j "$ncpus" --stage 2 -%{python} ./x.py doc +%{python} ./x.py doc --stage 2 %install -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} DESTDIR=%{buildroot} %{python} ./x.py install @@ -625,20 +618,19 @@ ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html %if %without lldb rm -f %{buildroot}%{_bindir}/rust-lldb -rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* +rm -f %{buildroot}%{rustlibdir}/etc/lldb_* %endif %check -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} # The results are not stable on koji, so mask errors and just log it. -%{python} ./x.py test --no-fail-fast || : -%{python} ./x.py test --no-fail-fast cargo || : -%{python} ./x.py test --no-fail-fast clippy || : -%{python} ./x.py test --no-fail-fast rls || : -%{python} ./x.py test --no-fail-fast rustfmt || : +%{python} ./x.py test --no-fail-fast --stage 2 || : +%{python} ./x.py test --no-fail-fast --stage 2 cargo || : +%{python} ./x.py test --no-fail-fast --stage 2 clippy || : +%{python} ./x.py test --no-fail-fast --stage 2 rls || : +%{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : %ldconfig_scriptlets @@ -646,7 +638,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -674,14 +665,14 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files gdb %{_bindir}/rust-gdb -%{rustlibdir}/etc/gdb_*.py* +%{rustlibdir}/etc/gdb_* %exclude %{_bindir}/rust-gdbgui %if %with lldb %files lldb %{_bindir}/rust-lldb -%{rustlibdir}/etc/lldb_*.py* +%{rustlibdir}/etc/lldb_* %endif @@ -692,7 +683,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_docdir}/%{name}/html/*/ %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css -%{_docdir}/%{name}/html/*.ico %{_docdir}/%{name}/html/*.js %{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg @@ -748,6 +738,12 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Tue Jan 12 2021 Josh Stone - 1.48.0-1 +- Update to 1.48.0. + +* Thu Oct 22 2020 Josh Stone - 1.47.0-1 +- Update to 1.47.0. + * Wed Oct 14 2020 Josh Stone - 1.46.0-1 - Update to 1.46.0.