mailing list of musl libc
 help / color / mirror / Atom feed
* [musl] Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT
@ 2021-03-29 23:30 Chris Packham
  2021-03-29 23:54 ` [musl] " Dmitry V. Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2021-03-29 23:30 UTC (permalink / raw)
  To: linux-kernel, musl, carlos, davem

Hi,

I've come over from https://github.com/strace/strace/issues/177
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
/home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/in6.h:26,
[ALL  ]                     from
/home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/if_bridge.h:19,
[ALL  ]                     from
/home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:16:
[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
/home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:15:
[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
'/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src'
[ERROR]    make[3]: *** [Makefile:2404: all] Error 2
[ALL  ]    rm ioctlsort0.o ioctls_all0.h ioctlsort0
[ALL  ]    make[3]: Leaving directory
'/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src'
[ERROR]    make[2]: *** [Makefile:601: all-recursive] Error 1
[ALL  ]    make[2]: Leaving directory
'/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace'
[ERROR]    make[1]: *** [Makefile:506: all] Error 2
[ALL  ]    make[1]: Leaving directory
'/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace'

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.

Regards,
Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [musl] Re: Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT
  2021-03-29 23:30 [musl] Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT Chris Packham
@ 2021-03-29 23:54 ` Dmitry V. Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry V. Levin @ 2021-03-29 23:54 UTC (permalink / raw)
  To: Chris Packham; +Cc: linux-api, linux-kernel, musl, carlos, davem

Hi,

On Tue, Mar 30, 2021 at 12:30:52PM +1300, Chris Packham wrote:
> Hi,
> 
> I've come over from https://github.com/strace/strace/issues/177
> 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
> /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/in6.h:26,
> [ALL  ]                     from
> /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/if_bridge.h:19,
> [ALL  ]                     from
> /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:16:
> [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
> /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:15:
> [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
> '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src'
> [ERROR]    make[3]: *** [Makefile:2404: all] Error 2
> [ALL  ]    rm ioctlsort0.o ioctls_all0.h ioctlsort0
> [ALL  ]    make[3]: Leaving directory
> '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src'
> [ERROR]    make[2]: *** [Makefile:601: all-recursive] Error 1
> [ALL  ]    make[2]: Leaving directory
> '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace'
> [ERROR]    make[1]: *** [Makefile:506: all] Error 2
> [ALL  ]    make[1]: Leaving directory
> '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace'
> 
> 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.

This essentially means that such basic things as
#include <netinet/in.h>
#include <linux/in6.h>
are broken in your setup.


-- 
ldv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-29 23:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 23:30 [musl] Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT Chris Packham
2021-03-29 23:54 ` [musl] " Dmitry V. Levin

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git