Received: by 10.223.176.46 with SMTP id f43csp704034wra; Sat, 20 Jan 2018 03:13:25 -0800 (PST) X-Google-Smtp-Source: AH8x226/Wq2fYzNF8TypI/ZgsLMqsJu/oQX/dtPM6YTiNkG1Chj8c99oxW7xlMvSoxEj4MhD/g0y X-Received: by 10.99.104.200 with SMTP id d191mr1686331pgc.98.1516446804925; Sat, 20 Jan 2018 03:13:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516446804; cv=none; d=google.com; s=arc-20160816; b=YsMymyT+qHW0R9INWk54ktmCYTzEPi+81bdpBPLzKn8eJhHaxKi4GtuPZi/IQSzoBP uo5+DyvSckd5LCnq0niOnDLBcMI/fFpSyPR0G3fMRCIc3bUi9azf5easPwdo+B2KC1Ib s6WuWt5ZYzjlt68bYUvAon+mVUGvlQkHenv/c1MTMPsxMuijLZjd67X+/q0IpgL0eDg8 Lp39jlKhc/pQqRyjtxiMl4QqQAy7yNbe02rhuAWSbqdKDKneRMbxM0pgaYAurgjRC4+U L/+RSVMZEgeE/2KDRUPffJTKW362tqeZ1uT2ycLM76QRY1QJzWMVMi7tJ6BSDUVESNHm Qz6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:arc-authentication-results; bh=noIExOR9Rj1G3VqlVa4ny0fVWCFYS+fwyG3FKgUku6w=; b=HN68EYr6jH2t5x0oGIT5Z+HKUi3pEi8AEqchCuPdiircS4XkK/CJMRcEzNcLSkrZy9 GNBbDl7nqKwqKjV/cCLj5OmbahZeewcQ57J8m8aHURzmcpAzqAwKqRn/xIQBAJS7IzDm EMULoK/c6HR0eaFQMKU9ej/G6P0StN2WjTfpPewz4wSvG92CQzLy5+dNVwcit5Zwba7a +FlTqEyvx0RR5DzRHiD7RRmn0jxdbeMrjQhOot33oYhRTxV0vC+zolHpapyAu2bddYVB /XfyFePssKeReHgebJ7yhnXOmaCXHQjcSGcBuK35SAS6+ECIuGJNGVkiMSTyyD8PLvuu 6fGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si9155839pgr.248.2018.01.20.03.13.08; Sat, 20 Jan 2018 03:13:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755324AbeATLMB (ORCPT + 99 others); Sat, 20 Jan 2018 06:12:01 -0500 Received: from mx1.mailbox.org ([80.241.60.212]:46028 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbeATLL4 (ORCPT ); Sat, 20 Jan 2018 06:11:56 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 5602A42C15; Sat, 20 Jan 2018 12:11:54 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id dtQVysZvRfAQ; Sat, 20 Jan 2018 12:11:49 +0100 (CET) Subject: Re: ipv6 redefinition build issue with 4.15-rc8 To: Jonas Bonn , Daniel Wagner , Neil MacLeod Cc: connman@lists.01.org, "linux-kernel@vger.kernel.org" , "David S. Miller" , Florian Weimer References: <794202f5-e993-444f-f3fd-891276795926@monom.org> <0d51f6a6-0edc-1c18-3412-5a37cdc83873@hauke-m.de> From: Hauke Mehrtens Message-ID: <144ac8a0-316c-c673-ea40-e220b1600d14@hauke-m.de> Date: Sat, 20 Jan 2018 12:11:46 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/2018 09:49 AM, Jonas Bonn wrote: > On 01/17/2018 11:34 PM, Daniel Wagner wrote: >> >> On 01/17/2018 11:20 PM, Hauke Mehrtens wrote: >>> >>> Do we want to do any changes to the kernel header files? I do not know >>> of any clean workaround to make this work, we can probably hack >>> something for connman, but I think it is not worth the trouble. >> > > Well, it's not _just_ a connman issue, even though it apparently only > shows up there, currently. > > The problem with the kernel patch is that it now pulls in lib-compat.h > which causes problems if it appears before netinet/in.h.  The following > code is sufficient to show the issue: > > #include > #include > #include > > int main(int argc, char** argv) > { > } > > lib-compat checks if _NETINET_IN_H is defined... it's not.  So it > defines __UAPI_DEF_IN6_ADDR. > > Then netinet/in.h checks (via bits/in.h) if _LINUX_IN6_H is defined... > it's not, so it defines the struct in6_addr (and others). > > Then linux/in6.h gets pulled in and redefines the function because the > earlier libc-compat check told it to do so. > > If you comment out the first #include statement then it compiles fine. > > libc-compat has, as you say, a requirement to be ordered after system > headers in order for this to work... that doesn't feel terribly robust. > > Anyway, the bug is probably in the glibc headers that are not checking > the __UAPI_DEF*'s but rather using another broken heuristic... right > place to fix this is probably there. > > /Jonas Florian Weimer said here "A lot of combinations are broken, especially when kernel headers are included first.": https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1411192.html That was on a older version of these two patches: https://www.mail-archive.com/search?l=linux-kernel@vger.kernel.org&q=subject:%22Re%5C%3A+%5C%5Bmusl%5C%5D+Re%5C%3A+%5C%5BPATCH+resent%5C%5D+uapi+libc+compat%5C%3A+allow+non%5C-glibc+to+opt+out+of+uapi+definitions%22&o=newest&f=1 My understanding is that you should include libc headers before Linux headers, otherwise you *could* run into problems. There are some workarounds done to also support including Linux headers first, but they are not working in all cases. Hauke