@@ -17,6 +17,8 @@ const SKIPPED_TARGETS: &[&str] = &[
17
17
"xtensa-esp32s2-none-elf" ,
18
18
"xtensa-esp32s3-espidf" ,
19
19
"xtensa-esp32s3-none-elf" ,
20
+ "csky-unknown-linux-gnuabiv2" ,
21
+ "csky-unknown-linux-gnuabiv2hf" ,
20
22
] ;
21
23
22
24
/// Map from a Rust target to the Clang target if they are not the same.
@@ -26,14 +28,40 @@ const MAPPED_TARGETS: &[(&str, &str)] = &[
26
28
( "aarch64-apple-visionos-sim" , "aarch64-apple-visionos" ) ,
27
29
( "aarch64-apple-watchos-sim" , "aarch64-apple-watchos" ) ,
28
30
( "x86_64-apple-watchos-sim" , "x86_64-apple-watchos" ) ,
31
+ ( "aarch64-pc-windows-gnullvm" , "aarch64-pc-windows-gnu" ) ,
32
+ ( "aarch64-unknown-linux-gnu_ilp32" , "aarch64-unknown-linux-gnu" ) ,
33
+ ( "aarch64-unknown-none-softfloat" , "aarch64-unknown-none" ) ,
34
+ ( "aarch64-unknown-nto-qnx700" , "aarch64-unknown-nto-700" ) ,
35
+ ( "aarch64-unknown-nto-qnx710" , "aarch64-unknown-nto-710" ) ,
36
+ ( "aarch64-unknown-uefi" , "aarch64-unknown" ) ,
37
+ ( "aarch64_be-unknown-linux-gnu_ilp32" , "aarch64_be-unknown-linux-gnu" ) ,
38
+ ( "armv5te-unknown-linux-uclibceabi" , "armv5te-unknown-linux" ) ,
39
+ ( "armv7-sony-vita-newlibeabihf" , "armv7-sony-vita" ) ,
40
+ ( "armv7-unknown-linux-uclibceabi" , "armv7-unknown-linux" ) ,
41
+ ( "armv7-unknown-linux-uclibceabihf" , "armv7-unknown-linux" ) ,
42
+ ( "avr-unknown-gnu-atmega328" , "avr-unknown-gnu" ) ,
43
+ ( "csky-unknown-linux-gnuabiv2" , "csky-unknown-linux-gnu" ) ,
44
+ ( "i586-pc-nto-qnx700" , "i586-pc-nto-700" ) ,
45
+ ( "i686-pc-windows-gnullvm" , "i686-pc-windows-gnu" ) ,
46
+ ( "i686-unknown-uefi" , "i686-unknown" ) ,
47
+ ( "loongarch64-unknown-none-softfloat" , "loongarch64-unknown-none" ) ,
48
+ ( "mips-unknown-linux-uclibc" , "mips-unknown-linux" ) ,
49
+ ( "mipsel-unknown-linux-uclibc" , "mipsel-unknown-linux" ) ,
50
+ ( "powerpc-unknown-linux-gnuspe" , "powerpc-unknown-linux-gnu" ) ,
51
+ ( "powerpc-unknown-linux-muslspe" , "powerpc-unknown-linux-musl" ) ,
52
+ ( "powerpc-wrs-vxworks-spe" , "powerpc-wrs-vxworks" ) ,
53
+ ( "x86_64-fortanix-unknown-sgx" , "x86_64-fortanix-unknown" ) ,
54
+ ( "x86_64-pc-nto-qnx710" , "x86_64-pc-nto-710" ) ,
55
+ ( "x86_64-pc-windows-gnullvm" , "x86_64-pc-windows-gnu" ) ,
56
+ ( "x86_64-unknown-l4re-uclibc" , "x86_64-unknown-l4re" ) ,
29
57
] ;
30
58
31
59
fn main ( ) {
32
60
let targets = get_target_list ( ) ;
33
61
34
62
let minicore_path = run_make_support:: source_root ( ) . join ( "tests/auxiliary/minicore.rs" ) ;
35
63
36
- regex_mod ( ) ;
64
+ preprocess_core_ffi ( ) ;
37
65
38
66
for target in targets. lines ( ) {
39
67
if SKIPPED_TARGETS . iter ( ) . any ( |& to_skip_target| target == to_skip_target) {
@@ -50,14 +78,14 @@ fn main() {
50
78
. unwrap_or_else ( || {
51
79
if target. starts_with ( "riscv" ) {
52
80
target
53
- . replace ( "imac" , "" )
54
- . replace ( "gc" , "" )
55
- . replace ( "imafc" , "" )
56
- . replace ( "imc" , "" )
57
- . replace ( "ima" , "" )
58
- . replace ( "im" , "" )
59
- . replace ( "emc" , "" )
60
- . replace ( "em" , "" )
81
+ . replace ( "imac- " , "- " )
82
+ . replace ( "gc- " , "- " )
83
+ . replace ( "imafc- " , "- " )
84
+ . replace ( "imc- " , "- " )
85
+ . replace ( "ima- " , "- " )
86
+ . replace ( "im- " , "- " )
87
+ . replace ( "emc- " , "- " )
88
+ . replace ( "em- " , "- " )
61
89
. replace ( "e-" , "-" )
62
90
. replace ( "i-" , "-" )
63
91
} else {
@@ -172,7 +200,7 @@ fn char_is_signed(defines: &str) -> bool {
172
200
}
173
201
174
202
/// Parse core/ffi/mod.rs to retrieve only necessary macros and type defines
175
- fn regex_mod ( ) {
203
+ fn preprocess_core_ffi ( ) {
176
204
let mod_path = run_make_support:: source_root ( ) . join ( "library/core/src/ffi/mod.rs" ) ;
177
205
let mut content = rfs:: read_to_string ( & mod_path) ;
178
206
0 commit comments