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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

cauldron/rust/current/SOURCES/rustc-1.58.0-no-default-pie.patch revision 1891743 by akien, Tue Jan 25 15:13:17 2022 UTC cauldron/rust/current/SOURCES/rustc-1.64.0-no-default-pie.patch revision 1891744 by akien, Fri Sep 23 08:39:59 2022 UTC
# Line 1  Line 1 
1  diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs  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  index 63207803e327..f5757760c409 100644
3  --- a/compiler/rustc_codegen_ssa/src/back/link.rs  --- a/compiler/rustc_codegen_ssa/src/back/link.rs
4  +++ b/compiler/rustc_codegen_ssa/src/back/link.rs  +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
5  @@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(  @@ -741,7 +741,7 @@ fn link_natively<'a>(
6               && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")               && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")
7           {           {
8               info!("linker output: {:?}", out);               info!("linker output: {:?}", out);
# Line 11  index 638b2a7b5a9f..79d4ecf4cb91 100644 Line 11  index 638b2a7b5a9f..79d4ecf4cb91 100644
11               for arg in cmd.take_args() {               for arg in cmd.take_args() {
12                   if arg.to_string_lossy() != "-no-pie" {                   if arg.to_string_lossy() != "-no-pie" {
13                       cmd.arg(arg);                       cmd.arg(arg);
14  @@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(  @@ -760,7 +760,7 @@ fn link_natively<'a>(
15               && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")               && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")
16           {           {
17               info!("linker output: {:?}", out);               info!("linker output: {:?}", out);
# Line 20  index 638b2a7b5a9f..79d4ecf4cb91 100644 Line 20  index 638b2a7b5a9f..79d4ecf4cb91 100644
20                   "Linker does not support -static-pie command line option. Retrying with -static instead."                   "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.               // Mirror `add_(pre,post)_link_objects` to replace CRT objects.
23  @@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {  @@ -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 {   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()) {  -    let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
28  +    // Only use PIE if explicitly specified.  +    // Only use PIE if explicitly specified.
29    +    #[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))]
30  +    let explicit_pic =  +    let explicit_pic =
31  +        matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));  +        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) {  +    let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {

Legend:
Removed from v.1891743  
changed lines
  Added in v.1891744

  ViewVC Help
Powered by ViewVC 1.1.28