Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386276

Re: [PATCH v2] uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h

From Szabolcs Nagy <szabolcs.nagy@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h
Date 2016-04-25 13:30 +0200
Message-ID <rrMSf-4Wa-33@gated-at.bofh.it> (permalink)
References <rrush-6Vr-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 24/04/16 16:45, Mikko Rapeli wrote:
> glibc's net/if.h contains copies of definitions from linux/if.h and these
> conflict and cause build failures if both files are included by application
> source code. Changes in uapi headers, which fixed header file dependencies to
> include linux/if.h when it was needed, e.g. commit 1ffad83d, made the
> net/if.h and linux/if.h incompatibilities visible as build failures for
> userspace applications like iproute2 and xtables-addons.
> 
> This patch fixes compile errors when glibc net/if.h is included before
> linux/if.h:
> 

there should be a way to turn the conflicting definitions
off if a libc header is included first. (the other direction
won't work in general because linux definitions can be wrong
for user space.)

currently the only way to avoid the conflict is to define
__GLIBC__ and a handful of glibc include guard macros that
are not part of any public api, so a libc implementation
might not want to do this.

e.g. the kernel could turn off the potentially conflicting
definitions if the libc defines __LIBC_WANTS_NO_UAPI_DEFS
(it can use finer grain control, but there should be a
non-glibc specific way to do this).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-04-24 17:50 +0200
  Re: [PATCH v2] uapi glibc compat: fix compile errors when glibc net/if.h  included before linux/if.h Szabolcs Nagy <szabolcs.nagy@arm.com> - 2016-04-25 13:30 +0200
    Re: [PATCH v2] uapi glibc compat: fix compile errors when glibc  net/if.h included before linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-04-25 14:20 +0200

csiph-web