On Fri, Nov 02, 2012 at 04:33:45PM +0100, Sedat Dilek wrote: > With the latest ltrace from GIT repository my build on MIPSEL breaks with > the following error messages: > > [ build.log ] > ... > output.c: In function 'delim_output': > output.c:626:3: error: implicit declaration of function 'open_memstream' > [-Werror=implicit-function-declaration] > output.c:626:15: error: initialization makes pointer from integer without a > cast [-Werror] > cc1: all warnings being treated as errors > make[3]: *** [output.lo] Error 1 > > My self-compiled MIPSEL toolchain consists of gcc-4.7.2-RC and uClibc-0.9.33.2 > and I have set in my uClibc dot-config file: > > UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y > > ...which allows the usage of open_memstream(). > > While digging deeper into the problem I have found a thread on uClibc-ML [1] > called "stdio.h and open_memstream()". > There people recommended to set "-D_GNU_SOURCE" to the compiler flags and > the reporter confirmed this worked for him. > > First, I tried to set this flag globally in my ltrace Makefile, but this > leads to more errors like "...D_GNU_SOURCE redefined..." as some other > c-files like "proc.c" have this define already. > > Thus add a separate define to "output.c" file. > This fixes the issue for me.
Hi, I can confirm that I see the same issue with both my uclinux and linux-gnu (eglibc) mipsel toolchains. The man page for open_memstream says that _GNU_SOURCE needs to be defined for glibc older than 2.10. I think Sedats patch is good. Reviewed-by: Edgar E. Iglesias <[email protected]> > > Tested against ltrace-git (commit 5511311: "Drop two non-bugs from ltrace.1") > > [1] http://lists.uclibc.org/pipermail/uclibc/2012-January/046279.html > > Signed-off-by: Sedat Dilek <[email protected]> > --- > output.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/output.c b/output.c > index 94c433d..1555f2f 100644 > --- a/output.c > +++ b/output.c > @@ -24,6 +24,7 @@ > > #include "config.h" > > +#define _GNU_SOURCE /* For open_memstream. */ > #include <stdio.h> > #include <stdlib.h> > #include <stdarg.h> > -- > 1.7.9.5 > _______________________________________________ Ltrace-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel
