Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754564AbcDYL0X (ORCPT ); Mon, 25 Apr 2016 07:26:23 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:55487 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754407AbcDYL0V convert rfc822-to-8bit (ORCPT ); Mon, 25 Apr 2016 07:26:21 -0400 Message-ID: <571DFED1.1090601@arm.com> Date: Mon, 25 Apr 2016 12:26:09 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Mikko Rapeli , "David S. Miller" , Zhang Shengju , Stephen Hemminger , CC: Jan Engelhardt , Josh Boyer , Waldemar Brodkorb , Gabriel Laskar , , , Rich Felker , nd Subject: Re: [PATCH v2] uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h References: <1461512707-23058-1-git-send-email-mikko.rapeli@iki.fi> In-Reply-To: <1461512707-23058-1-git-send-email-mikko.rapeli@iki.fi> X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: VI1PR02CA0036.eurprd02.prod.outlook.com (10.162.7.174) To HE1PR08MB1097.eurprd08.prod.outlook.com (10.166.87.143) X-MS-Office365-Filtering-Correlation-Id: 1d528744-2d54-4489-9f65-08d36cfc6991 X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB1097;2:GcJqWTq8z2KdRVZBVqIKYDNvzQYLPgJIffHZPy/MUM2Fl/tzGSAjNop94vJktpekm8gEy2GHaVQVbMBk/ac147Q5qMVZKGYF6XdR1L/dVtea8clgMecbsEUDlXJLKRp3NAwTHMMu+YCEsGZEzuaQ+ggGroRSbRSKKeeGh2/veWn9W4DQdjCt6CHrZpI9uaTT;3:dMxG/H4fJWzzd4o65HfjgRX70M5PkXnaEe9yXTuo9LuOOHW4xo4sWf0wdSRetWuIRbesOHE9pINuLMmXeCawQVTAN0E3INb93hVUs0OD7who/lWNliWFOn1lLJzudd2D;25:tf9tcS40wcQHPp7T5203Tz/bQPbrKB2h+e0E/DyUafmCCYcms3em8AAB1+l/vFlXxuCUrJCnzehCQ2xXeizNv/gqye1RDMVRDsbO3Ga8CHCxxPLtozK2LQUMbYxIbY7M9Y/kXpXHnS/Qa59YKbp3753JMdFNLeskI1JcGK23zAGg+zvWllPg+mwv+maRg5h76MCAdvFkGU2pU6lmCQyvR7F/8GAJ455gMaEZk4oyYpxP4pEAVytE4zMtr5H9mGc2qb8/7WzPm9prnA5fqxLIzSQqxFfpPnsFBWpWKhjl1MdMBCb5+9xkjRYU4WlRiy25Wb/B70WuD4gqEqKLbGWnIA==;20:Q9SgSwT6htC4enoBSDmn0I9JRE2DvRcukb1RG9FgmFgFQU2DjGk8IpMPkRpehfxY9l6Y0EmgNoDAVOLzuANNfGqxF8ldFtCjBgmYMq2itFhWdegPML+wKmWF4d6FmZPW2RlnG1b4DGOMeDRa3cd2UHL61RRto9sH5MSvr5NV26M= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB1097; NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:HE1PR08MB1097;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB1097; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB1097;4:j0W01Kcj9IyCQvDBAtM6A7AUr/6rx0SOKlXcn/slInduR1QT5Ty0V8bsifWu9Ll3wCZWCoHhDsujOLY7bMPQrLJQ88W8dOAjSH/EdYco7o1d5Jv0sXP+EtstdmJPhgItTL3g33Qf7N24X8eSvcctHlISJ7z+TR9FjRdxKsFCo+0MuK/sl9vnJX0uGBZVpVJ7E3LYuY6IdEEdj4Wet4lvIS0Erra0ykH6VIhPu90zu7u2x8/1NN+jeHbSu1hv65hVsLuT+8FMU2qLf0pO6c005qhwo3Oia1/sw6ynlLKcmkje2ddQ4TLY0QU8ol+hqzgDSjVLNCjCVgrpUGZ99feQSzQp2HZKQi/yZ/xcM/k4PURblwx41dGjIxlHZTUg6FHsv9hLZQ3gUHAssDkBoCwQbgCu5Cc8j8F8pNe3qmgKzUU= X-Forefront-PRVS: 0923977CCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(24454002)(36756003)(189998001)(81166005)(4326007)(230700001)(77096005)(2906002)(87266999)(50466002)(59896002)(54356999)(92566002)(76176999)(64126003)(6116002)(3846002)(5001770100001)(1096002)(33656002)(65956001)(65816999)(42186005)(86362001)(23676002)(4001350100001)(47776003)(586003)(5004730100002)(66066001)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR08MB1097;H:[10.2.206.73];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB1097;23:/b0iaHYax01iaJ/KfMC0nItx/pd0Wd86DAxpDjyv7a3sHXERavlXeOPW/ugT7CNXsgF5cdN7IWMCOZ5OXvYWwUARwp5D9d8pA5cVou8EkTFzdkTQMw/cRrRUymDzgxC9VKPpPu2YTFwuGyrtO1gKC1vK+ycSm2u2EbIzDjglCqjSnruCyYdR3Q1JU2lxYlr9cyYC8g0yVONpUWA/U+xf/eE998sX4Go2gcoxYnPgeYizs8hf9+kWtyhirWQGzfxTFQ1ibihFT2ZfZ8ku/Pk6l3KReggkISKiDzRRxz9dkdE7QtCQ4bSiRfra6A8KHOVUCE2+b5NnweRO3ou7Wy+YIJGPucL9jDpQ82DPC7tECJSGKuvsjquljFPXJIZzvY0U7uVT0TCJriN4OkVINX+rF/4fDOuz1y+6jOsdXZuNZZEcS6hrIZ/WeZR84gGyXiDCQirnDRyI1QZ+pX0PJWcjcnBZljrPS35QdXR6CywDepYRc5Kgf13412bdcPrgxrF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wma4SXifcs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2016 11:26:13.6206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB1097 X-MC-Unique: M-yvnDXCTAuB3EhBNLmxeA-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1180 Lines: 26 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).