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