@@ -144,7 +144,7 @@ pub fn get_linker<'a>(
144
144
cmd,
145
145
sess,
146
146
target_cpu,
147
- hinted_static : false ,
147
+ hinted_static : None ,
148
148
is_ld : cc == Cc :: No ,
149
149
is_gnu : flavor. is_gnu ( ) ,
150
150
} ) as Box < dyn Linker > ,
@@ -214,7 +214,7 @@ pub struct GccLinker<'a> {
214
214
cmd : Command ,
215
215
sess : & ' a Session ,
216
216
target_cpu : & ' a str ,
217
- hinted_static : bool , // Keeps track of the current hinting mode.
217
+ hinted_static : Option < bool > , // Keeps track of the current hinting mode.
218
218
// Link as ld
219
219
is_ld : bool ,
220
220
is_gnu : bool ,
@@ -275,19 +275,19 @@ impl<'a> GccLinker<'a> {
275
275
if !self . takes_hints ( ) {
276
276
return ;
277
277
}
278
- if ! self . hinted_static {
278
+ if self . hinted_static != Some ( true ) {
279
279
self . linker_arg ( "-Bstatic" ) ;
280
- self . hinted_static = true ;
280
+ self . hinted_static = Some ( true ) ;
281
281
}
282
282
}
283
283
284
284
fn hint_dynamic ( & mut self ) {
285
285
if !self . takes_hints ( ) {
286
286
return ;
287
287
}
288
- if self . hinted_static {
288
+ if self . hinted_static != Some ( false ) {
289
289
self . linker_arg ( "-Bdynamic" ) ;
290
- self . hinted_static = false ;
290
+ self . hinted_static = Some ( false ) ;
291
291
}
292
292
}
293
293
@@ -1484,25 +1484,25 @@ impl<'a> L4Bender<'a> {
1484
1484
pub struct AixLinker < ' a > {
1485
1485
cmd : Command ,
1486
1486
sess : & ' a Session ,
1487
- hinted_static : bool ,
1487
+ hinted_static : Option < bool > ,
1488
1488
}
1489
1489
1490
1490
impl < ' a > AixLinker < ' a > {
1491
1491
pub fn new ( cmd : Command , sess : & ' a Session ) -> AixLinker < ' a > {
1492
- AixLinker { cmd : cmd, sess : sess, hinted_static : false }
1492
+ AixLinker { cmd : cmd, sess : sess, hinted_static : None }
1493
1493
}
1494
1494
1495
1495
fn hint_static ( & mut self ) {
1496
- if ! self . hinted_static {
1496
+ if self . hinted_static != Some ( true ) {
1497
1497
self . cmd . arg ( "-bstatic" ) ;
1498
- self . hinted_static = true ;
1498
+ self . hinted_static = Some ( true ) ;
1499
1499
}
1500
1500
}
1501
1501
1502
1502
fn hint_dynamic ( & mut self ) {
1503
- if self . hinted_static {
1503
+ if self . hinted_static != Some ( false ) {
1504
1504
self . cmd . arg ( "-bdynamic" ) ;
1505
- self . hinted_static = false ;
1505
+ self . hinted_static = Some ( false ) ;
1506
1506
}
1507
1507
}
1508
1508
0 commit comments