LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2005, 08:59 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux 4/Busybox. Fedora 22, Raspberry Pi
Posts: 98

Rep: Reputation: 15
Unhappy 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Will more shared libraries slow down my system? Yalla-One Slackware 5 04-20-2005 03:01 PM
shared libraries problem after install shadow-4.0.4.1 oluijks Linux From Scratch 0 05-11-2004 04:10 PM
Problem with shared libraries(gtk) k0ljat Linux - Software 1 04-12-2004 01:25 PM
Idraw shared libraries problem sicone Linux - Software 2 03-16-2004 08:49 PM
problem with shared libraries when printing blinux1 Linux - Newbie 4 03-25-2003 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration