r/AskProgrammers • • 2h ago

why does some project have binaries for different stdlibc?

i dont get it, shouldnt they just compile into one hexadecimal blob?

1 Upvotes

2 comments sorted by

2

u/Dashing_McHandsome 2h ago

There are multiple C runtimes that exist and multiple versions of each of those runtimes. A particular runtime and version can be selected for a number of reasons. Since your question is inadequate it won't be able to be answered. You will need to be a lot more specific in your question.

1

u/pedersenk 2h ago

If you link an entirely static binary (usually -static) then it doesn't rely on a specific stdlibc to run.

But the rationale behind not doing that is so every program doesn't duplicate a copy of e.g. strcpy.

Also, if your dependant libraries you link aren't themselves statically linked, you end up linking to whatever stdlibc the system is using anyway.