[git commit master 1/1] FAQ: talk about direct dependencies

Mike Frysinger vapier at gentoo.org
Wed Mar 23 22:12:06 UTC 2011


commit: http://git.uclibc.org/uClibc-website/commit/?id=2ef132925f4a5c18b46f8ae5a7da3828778f037f
branch: http://git.uclibc.org/uClibc-website/commit/?id=refs/heads/master

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 FAQ.html |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/FAQ.html b/FAQ.html
index d6b443e..0f16e4f 100644
--- a/FAQ.html
+++ b/FAQ.html
@@ -29,6 +29,8 @@ have additions to this FAQ document, we would love to add them,
 	to __fputc_unlocked", who do I blame?!</a>
 <li><a href="#gnu_malloc">My package builds fine but link fails with errors like "undefined reference
 	to rpl_realloc / rpl_malloc", who do I blame?!</a>
+<li><a href="#needed_defs">My package links fine, but at runtime it can't find symbols (like "tgetnum"),
+	so why is uClibc broken?!</a>
 <li><a href="#job_control">Why do I keep getting "sh: can't access tty; job control
 	turned off" errors?  Why doesn't Control-C work within my shell?</a>
 <li><a href="#autoconf">How do I make autoconf and automake behave?</a>
@@ -476,6 +478,34 @@ How could it be smaller and not suck?</a></h2>
 
 <hr>
 <p>
+<h2><a name="needed_defs">My package links fine, but at runtime it can't find symbols (like "tgetnum"),
+	so why is uClibc broken?!</a></h2>
+<p>
+
+    This error crops up when libraries are not directly linked against other
+    libraries that they need, and at runtime the necessary libraries are
+    implicitly provided (due to yet another ELF in the chain being linked
+    against it).  The most common case is readline and its implicit curses
+    dependency.  Since there are many providers of curses functions out there,
+    and may be swapped out at runtime, readline does not link against any
+    specific library for these functions.  Instead, the idea is that the end
+    application gets to pick which library to link against and the runtime
+    linker (ldso) takes care of fixing up the references.
+    <p>
+    Basically, to fix things, make sure your libraries link directly against
+    whatever libraries they need.  So if readline needs ncurses, make sure
+    it is linked against it.  Do not use `ldd` to verify things, but rather
+    use `readelf -d` (look for DT_NEEDED).  The former shows the whole
+    dependency tree while the latter shows the immediate dependencies.
+    <p>
+    You can catch a lot of these errors by using -Wl,-z,defs in your LDFLAGS
+    when compiling packages.  The linker will abort the final link step if
+    necessary symbols are not found.  The default behavior is to ignore missing
+    symbols when creating shared libraries.
+
+
+<hr>
+<p>
 <h2><a name="job_control">Why do I keep getting "sh: can't access tty; job control
 	turned off" errors?  Why doesn't Control-C work within my shell?</a></h2>
 <p>
-- 
1.7.3.4



More information about the uClibc-cvs mailing list