@deadwood
With --sysroot I seem to be able to use the cross toolchain to compile x86_64 ABIv11 executables, but when compiling libsmb2 (for smb2fs) I get duplicate member th_off and th_x2 errors in <netinet/tcp.h>.
The reason it seems is because in this code part:
struct tcphdr {
...
#if BYTE_ORDER == LITTLE_ENDIAN
u_char th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if BYTE_ORDER == BIG_ENDIAN
u_char th_off:4, /* data offset */
th_x2:4; /* (unused) */
#endif
both "BYTE_ORDER == LITTLE_ENDIAN" and "BYTE_ORDER == BIG_ENDIAN" conditions are evaluated as true by the pre-processor (most likely because the macros are undefined). If I add -D__BSD_VISIBLE to CFLAGS then I don't get these errors.