cross-compiling strace 4.20 for ARM

Dmitry V. Levin ldv at altlinux.org
Wed Nov 22 09:28:55 UTC 2017


Hi,

On Wed, Nov 22, 2017 at 09:45:07AM +0100, Felix von Leitner wrote:
> 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.

IOV_MAX *must* be provided by <limits.h>; if it isn't, then your cross-compiling
environment is not quite functional.

> 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?

All these constants are generated during build,
their definitions should be in sen.h file.

> 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.

This configuration is among those I tested recently.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20171122/23c2ef73/attachment.bin>


More information about the Strace-devel mailing list