File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
rustc_codegen_ssa/src/back
rustc_target/src/spec/base Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -473,8 +473,10 @@ impl<'a> GccLinker<'a> {
473
473
} else {
474
474
self . link_arg ( "--entry=entrypoint" ) ;
475
475
}
476
- if self . sess . opts . cg . target_cpu . as_ref ( )
477
- . unwrap_or ( & self . sess . target . cpu . as_ref ( ) . to_string ( ) ) == "v3" {
476
+
477
+ let cpu_type = self . sess . opts . cg . target_cpu . as_ref ( ) . cloned ( )
478
+ . unwrap_or ( self . sess . target . cpu . as_ref ( ) . to_string ( ) ) ;
479
+ if cpu_type == "v3" || cpu_type == "v4" {
478
480
self . link_arg ( "-Bsymbolic" ) ;
479
481
if self . sess . opts . debuginfo == DebugInfo :: None {
480
482
self . link_arg ( "--strip-all" ) ;
Original file line number Diff line number Diff line change @@ -86,21 +86,19 @@ pub(crate) fn opts(version: &'static str) -> TargetOptions {
86
86
"--threads=1" , "-z" , "notext" , "--Bdynamic"
87
87
] ;
88
88
89
- if version != "v3" {
89
+ let linker_script = if version == "v3" || version == "v4" {
90
+ V3_LINKER_SCRIPT
91
+ } else {
90
92
linker_args. push ( "-z" ) ;
91
93
linker_args. push ( "max-page-size=4096" ) ;
92
- }
94
+ V0_LINKER_SCRIPT
95
+ } ;
93
96
94
97
let pre_link_args = TargetOptions :: link_args (
95
98
LinkerFlavor :: Gnu ( Cc :: No , Lld :: No ) ,
96
99
linker_args. as_slice ( ) ,
97
100
) ;
98
101
99
- let linker_script = if version == "v3" || version == "v4" {
100
- V3_LINKER_SCRIPT
101
- } else {
102
- V0_LINKER_SCRIPT
103
- } ;
104
102
let cpu = if version == "v0" {
105
103
"generic"
106
104
} else {
You can’t perform that action at this time.
0 commit comments