/[packages]/cauldron/rust/current/SOURCES/rustc-1.58.0-no-default-pie.patch
ViewVC logotype

Contents of /cauldron/rust/current/SOURCES/rustc-1.58.0-no-default-pie.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1769757 - (show annotations) (download)
Tue Jan 25 15:13:17 2022 UTC (12 months, 1 week ago) by akien
File size: 2519 byte(s)
- Sync with Fedora: Thu Jan 20 2022 Josh Stone <jistone@redhat.com> - 1.58.1-1
  o Update to 1.58.1.
  o Add rust-std-static-i686-pc-windows-gnu
  o Add rust-std-static-x86_64-pc-windows-gnu

1 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
2 index 638b2a7b5a9f..79d4ecf4cb91 100644
3 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
4 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
5 @@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
6 && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")
7 {
8 info!("linker output: {:?}", out);
9 - warn!("Linker does not support -no-pie command line option. Retrying without.");
10 + info!("Linker does not support -no-pie command line option. Retrying without.");
11 for arg in cmd.take_args() {
12 if arg.to_string_lossy() != "-no-pie" {
13 cmd.arg(arg);
14 @@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
15 && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")
16 {
17 info!("linker output: {:?}", out);
18 - warn!(
19 + info!(
20 "Linker does not support -static-pie command line option. Retrying with -static instead."
21 );
22 // Mirror `add_(pre,post)_link_objects` to replace CRT objects.
23 @@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
24 }
25
26 fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
27 - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
28 + // Only use PIE if explicitly specified.
29 + let explicit_pic =
30 + matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
31 + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
32 (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
33 - (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
34 - LinkOutputKind::DynamicPicExe
35 - }
36 + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
37 (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
38 - (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
39 - LinkOutputKind::StaticPicExe
40 - }
41 + (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
42 (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
43 (_, true, _) => LinkOutputKind::StaticDylib,
44 (_, false, _) => LinkOutputKind::DynamicDylib,

  ViewVC Help
Powered by ViewVC 1.1.28