@@ -31,57 +31,12 @@ fn main() {
31
31
println ! ( "cargo::rustc-check-cfg=cfg(usdt_backend_linker)" ) ;
32
32
println ! ( "cargo::rustc-check-cfg=cfg(usdt_backend_standard)" ) ;
33
33
34
- // `asm` feature was stabilized in 1.59
35
- let have_stable_asm = version_check:: is_min_version ( "1.59" ) . unwrap_or ( false ) ;
36
- // `asm_sym` feature was stabilized in 1.66
37
- let have_stable_asm_sym = version_check:: is_min_version ( "1.66" ) . unwrap_or ( false ) ;
38
-
39
- // Are we being built with a compiler which allows feature flags (nightly)
40
- let is_nightly = version_check:: is_feature_flaggable ( ) . unwrap_or ( false ) ;
41
-
42
- let feat_asm = env:: var_os ( "CARGO_FEATURE_ASM" ) . is_some ( ) ;
43
- let feat_strict_asm = env:: var_os ( "CARGO_FEATURE_STRICT_ASM" ) . is_some ( ) ;
44
-
45
34
let backend = match env:: var ( "CARGO_CFG_TARGET_OS" ) . ok ( ) . as_deref ( ) {
46
- Some ( "macos" ) if feat_asm => {
47
- if have_stable_asm && have_stable_asm_sym {
48
- Backend :: Linker
49
- } else if feat_strict_asm || is_nightly {
50
- if !have_stable_asm {
51
- println ! ( "cargo:rustc-cfg=usdt_need_feat_asm" ) ;
52
- }
53
- if !have_stable_asm_sym {
54
- println ! ( "cargo:rustc-cfg=usdt_need_feat_asm_sym" ) ;
55
- }
56
- Backend :: Linker
57
- } else {
58
- Backend :: NoOp
59
- }
60
- }
61
- Some ( "illumos" ) | Some ( "solaris" ) if feat_asm => {
62
- if have_stable_asm {
63
- Backend :: Standard
64
- } else if feat_strict_asm || is_nightly {
65
- println ! ( "cargo:rustc-cfg=usdt_need_feat_asm" ) ;
66
- Backend :: Standard
67
- } else {
68
- Backend :: NoOp
69
- }
70
- }
71
- _ => {
72
- if !have_stable_asm {
73
- println ! ( "cargo:rustc-cfg=usdt_need_feat_asm" ) ;
74
- }
75
- Backend :: NoOp
76
- }
35
+ Some ( "macos" ) => Backend :: Linker ,
36
+ Some ( "illumos" ) | Some ( "solaris" ) => Backend :: Standard ,
37
+ _ => Backend :: NoOp ,
77
38
} ;
78
39
79
- // Since visibility of the `asm!()` macro differs between the nightly feature and the
80
- // stabilized version, the consumer requires information about its availability
81
- if have_stable_asm {
82
- println ! ( "cargo:rustc-cfg=usdt_stable_asm" ) ;
83
- }
84
-
85
40
match backend {
86
41
Backend :: NoOp => {
87
42
println ! ( "cargo:rustc-cfg=usdt_backend_noop" ) ;
0 commit comments