Stryker2k2
Stryker2k2

Reputation: 168

How to you compile glibc (32-bit and 64-bit)?

Right now, I have a modified version of a open-source dependency library (mylib.a file) in my project and thus I have it statically linked via gcc command(s). I am getting the error that...

"statically linked applications require at runtime the shared libraries from the glibc version used for linking"

My translation: my static dependency library cannot dynamically use glibc; it must also be compiled and dynamically linked. Thus, I'm trying to compile and statically link glibc.

I've gather that they would need to be compiled, the *.a library placed in a folder within the project, the "-I//location//" added in for the include headers, and the "-L//location//" added in for the libraries themselves.

But, for the question itself...

How to you compile glibc (32-bit and 64-bit)?

Through open-source research, I've found this link and I have cloned the repo but I cannot find any documentation on how to actually compile it.

git clone git://sourceware.org/git/glibc.git

Any thoughts or suggestions are welcomed.

Upvotes: 0

Views: 714

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

My translation: my static dependency library cannot dynamically use glibc; it must also be compiled and dynamically linked. Thus, I'm trying to compile and statically link glibc.

As n.m. pointed out, your translation is wrong.

You are trying to link a fully static executable, and GLIBC is warning you that such executable will not run correctly on any machine with a different version of GLIBC installed.

Instead of trying to build a fully-static executable, build it such that it uses libc.so.6 (you can still link mylib.a into such executable).

IF the reason you added -static to your link is that you have both libmylib.a and libmylib.so, and would like to link in the former instead of the latter, read this answer.

Upvotes: 2

Related Questions