1
1
// Check that all symbols in cdylibs, staticlibs and bins are mangled
2
+ //@ only-linux (non-linux has other symbols, unreasonable to exhaustively check)
2
3
3
4
use run_make_support:: object:: read:: { Object , ObjectSymbol } ;
4
5
use run_make_support:: { bin_name, dynamic_lib_name, object, rfs, rustc, static_lib_name} ;
@@ -21,7 +22,7 @@ fn symbols_check_archive(path: &str) {
21
22
let file = object:: read:: archive:: ArchiveFile :: parse ( & * binary_data) . unwrap ( ) ;
22
23
for symbol in file. symbols ( ) . unwrap ( ) . unwrap ( ) {
23
24
let symbol = symbol. unwrap ( ) ;
24
- let name = strip_underscore_if_apple ( std:: str:: from_utf8 ( symbol. name ( ) ) . unwrap ( ) ) ;
25
+ let name = std:: str:: from_utf8 ( symbol. name ( ) ) . unwrap ( ) ;
25
26
if name. starts_with ( "_ZN" ) || name. starts_with ( "_R" ) {
26
27
continue ; // Correctly mangled
27
28
}
@@ -54,7 +55,7 @@ fn symbols_check(path: &str) {
54
55
if symbol. is_weak ( ) {
55
56
continue ; // Likely an intrinsic from compiler-builtins
56
57
}
57
- let name = strip_underscore_if_apple ( symbol. name ( ) . unwrap ( ) ) ;
58
+ let name = symbol. name ( ) . unwrap ( ) ;
58
59
if name. starts_with ( "_ZN" ) || name. starts_with ( "_R" ) {
59
60
continue ; // Correctly mangled
60
61
}
@@ -78,7 +79,3 @@ fn symbols_check(path: &str) {
78
79
panic ! ( "Unmangled symbol found: {name}" ) ;
79
80
}
80
81
}
81
-
82
- fn strip_underscore_if_apple ( symbol : & str ) -> & str {
83
- if cfg ! ( target_vendor = "apple" ) { symbol. strip_prefix ( "_" ) . unwrap ( ) } else { symbol }
84
- }
0 commit comments