File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2164,6 +2164,10 @@ fn rust_to_clang_target(rust_target: &str) -> String {
2164
2164
clang_target
2165
2165
. push_str ( rust_target. strip_prefix ( "aarch64-apple-" ) . unwrap ( ) ) ;
2166
2166
return clang_target;
2167
+ } else if rust_target. starts_with ( "riscv64gc-" ) {
2168
+ let mut clang_target = "riscv64-" . to_owned ( ) ;
2169
+ clang_target. push_str ( rust_target. strip_prefix ( "riscv64gc-" ) . unwrap ( ) ) ;
2170
+ return clang_target;
2167
2171
}
2168
2172
rust_target. to_owned ( )
2169
2173
}
@@ -2714,3 +2718,11 @@ fn commandline_flag_unit_test_function() {
2714
2718
fn test_rust_to_clang_target ( ) {
2715
2719
assert_eq ! ( rust_to_clang_target( "aarch64-apple-ios" ) , "arm64-apple-ios" ) ;
2716
2720
}
2721
+
2722
+ #[ test]
2723
+ fn test_rust_to_clang_target_riscv ( ) {
2724
+ assert_eq ! (
2725
+ rust_to_clang_target( "riscv64gc-unknown-linux-gnu" ) ,
2726
+ "riscv64-unknown-linux-gnu"
2727
+ )
2728
+ }
You can’t perform that action at this time.
0 commit comments