@@ -1428,6 +1428,17 @@ impl Build {
1428
1428
cmd. args . push ( "-mfloat-abi=soft" . into ( ) ) ;
1429
1429
}
1430
1430
}
1431
+ if target. starts_with ( "riscv32" ) || target. starts_with ( "riscv64" ) {
1432
+ // get the 32i/32imac/32imc/64gc/64imac/... part
1433
+ let mut parts = target. split ( '-' ) ;
1434
+ if let Some ( arch) = parts. next ( ) {
1435
+ let arch = & arch[ 5 ..] ;
1436
+ cmd. args . push ( ( "-march=rv" . to_owned ( ) + arch) . into ( ) ) ;
1437
+ // ABI is always soft-float right now, update this when this is no longer the
1438
+ // case:
1439
+ cmd. args . push ( "-mabi=lp64" . into ( ) ) ;
1440
+ }
1441
+ }
1431
1442
}
1432
1443
}
1433
1444
@@ -1809,6 +1820,11 @@ impl Build {
1809
1820
"powerpc-unknown-netbsd" => Some ( "powerpc--netbsd" ) ,
1810
1821
"powerpc64-unknown-linux-gnu" => Some ( "powerpc-linux-gnu" ) ,
1811
1822
"powerpc64le-unknown-linux-gnu" => Some ( "powerpc64le-linux-gnu" ) ,
1823
+ "riscv32i-unknown-none-elf" => Some ( "riscv32-unknown-elf" ) ,
1824
+ "riscv32imac-unknown-none-elf" => Some ( "riscv32-unknown-elf" ) ,
1825
+ "riscv32imc-unknown-none-elf" => Some ( "riscv32-unknown-elf" ) ,
1826
+ "riscv64gc-unknown-none-elf" => Some ( "riscv64-unknown-elf" ) ,
1827
+ "riscv64imac-unknown-none-elf" => Some ( "riscv64-unknown-elf" ) ,
1812
1828
"s390x-unknown-linux-gnu" => Some ( "s390x-linux-gnu" ) ,
1813
1829
"sparc-unknown-linux-gnu" => Some ( "sparc-linux-gnu" ) ,
1814
1830
"sparc64-unknown-linux-gnu" => Some ( "sparc64-linux-gnu" ) ,
0 commit comments