File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,22 @@ maintenance = { status = "experimental" }
25
25
libc = { version = " 0.2" , optional = true , default-features = false }
26
26
cfg-if = " 0.1.10"
27
27
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
+
28
33
[dev-dependencies ]
29
34
auxv = " 0.3.3"
30
35
cupid = " 0.6.0"
31
36
32
37
[features ]
33
38
default = [ " std_detect_dlsym_getauxval" , " std_detect_file_io" ]
34
- std_detect_file_io = []
39
+ std_detect_file_io = [ " libc " ]
35
40
std_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, ()> {
89
89
90
90
#[ cfg( not( feature = "std_detect_dlsym_getauxval" ) ) ]
91
91
{
92
- let hwcap = unsafe { libc:: getauxval ( AT_HWCAP ) } ;
92
+ let hwcap = unsafe { libc:: getauxval ( AT_HWCAP as libc :: c_ulong ) as usize } ;
93
93
94
94
// Targets with only AT_HWCAP:
95
95
#[ cfg( any( target_arch = "aarch64" , target_arch = "mips" , target_arch = "mips64" ) ) ]
@@ -106,7 +106,7 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
106
106
target_arch = "powerpc64"
107
107
) ) ]
108
108
{
109
- let hwcap2 = unsafe { libc:: getauxval ( AT_HWCAP2 ) } ;
109
+ let hwcap2 = unsafe { libc:: getauxval ( AT_HWCAP2 as libc :: c_ulong ) as usize } ;
110
110
if hwcap != 0 && hwcap2 != 0 {
111
111
return Ok ( AuxVec { hwcap, hwcap2 } ) ;
112
112
}
Original file line number Diff line number Diff line change 20
20
#![ cfg_attr( feature = "std_detect_file_io" , feature( vec_spare_capacity) ) ]
21
21
#![ no_std]
22
22
23
+ #[ cfg_attr( feature = "rustc-dep-of-std" , allow( unused_extern_crates) ) ]
23
24
#[ cfg( feature = "std_detect_file_io" ) ]
24
25
extern crate alloc;
25
26
You can’t perform that action at this time.
0 commit comments