strace doesn't build with older glibc versions (loop.c breaks)

Mike Frysinger vapier at
Mon Dec 16 17:20:07 UTC 2013

On Monday 16 December 2013 07:29:45 Rolf Eike Beer wrote:
> I try to build strace 4.8 against an old glibc (2.3.4). This breaks
> multiple times in loop.c. The failures I found so far are:
> -the glibc <linux/loop.h> forbids the header to be used from glibc using
> programs, because glibc uses a 32 bit dev_t, which would cause wrong struct
> layout in loop_info. I fixed this by this before including <linux/loop.h>:

there is no "glibc linux/loop.h".  what you're describing is actually the 
kernel's loop.h, and it's from the pre-userspace sanitization days.

the kernel header linux/loop.h doesn't use dev_t, it uses __kernel_old_dev_t.  
it was fixed here:
commit 3f586c74e6b1620bb495d8a1508ec40f5d301d8e
Author: Andries E. Brouwer <andries.brouwer at>
Date:   Fri Apr 18 03:18:49 2003 -0700

that was first released in linux-2.5.68 in Apr 2003.

so the question really is, do we care about linux systems using kernel headers 
that are more than a decade old ?  i think the sane answer is "no".

it would be easy to add a check like so though:
#include <linux/version.h>
int loop_ioctl(struct tcb *tcp, long code, long arg)
	/* Your system is too old for us to care.  */
	return 0;
... existing code ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the Strace-devel mailing list