powerpc-gnu-linux-uclibc-gcc -DHAVE_CONFIG_H -I.  -I./linux/powerpc
-I./linux  -Wall -Wwrite-strings -g -O2 -MT strace.o -MD -MP -MF
.deps/strace.Tpo -c -o strace.o strace.c
strace.c: In function 'handle_ptrace_event':
strace.c:2369:17: error: 'PTRACE_GETEVENTMSG' undeclared (first use in
this function)
strace.c:2369:17: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [strace.o] Error 1
make[1]: Leaving directory
`/root/build-farm/strace-v4.5.20-42-g8044bc1.builddir'
make: *** [all] Error 2

Got this on building current git master branch of strace, platform:
GNU/li...@powerpc with uClibc std C library.
The last version I tried (strace-v4.5.20-34-g09fa7f8) built
successfully, so I diffed and got that you have added a lot of stuff
into that file:

--- strace-v4.5.20-34-g09fa7f8.srcpkg/strace.c  2010-09-17
21:40:01.000000000 +0200
+++ ./strace.c-42-g8044bc1      2010-12-07 13:50:49.000000000 +0100
<some lines skipped>
+#ifdef LINUX
+static int
+handle_ptrace_event(int status, struct tcb *tcp)
+{
+       if (status >> 16 == PTRACE_EVENT_VFORK ||
+           status >> 16 == PTRACE_EVENT_CLONE ||
+           status >> 16 == PTRACE_EVENT_FORK) {
+               int childpid;
+
+               if (do_ptrace(PTRACE_GETEVENTMSG, tcp, NULL, &childpid) < 0) {
+                       if (errno != ESRCH) {
+                               fprintf(stderr, "\
+%s: handle_ptrace_event: ptrace cannot get new child's pid\n",
+                                       progname);
+                               cleanup();
+                               exit(1);
+                       }
+                       return -1;
+               }
+               return handle_new_child(tcp, childpid, 0);
+       }
+       return 1;
+}
+#endif
<other lines skipped>

Yes, GNU Std C library includes that define inside <sys/ptrace.h>, but
other libs don't. Diving deeper, I also diffed defs.h:

-- strace-v4.5.20-34-g09fa7f8.srcpkg/defs.h     2010-09-17 21:40:01.000000000 
+0200
+++ ./defs.h-42-g8044bc1        2010-12-07 13:50:49.000000000 +0100
@@ -308,6 +308,31 @@
 #define PR_FAULTED      S_CORE
 #endif

+#ifdef LINUX
+# ifndef PTRACE_SETOPTIONS
+#  define PTRACE_SETOPTIONS    0x4200
+# endif
+# ifndef PTRACE_O_TRACEFORK
+#  define PTRACE_O_TRACEFORK   0x00000002
+# endif
<other lines skipped>

So you added a lot here too, some parts are from that glibc's
sys/ptrace.h. But GETEVENTMSG is missing. So here's the patch, which
solves this build problem (attached to letter): to add such definition
for PTRACE_GETEVENTMSG too.

Attachment: strace-v4.5.20-42-g8044bc1-defs.h.patch
Description: Binary data

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to