Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753897AbdCHSdV (ORCPT ); Wed, 8 Mar 2017 13:33:21 -0500 Received: from mail-qk0-f176.google.com ([209.85.220.176]:34000 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbdCHSdT (ORCPT ); Wed, 8 Mar 2017 13:33:19 -0500 Subject: Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions To: Rich Felker References: <20161111120820.GA435@nyan> <20170308162507.GY1520@brightrain.aerifal.cx> Cc: linux-kernel@vger.kernel.org, "David S. Miller" , linux-api@vger.kernel.org, musl@lists.openwall.com From: "Carlos O'Donell" Organization: Red Hat Message-ID: Date: Wed, 8 Mar 2017 12:29:53 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170308162507.GY1520@brightrain.aerifal.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 33 On 03/08/2017 11:25 AM, Rich Felker wrote: > On Wed, Mar 08, 2017 at 10:53:00AM -0500, Carlos O'Donell wrote: >> On 11/11/2016 07:08 AM, Felix Janda wrote: >>> Currently, libc-compat.h detects inclusion of specific glibc headers, >>> and defines corresponding _UAPI_DEF_* macros, which in turn are used in >>> uapi headers to prevent definition of conflicting structures/constants. >>> There is no such detection for other c libraries, for them the >>> _UAPI_DEF_* macros are always defined as 1, and so none of the possibly >>> conflicting definitions are suppressed. >>> >>> This patch enables non-glibc c libraries to request the suppression of >>> any specific interface by defining the corresponding _UAPI_DEF_* macro >>> as 0. >>> >>> This patch together with the recent musl libc commit >>> >>> http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258 >> >> Would it be possible to amend the musl patch to define the macros to 1. > > I don't follow. They're defined to 0 explicitly to tell the kernel > headers not to define their own versions of these structs, etc. since > they would clash. Defining to 1 would have the opposite meaning. My apologies, I must have misread the original musl patch. Defining them to a known value is exactly what I was looking for. The other outstanding questions remain. -- Cheers, Carlos.