OSDN Git Service

add an entry about gnu malloc compat option
[uclinux-h8/uClibc.git] / docs / uclibc.org / FAQ.html
index 03dfe4f..d129089 100644 (file)
@@ -24,6 +24,10 @@ have additions to this FAQ document, we would love to add them,
 <li><a href="#wrapper">What happened to the old toolchain wrapper?</a>
 <li><a href="#dev_systems">Is a pre-compiled uClibc development system available?</a>
 <li><a href="#bugs">I think I found a bug in uClibc!  What should I do?!</a>
+<li><a href="#miscompile">My package builds fine but link fails with errors like "undefined reference 
+       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="#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>
@@ -379,6 +383,39 @@ How could it be smaller and not suck?</a></h2>
     strace, ltrace, and or valgrind to create a logfile showing the problem
     behavior.
 
+
+<hr />
+<p>
+<h2><a name="miscompile">My package builds fine but link fails with errors like 
+       "undefined reference to __fputc_unlocked", who do I blame?!</h2>
+<p>
+
+    This error crops up when a build system mixes system headers (say glibc) 
+    with the target headers (say uClibc).  Make sure your build system is not 
+    including extraneous include options (-I) and double check that it is using 
+    the correct compiler.  Many build systems incorrectly force things like 
+    -I/usr/include or -I/usr/local/include or -I${prefix}/include (which usually 
+    just expands to -I/usr/include).
+
+
+<hr />
+<p>
+<h2><a name="gnu_malloc">My package builds fine but link fails with errors like "undefined reference
+       to rpl_realloc / rpl_malloc", who do I blame?!</h2>
+<p>
+
+    This error crops up because you didn't enable MALLOC_GLIBC_COMPAT support.
+    Configure scripts detect whether your libc supports "GNU malloc" features by
+    seeing whether malloc(0) returns NULL (glibc malloc(0) will return a non NULL
+    pointer).  uClibc defaults to malloc(0) returning NULL so autoconf will assume
+    malloc from your libc sucks and procede to try and compile the malloc replacement
+    version in the gnulib addon.  However, since not many packages include gnulib,
+    they will fail to link with rpl_realloc / rpl_malloc errors.  You could force
+    configure to assume working behavior by exporting the variables 'jm_cv_func_working_malloc'
+    (older autoconf) and 'ac_cv_func_malloc_0_nonnull' (newer autoconf) to 'yes'
+    before running `./configure`.
+
+
 <hr />
 <p>
 <h2><a name="job_control">Why do I keep getting "sh: can't access tty; job control
@@ -442,7 +479,7 @@ How could it be smaller and not suck?</a></h2>
      <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html">
     http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html</a>
     for details on valid settings of TZ.  For some additional examples, read
-    <a href="http://www.uclibc.org/lists/uclibc/2002-August/006261.html">
+    <a href="http://www.uclibc.org/lists/uclibc/2002-August/004010.html">
     http://www.uclibc.org/lists/uclibc/2002-August/004010.html</a> in the uClibc
     mailing list archive.
     You can store the value of TZ in the file '/etc/TZ' and uClibc will then