File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,22 @@ maintenance = { status = "experimental" }
2525libc = { version = " 0.2" , optional = true , default-features = false }
2626cfg-if = " 0.1.10"
2727
28+ # When built as part of libstd
29+ core = { version = " 1.0.0" , optional = true , package = " rustc-std-workspace-core" }
30+ compiler_builtins = { version = " 0.1.2" , optional = true }
31+ alloc = { version = " 1.0.0" , optional = true , package = " rustc-std-workspace-alloc" }
32+
2833[dev-dependencies ]
2934auxv = " 0.3.3"
3035cupid = " 0.6.0"
3136
3237[features ]
3338default = [ " std_detect_dlsym_getauxval" , " std_detect_file_io" ]
34- std_detect_file_io = []
39+ std_detect_file_io = [ " libc " ]
3540std_detect_dlsym_getauxval = [ " libc" ]
36- std_detect_env_override = []
41+ std_detect_env_override = [ " libc" ]
42+ rustc-dep-of-std = [
43+ " core" ,
44+ " compiler_builtins" ,
45+ " alloc" ,
46+ ]
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
8989
9090 #[ cfg( not( feature = "std_detect_dlsym_getauxval" ) ) ]
9191 {
92- let hwcap = unsafe { libc:: getauxval ( AT_HWCAP ) } ;
92+ let hwcap = unsafe { libc:: getauxval ( AT_HWCAP as libc :: c_ulong ) as usize } ;
9393
9494 // Targets with only AT_HWCAP:
9595 #[ cfg( any( target_arch = "aarch64" , target_arch = "mips" , target_arch = "mips64" ) ) ]
@@ -106,7 +106,7 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
106106 target_arch = "powerpc64"
107107 ) ) ]
108108 {
109- let hwcap2 = unsafe { libc:: getauxval ( AT_HWCAP2 ) } ;
109+ let hwcap2 = unsafe { libc:: getauxval ( AT_HWCAP2 as libc :: c_ulong ) as usize } ;
110110 if hwcap != 0 && hwcap2 != 0 {
111111 return Ok ( AuxVec { hwcap, hwcap2 } ) ;
112112 }
Original file line number Diff line number Diff line change 2020#![ cfg_attr( feature = "std_detect_file_io" , feature( vec_spare_capacity) ) ]
2121#![ no_std]
2222
23+ #[ cfg_attr( feature = "rustc-dep-of-std" , allow( unused_extern_crates) ) ]
2324#[ cfg( feature = "std_detect_file_io" ) ]
2425extern crate alloc;
2526
You can’t perform that action at this time.
0 commit comments