Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751853AbdCPI06 (ORCPT ); Thu, 16 Mar 2017 04:26:58 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:55743 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055AbdCPI0x (ORCPT ); Thu, 16 Mar 2017 04:26:53 -0400 Date: Thu, 16 Mar 2017 10:26:44 +0200 From: Mikko Rapeli To: David Woodhouse Cc: Hauke Mehrtens , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jarod@redhat.com, jogo@openwrt.org, david.heidelberger@ixit.cz, maillist-linux@barfooze.de Subject: Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC Message-ID: <20170316082644.GD8672@lakka.kapsi.fi> References: <20170312220039.16885-1-hauke@hauke-m.de> <20170312220039.16885-4-hauke@hauke-m.de> <1489651152.4195.192.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1489651152.4195.192.camel@infradead.org> X-SA-Exim-Connect-IP: 2001:1bc8:1004::1 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 24 On Thu, Mar 16, 2017 at 07:59:12AM +0000, David Woodhouse wrote: > On Sun, 2017-03-12 at 23:00 +0100, Hauke Mehrtens wrote: > > __USE_MISC is glibc specific and not available in musl libc. Only do > > this check when glibc is used. This fixes a problem with musl libc. > > ... > > -/* Coordinate with glibc net/if.h header. */ > > -#if defined(_NET_IF_H) && defined(__USE_MISC) > > +/* Coordinate with libc net/if.h header. */ > > +#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) > > I *really* don't like building up a plethora of knowledge about > specific libc implementations in the kernel. As a general rule, if we > have *anything* that depends on __GLIBC__ then we are Doing It Wrong™. Kernel does not depend on glibc but uapi headers check for some defintions so that userspace code can include both libc and kernel header files without compiler errors. This interface between kernel and libc header files is messy due to long history of copying header files from kernel to libc implementations etc and thus this kind of ifdef magic with in depth knowledge of various libc's defintions is currently unavoidable. -Mikko