cross-compiling strace 4.20 for ARM

Felix von Leitner felix-strace at fefe.de
Wed Nov 22 08:45:07 UTC 2017


Good morning!

I'm trying to debug an embedded Linux box that does not come with an
strace, so I figured I'd cross compile strace for it. It is not going so
well. Any help appreciated.

First obstacle:

mmsghdr.c:97:14: error: 'IOV_MAX' undeclared here (not in a function); did you mean 'INT_MAX'?
  int namelen[IOV_MAX];
              ^~~~~~~
              INT_MAX

(This is gcc 7.1 for arm-linux-gnueabi, with binutils 2.29 and a freshly compiled glibc 2.26).


So I add an

  #ifndef IOV_MAX
  #define IOV_MAX 1024
  #endif

Same issue in msghdr.c.

So far so good, but the next one is stumping me:

pathtrace.c: In function 'pathtrace_match_set':
pathtrace.c:166:7: error: 'SEN_dup2' undeclared (first use in this function); did you mean 'sys_dup2'?
  case SEN_dup2:
       ^~~~~~~~
       sys_dup2
pathtrace.c:166:7: note: each undeclared identifier is reported only once for each function it appears in
pathtrace.c:167:7: error: 'SEN_dup3' undeclared (first use in this function); did you mean 'SEN_dup2'?
  case SEN_dup3:
       ^~~~~~~~
       SEN_dup2

(and so on for dozens of syscalls). Where are these symbols supposed to come from? What am I doing wrong?
For the record: compiling strace natively for x86_64 works with the same glibc.
Kernel headers are from Linux 4.14 for both ARM and x86_64.

Thanks,

Felix




More information about the Strace-devel mailing list