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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1891744 - (show annotations) (download)
Fri Sep 23 08:39:59 2022 UTC (18 months, 3 weeks ago) by akien
File size: 2536 byte(s)
- Sync with Fedora: Thu Sep 22 2022 Josh Stone <jistone@redhat.com> - 1.64.0-1
  o Update to 1.64.0.
  o Add rust-analyzer.

1 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
2 index 63207803e327..f5757760c409 100644
3 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
4 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
5 @@ -741,7 +741,7 @@ fn link_natively<'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 @@ -760,7 +760,7 @@ fn link_natively<'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,15 @@ 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 + #[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))]
30 + let explicit_pic =
31 + matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
32 + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
33 (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
34 - (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
35 - LinkOutputKind::DynamicPicExe
36 - }
37 + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
38 (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
39 - (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
40 - LinkOutputKind::StaticPicExe
41 - }
42 + (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
43 (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
44 (_, true, _) => LinkOutputKind::StaticDylib,
45 (_, false, _) => LinkOutputKind::DynamicDylib,

  ViewVC Help
Powered by ViewVC 1.1.30