How can I link glibc statically with qt
I have built a static version of qt and download a static version of glibc. Now I would like to link glibc statically to my qt application. I know about going into the .pro and adding the line LIBS += -L path/to/static_lib but I am wondering if these that is enough? Will it still link glibc statically even though the OS I am building on has the dynamic libraries also? The reason I am doing this is to deploy the application in a standalone manner. (After installing and updating Red Hat 5.3 glibc_2.9 was not found on the target computer)
Passing -static to gcc will force it to link statically when possible.
Alternatively, download and install CentOS 5 and build on that.
As you discovered, linking fully statically with glibc is not possible, because for instance nss support is loaded dynamically. However, the required glibc version depends mostly on the features you actually use.