Skip to content

Is it possible to link to glibc < 2.16? #303

Answered by skep1337
skep1337 asked this question in Q&A
Discussion options

You must be logged in to vote

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,

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by skep1337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants