@@ -5,7 +5,7 @@ use crate::command::Command;
5
5
use crate :: env:: env_var;
6
6
use crate :: path_helpers:: cwd;
7
7
use crate :: util:: set_host_rpath;
8
- use crate :: { is_darwin, is_msvc, is_windows, uname} ;
8
+ use crate :: { is_aix , is_darwin, is_msvc, is_windows, uname} ;
9
9
10
10
/// Construct a new `rustc` invocation. This will automatically set the library
11
11
/// search path as `-L cwd()`. Use [`bare_rustc`] to avoid this.
@@ -346,7 +346,7 @@ impl Rustc {
346
346
// endif
347
347
// endif
348
348
// ```
349
- let flag = if is_windows ( ) {
349
+ if is_windows ( ) {
350
350
// So this is a bit hacky: we can't use the DLL version of libstdc++ because
351
351
// it pulls in the DLL version of libgcc, which means that we end up with 2
352
352
// instances of the DW2 unwinding implementation. This is a problem on
@@ -362,18 +362,19 @@ impl Rustc {
362
362
// So we end up with the following hack: we link use static:-bundle to only
363
363
// link the parts of libstdc++ that we actually use, which doesn't include
364
364
// the dependency on the pthreads DLL.
365
- if is_msvc ( ) { None } else { Some ( "-lstatic:-bundle=stdc++" ) }
365
+ if !is_msvc ( ) {
366
+ self . cmd . arg ( "-lstatic:-bundle=stdc++" ) ;
367
+ } ;
366
368
} else if is_darwin ( ) {
367
- Some ( "-lc++" )
369
+ self . cmd . arg ( "-lc++" ) ;
370
+ } else if is_aix ( ) {
371
+ self . cmd . arg ( "-lc++" ) ;
372
+ self . cmd . arg ( "-lc++abi" ) ;
368
373
} else {
369
- match & uname ( ) [ ..] {
370
- "FreeBSD" | "SunOS" | "OpenBSD" => None ,
371
- _ => Some ( "-lstdc++" ) ,
372
- }
374
+ if !matches ! ( & uname( ) [ ..] , "FreeBSD" | "SunOS" | "OpenBSD" ) {
375
+ self . cmd . arg ( "-lstdc++" ) ;
376
+ } ;
373
377
} ;
374
- if let Some ( flag) = flag {
375
- self . cmd . arg ( flag) ;
376
- }
377
378
self
378
379
}
379
380
}
0 commit comments