File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1490,10 +1490,11 @@ impl Build {
1490
1490
cmd. push_cc_arg ( "-fdata-sections" . into ( ) ) ;
1491
1491
}
1492
1492
// Disable generation of PIC on bare-metal for now: rust-lld doesn't support this yet
1493
- if self
1494
- . pic
1495
- . unwrap_or ( !target. contains ( "windows" ) && !target. contains ( "-none-" ) )
1496
- {
1493
+ if self . pic . unwrap_or (
1494
+ !target. contains ( "windows" )
1495
+ && !target. contains ( "-none-" )
1496
+ && !target. contains ( "uefi" ) ,
1497
+ ) {
1497
1498
cmd. push_cc_arg ( "-fPIC" . into ( ) ) ;
1498
1499
// PLT only applies if code is compiled with PIC support,
1499
1500
// and only for ELF targets.
@@ -1556,6 +1557,12 @@ impl Build {
1556
1557
cmd. args . push (
1557
1558
format ! ( "--target={}" , target. replace( "riscv64gc" , "riscv64" ) ) . into ( ) ,
1558
1559
) ;
1560
+ } else if target. contains ( "uefi" ) {
1561
+ if target. contains ( "x86_64" ) {
1562
+ cmd. args . push ( "--target=x86_64-unknown-windows-gnu" . into ( ) ) ;
1563
+ } else if target. contains ( "i686" ) {
1564
+ cmd. args . push ( "--target=i686-unknown-windows-gnu" . into ( ) )
1565
+ }
1559
1566
} else {
1560
1567
cmd. args . push ( format ! ( "--target={}" , target) . into ( ) ) ;
1561
1568
}
You can’t perform that action at this time.
0 commit comments