Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161109011145.GA31880@nyan>
Date: Tue, 8 Nov 2016 20:11:45 -0500
From: Felix Janda <felix.janda@...teo.de>
To: musl@...ts.openwall.com
Subject: kernel header compatibility

The recent commit 04983f2272382af92eb8f8838964ff944fbb8258 (make
netinet/in.h suppress clashing definitions from kernel headers)
intends to address some of the conflicts between the kernel and musl
libc headers. Namely it tries to allow the inclusion of kernel headers
after libc header by defining __UAP_DEF_* macros. However this doesn't
work because the relevant linux headers include <linux/libc-compat.h>,
which unconditionally redefines the constants. For example

#include <netinet/in.h>
#include <linux/in6.h>

leads to

#define __UAPI_DEF_IN_ADDR 0 // from <netinet/in.h>
#define __UAPI_DEF_IN_ADDR 1 // from <linux/libc-compat.h>

So we still get two conflicting definitions of struct in6_addr.


By adding the hack "#define _LIBC_COMPAT_H" to <netinet/in.h>, this
particular example compiles.


Maybe the kernel people can be convinced to add #ifdef guards around
all of the (non glibc) __UAPI_* definitions in <linux/libc-compat.h>.

Felix

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.