File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2164,6 +2164,11 @@ 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
2170
+ . push_str ( rust_target. strip_prefix ( "riscv64gc-" ) . unwrap ( ) ) ;
2171
+ return clang_target;
2167
2172
}
2168
2173
rust_target. to_owned ( )
2169
2174
}
@@ -2714,3 +2719,8 @@ fn commandline_flag_unit_test_function() {
2714
2719
fn test_rust_to_clang_target ( ) {
2715
2720
assert_eq ! ( rust_to_clang_target( "aarch64-apple-ios" ) , "arm64-apple-ios" ) ;
2716
2721
}
2722
+
2723
+ #[ test]
2724
+ fn test_rust_to_clang_target_riscv ( ) {
2725
+ assert_eq ! ( rust_to_clang_target( "riscv64gc-unknown-linux-gnu" ) , "riscv64-unknown-linux-gnu" )
2726
+ }
You can’t perform that action at this time.
0 commit comments