-
When I run the following: I get the error Would it be possible to just "substitute" the 'getauxval' call with de-abstracted code? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Donno, maybe you can achieve that by using a linker script: https://mcyoung.xyz/2021/06/01/linker-script/#linker-symbols, but IMO it should be fixed in code to not use the symbol if it's unavailable, if the Rust std src uses it unconditionally, consider patch it locally as glibc < 2.17 is not supported by Rust now. |
Beta Was this translation helpful? Give feedback.
-
So I found a very trivial patch for this, which allows linking down to libc 2.12 In the std source file: The only call to 'getauxval()' is on line 268 If you just simply set this variable to 0, it removes the need for the call to 'getauxval()' and changes seemingly nothing It's even meant to return 0 if it's unable to get a value |
Beta Was this translation helpful? Give feedback.
So I found a very trivial patch for this, which allows linking down to libc 2.12
In the std source file:
/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/stack_overflow.rs
The only call to 'getauxval()' is on line 268
let dynamic_sigstksz = unsafe { libc::getauxval(libc::AT_MINSIGSTKSZ) };
If you just simply set this variable to 0, it removes the need for the call to 'getauxval()' and changes seemingly nothing
let dynamic_sigstksz = 0;
It's even meant to return 0 if it's unable to get a value
// If getauxval couldn't find the entry, it returns 0,