@@ -517,6 +517,7 @@ pub struct TargetCfgs {
517
517
pub all_abis : HashSet < String > ,
518
518
pub all_families : HashSet < String > ,
519
519
pub all_pointer_widths : HashSet < String > ,
520
+ pub all_rustc_abis : HashSet < String > ,
520
521
}
521
522
522
523
impl TargetCfgs {
@@ -536,6 +537,9 @@ impl TargetCfgs {
536
537
let mut all_abis = HashSet :: new ( ) ;
537
538
let mut all_families = HashSet :: new ( ) ;
538
539
let mut all_pointer_widths = HashSet :: new ( ) ;
540
+ // NOTE: for distinction between `abi` and `rustc_abi`, see comment on
541
+ // `TargetCfg::rustc_abi`.
542
+ let mut all_rustc_abis = HashSet :: new ( ) ;
539
543
540
544
// If current target is not included in the `--print=all-target-specs-json` output,
541
545
// we check whether it is a custom target from the user or a synthetic target from bootstrap.
@@ -576,7 +580,9 @@ impl TargetCfgs {
576
580
all_families. insert ( family. clone ( ) ) ;
577
581
}
578
582
all_pointer_widths. insert ( format ! ( "{}bit" , cfg. pointer_width) ) ;
579
-
583
+ if let Some ( rustc_abi) = & cfg. rustc_abi {
584
+ all_rustc_abis. insert ( rustc_abi. clone ( ) ) ;
585
+ }
580
586
all_targets. insert ( target. clone ( ) ) ;
581
587
}
582
588
@@ -590,6 +596,7 @@ impl TargetCfgs {
590
596
all_abis,
591
597
all_families,
592
598
all_pointer_widths,
599
+ all_rustc_abis,
593
600
}
594
601
}
595
602
@@ -676,6 +683,10 @@ pub struct TargetCfg {
676
683
pub ( crate ) xray : bool ,
677
684
#[ serde( default = "default_reloc_model" ) ]
678
685
pub ( crate ) relocation_model : String ,
686
+ // NOTE: `rustc_abi` should not be confused with `abi`. `rustc_abi` was introduced in #137037 to
687
+ // make SSE2 *required* by the ABI (kind of a hack to make a target feature *required* via the
688
+ // target spec).
689
+ pub ( crate ) rustc_abi : Option < String > ,
679
690
680
691
// Not present in target cfg json output, additional derived information.
681
692
#[ serde( skip) ]
0 commit comments