Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 30 Mar 2021 12:30:52 +1300
From: Chris Packham <>
Subject: Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h
 incompatibility for __UAPI_DEF_IN6_ADDR_ALT


I've come over from
there's a bit of context there.

Crosstool-ng has hit a problem when building a recent enough version
of strace in a configuration that uses musl libc.

The error is

[ALL  ]    In file included from
[ALL  ]                     from
[ALL  ]                     from
[ERROR]    /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/libc-compat.h:109:
error: "__UAPI_DEF_IN6_ADDR_ALT" redefined [-Werror]
[ALL  ]      109 | #define __UAPI_DEF_IN6_ADDR_ALT  1
[ALL  ]          |
[ALL  ]    In file included from
[ALL  ]    /home/x-tool/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr/include/netinet/in.h:401:
note: this is the location of the previous definition
[ALL  ]      401 | #define __UAPI_DEF_IN6_ADDR_ALT 0
[ALL  ]          |
[ALL  ]    cc1: all warnings being treated as errors
[ERROR]    make[4]: *** [Makefile:6660: libstrace_a-rtnl_mdb.o] Error 1
[ALL  ]    make[4]: Leaving directory
[ERROR]    make[3]: *** [Makefile:2404: all] Error 2
[ALL  ]    rm ioctlsort0.o ioctls_all0.h ioctlsort0
[ALL  ]    make[3]: Leaving directory
[ERROR]    make[2]: *** [Makefile:601: all-recursive] Error 1
[ALL  ]    make[2]: Leaving directory
[ERROR]    make[1]: *** [Makefile:506: all] Error 2
[ALL  ]    make[1]: Leaving directory

It appears that the bundled uapi headers definition of
__UAPI_DEF_IN6_ADDR_ALT conflicts with the musl libc definition. It
looks like libc-compat.h tries to co-exists with GNU libc but this
isn't working for musl. I've identified an egregious hack that I think
should make things work (CFLAGS+=-D__USE_MISC) but I wanted to know if
there was a nicer way to make this work.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.