Glibc questions
Hi all,
AFAIK, in addition to implementing the standard C library, glibc provides wrappers for system calls, threading support, and basic application facilities. So because of that, glibc that will be used on my target system should be built based on the kernel version running on my target, right? Based on the above, I am trying to build a glibc version for my target machine's kernel. However, I don't know to to build a glibc library for a target system and also where on the target's filesystem should be put? In which location Linux will start looking for the libraries required for a program to run (should I create an /etc/ld.so.conf file)? Thanks a lot for any help. |
Glibc alone will not do at all.
The important thing is gcc, which creates objects depending on the glibc, which was used to build the gcc. You will probably need a complete tool chain : 1) binutils ( includes the ld / linker files ). 2) gcc 3) glibc + some headers from the target kernel. Location : /home/"user"/tools/ or /opt/tools/ or /usr/local/tools/ .. whatever you like.
|
Quote:
|
Thank you all for your interest.
My host is Ubunty 9.10 and my target is an Atom 330 (x86). The target machine is used as an embedded system. My host's kernel version is 2.6.31-14-generic and the host's glibc version is 2.10.1-0ubuntu15. I am using the GCC provided by Ubuntu's "build-essesntial" package. The version of GCC is 4.4.1. What I have understand is that I need to somehow install the glibc version which I used to compile my programs to the target's filesystem so that dynamic linking can be done. Can you advise me on how to do so? Let's say that I have a hello world program like the following, which is dynamically linked: Code:
#include <stdio.h> Code:
linux-gate.so.1 => (0x00723000) Thanks in advance. |
Quote:
Are you able to boot the target to a bash prompt? |
Quote:
Thanks. |
'ls /lib/libc-2*'
.. will show which glibc you already have on the atom system. Replacing it with another version : Will most often break the system. Glibc is the system. ( Together with the kernel.) ..... |
Quote:
Thanks. |
Please define running ..
I guess, you have a few commands available. Can you do the command 'ls' ? Example from "tty Linux", a Linux OS, total 8 MB : ldd /bin/ls .. the reply is : libc.so.6 , which is glibc. May be you have a ' libc-2.x.so in another location ? Please try : ls -R / | grep libc-2* EDIT : Or : ls -R / | grep libc* ..... |
Quote:
Code:
[user@machine:~]:ldd $(which bash) |
Quote:
Are you using uClinux and busybox? Quote:
How did you build the kernel on your target? The answer to that question will tell us how to help you get the correct libc on your target. |
Quote:
Quote:
I know it's not the smartest/best way of doing it but it will work at all? Thanks! |
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 08:21 PM. |