I'm cross compiling a shared library (miniweb) for the beaglebone black device. When I compile without optimizations I have no problems. However, if I compile with any optimizations (ie -O3
) I get the following when trying to run my program:
./myprogram: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.15' not found (required by /usr/lib/libminiweb.so)
My first question, why would enabling optimizations suddenly cause my program to be dependent on this library? Is content statically included in the library when optimizations are disabled?
How can I determine the c library version that my cross-compiler is using? I've run the following command ldd --version
on both systems:
desktop:
$ ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19
Copyright (C) 2014 Free Software Foundation, Inc.
beaglebone:
ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u1) 2.13
Copyright (C) 2011 Free Software Foundation, Inc.
Obviously the library I have is outdated, but as you can see my system reports using eglibc
instead of glibc
?
How could my cross-compiled library be dependent on glibc
? Perhaps running ldd
on my desktop is not an accurate reflection of the libraries used by my cross compiler?
How can I find which c library my cross compiler is using?