Daniel Jacobowitz > > Vladimir Prus wrote: > > > Hello, > > > I have a small example where use of -static-libgcc and -Wl,-Bstatic > > > flags cause ld.so do assert. > > > > > > I have file app.cpp containing > > > > > > int main() { return 0; } > > > > > > and lib.cpp, which is empty. I compile them with > > > > > > g++ -o lib.so -shared -static-libgcc lib.cpp -Wl,-Bstatic > > > g++ -o app app.cpp lib.so -static-libgcc -Wl,-Bstatic > > What is this trying to accomplish? You're going to get shared > versions of some libraries and dynamic versions of others.
This is trying to get static version of all "runtime" libraries: such as libstd++, libc and libgcc, but link to dynamic lib.so > > > and when I run "./app", I get: > > > > > > Inconsistency detected by ld.so: dl-fini.c: 66: _dl_fini: Assertion > > > `i == _rtld_local._dl_nloaded' failed! > > > > Strange. Under both my kernel 2.4.21 and 2.6.0-test11 with 2.3.2.ds1-10: > > > > [EMAIL PROTECTED]:~/debian/custom/glibc/bugs/227906> ./app > > ./app: error while loading shared libraries: lib.so: cannot open shared > > object file: No such file or directory > > I can't explain the inconsistency (maybe an LD_LIBRARY_PATH) but try > replacing lib.so with ./lib.so on the second g++ line to fix this > error. It does not help. I get exactly the same error. - Volodya