wrong configure check for off_t == long long

John Spencer maillist-strace at barfooze.de
Sat Nov 2 17:43:50 UTC 2013


on a 64 bit linux system, with musl libc (off_t is long long), the 
following happens:

configure:6234: checking for long long off_t
conftest.c:42:6: error: size of array 'a' is negative

| #include <sys/types.h>
| char a[(sizeof (off_t) == sizeof (long long) &&
|         sizeof (off_t) > sizeof (long)) - 1];
|

configure:6254: result: no

the problem is the second part of the check, which is completely bogus 
on a 64bit system, where sizeof long long == sizeof long.
i'm not sure what the intent of that second condition was, but it seems 
all wrong and should be removed. whether the size of long matches the 
size of long long is completely irrelevant.

btw, while you're at it please consider merging this compatibility patch:
http://git.alpinelinux.org/cgit/aports/plain/main/strace/strace-musl.patch
(author is Timo Teräs <timo.teras at iki.fi>)

using the above patch plus a hack to workaround the buggy configure 
check, plus the CFLAGS -Dsigcontext_struct=sigcontext, plus a sed 
statement replacing all occurences of linux/socket.h with sys/socket.h, 
strace 4.8 builds successfully against musl libc (at least on x86_64).

thanks,
--JS




More information about the Strace-devel mailing list