Problem with shared libraries (uClibc) on small embedded system. Help !
I’m trying to get a small embedded system running with shared libraries. It all works when I build my programs with “–static”, but to save room I now need to share libraries. But I’m having no joy. I’ve read the Program Library HOWTO and done everything that seems relevant
Development is on a 2.2.16 kernel, and the embedded system is a 2.4.8. I’m using uClibc which may be in odd place, but it works. I’m creating a file system image for my embedded system in a subdirectory called tiny-linux, then generate a rom file system, and gzip the result into an initrd image. It all works OK until I try to build/run a program using shared libraries. Build on the development system goes like … [mike@local mapit]$ make gcc -Wall -g -isystem/usr/i386-linux-uclibc/usr/include/ -O -c mapit.c gcc -Wall -o mapit mapit.o -nostdlib -nostartfiles /usr/i386-linux-uclibc/usr/li b/crt0.o -L/usr/i386-linux-uclibc/usr/lib/ -lc -lm [mike@local mapit]$ ldd mapit /lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x40017000) libc.so.0 => /usr/i386-linux-uclibc/lib/libc.so.0 (0x40022000) libm.so.0 => /usr/i386-linux-uclibc/lib/libm.so.0 (0x4005f000) libc.so.6 => /lib/libc.so.6 (0x40066000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) [mike@local mapit]$ [root@local work]# ldconfig -p -r./tiny-linux 9 libs found in cache `/etc/ld.so.cache' libutil.so.0 (ELF) => /lib/libutil.so.0 libresolv.so.0 (ELF) => /lib/libresolv.so.0 libpthread.so.0 (ELF) => /lib/libpthread.so.0 libnsl.so.0 (ELF) => /lib/libnsl.so.0 libm.so.0 (ELF) => /lib/libm.so.0 libdl.so.0 (ELF) => /lib/libdl.so.0 libcrypt.so.0 (ELF) => /lib/libcrypt.so.0 libc.so.0 (ELF) => /lib/libc.so.0 ld-uClibc.so.0 (ELF) => /lib/ld-uClibc.so.0 [root@local work]# When I run it on the target system all I get is # ls -l /bin/mapit -rwxr-xr-x 1 root root 27161 Jan 1 1970 /bin/mapit # ./bin/mapit ./bin/mapit: No such file or directory # As I said, if I build the program with “-static” everything is OK. It seems to me that it’s down to the libraries needed to resolve stuff when I build the program. I assume ld-linux.so is the loader, can I simply copy the loader from my development system, or should I be using ld-uClibc.so, in which case how do I tell the linker to use that rather then ld-linux.so. Also libNoVersion. What’s that for ? Is there some way I can discover why that’s being linked to. And lib.so.6, why is it using that rather than lib.so.0 Any help appreciated. |
All times are GMT -5. The time now is 02:07 AM. |