@@ -436,6 +436,10 @@ fn main(vec[str] args) {
436
436
metadata:: creader:: list_file_metadata ( ifile, std:: io:: stdout ( ) ) ;
437
437
ret;
438
438
}
439
+
440
+ auto stop_after_codegen = sopts. output_type != link:: output_type_exe ||
441
+ ( sopts. static && sopts. library ) ;
442
+
439
443
alt ( output_file) {
440
444
case ( none) {
441
445
let vec[ str] parts = str:: split ( ifile, '.' as u8 ) ;
@@ -460,7 +464,7 @@ fn main(vec[str] args) {
460
464
461
465
saved_out_filename = ofile;
462
466
auto temp_filename;
463
- if ( sopts . output_type == link :: output_type_exe && !sopts . static ) {
467
+ if ( !stop_after_codegen ) {
464
468
temp_filename = ofile + ".o" ;
465
469
} else {
466
470
temp_filename = ofile;
@@ -473,7 +477,7 @@ fn main(vec[str] args) {
473
477
// gcc to link the object file with some libs
474
478
//
475
479
// TODO: Factor this out of main.
476
- if ( sopts . output_type != link :: output_type_exe || sopts . static ) {
480
+ if ( stop_after_codegen ) {
477
481
ret;
478
482
}
479
483
@@ -521,6 +525,10 @@ fn main(vec[str] args) {
521
525
522
526
auto cstore = sess. get_cstore ( ) ;
523
527
for ( str cratepath in cstore:: get_used_crate_files( cstore) ) {
528
+ if ( str:: ends_with ( cratepath, ".rlib" ) ) {
529
+ gcc_args += [ cratepath] ;
530
+ cont;
531
+ }
524
532
auto dir = fs:: dirname ( cratepath) ;
525
533
if ( dir != "" ) {
526
534
gcc_args += [ "-L" + dir] ;
0 commit comments