This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
linker errors when compiling and linking with a new glibc
- From: Daniel De La Zerda <ddelazerda007 at yahoo dot com>
- To: libc-help at sourceware dot org
- Date: Mon, 16 Mar 2009 16:16:55 -0700 (PDT)
- Subject: linker errors when compiling and linking with a new glibc
- Reply-to: Daniel De La Zerda <danieldelazerda at gmail dot com>
I'm new to this so please be patient. I added a function pthread_foo_init() in foo.c with it's respective foo.h under the nptl directory. Then edited the Makefile inside the same directory to reflect these changes. After this I ran make and my new glibc built with no errors at all. I have the libc.so under the main directory of the glibc tree and libpthread.so under nptl. If I do a "nm libpthread.so | grep pthread_mutex_init" I see that the pthread_mutex_init symbol is global and not static - indicated by the "T" right before the function name. When I do "nm libpthread.so | grep pthread_foo_init" I see that it has a "t", and if I'm not mistaken, this means that it is local and static and that it cannot be seen by the outside world. Hence that's why I think I get linker errors when I try to compile a test program that uses my "pthread_foo_init()" saying that I have an "undefined reference to `pthread_foo_init`". Does anyone have any idea how I can solve
this problem? (Note: When I compile I do point gcc to my custom glibc...) I'm able to compile code that uses things that I have not added like plain "pthread_mutex_init() and I'm also able to run Linux binaries like "/bin/cat" using my new library with the "testrun.sh" that comes with the glibc tree.
Thanks for the help in advance,
Daniel