Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp897807yba; Thu, 18 Apr 2019 11:24:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzfGYHIgB3KNsUFt6HOeoWUokMVwFtruT8sjz/V/SeR5DZVF+FN2vCppZvaK7+oYMhA1KK X-Received: by 2002:a65:5682:: with SMTP id v2mr91295818pgs.100.1555611896775; Thu, 18 Apr 2019 11:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611896; cv=none; d=google.com; s=arc-20160816; b=gXtuiJeYlNWK26IuE8fIfI1MC7JtwxnZTW3bClAMFLERufLJqHxWN0R+IiJBRhwV+p 2w4KJyZSwqDkYvEyDvyLzO3lQ9mzodKzWC2iHI+NhNjrJTbZqedrYqZeIE3EZ48LuCKA bB4MdTTZNSkWHK2Zx+4Y0t2kSUyNu0tVnApQK0qcoLaV1hCAP7S8OtPi9O4adht9gAtO FUPSDlULCaf1j5EK8yQb3FjPlY8EECZIjI9QMEVrtD5DMjORVW7/fGjs9Dx2qWCEac+X 5rf/gogUeILJUTQpxNollLhMUVR8ZY86/KBcaHGfH5caJ+TUmZwLB+bzzz72IAHRQWzE 5JTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=M84pVHi7QUoGbkpTQqGc/KjlrR1jeH2e5lPBKjhZDPk=; b=gNpryhMu8joakfJDjQ52hnNM9TKSokdLyhdYSeACPJEIsa2EJy4Qd51P5MKkRCzgO/ EpkfPYDuQ10P22dLJdECBsED1smg+lD2QP/gF7Ev0L5Ujnp4Q8UYN2JRTBMKxfTc+Lrh wfr6k7d7zU7//QQXfsAUWlSk6EoQUsHamNC59X/MDNSsVyOx2QghfGl4KG5qbPVg/K3a +/dQKv1IwFprdCDH3TCn3g7jJWI+CUrIRSrEKO3p8qDu7XhUZ2DaXcltoefRIHsgdOsN 6r0Ezbiz+rGjp5e5cvRVNdmDj7kuu8KO5IinEsA7bGIFncUhCXXRnsUckdeaKQC1p59a Srrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cTAIU/ki"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t136si2473360pgc.538.2019.04.18.11.24.41; Thu, 18 Apr 2019 11:24:56 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cTAIU/ki"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391529AbfDRSXF (ORCPT + 99 others); Thu, 18 Apr 2019 14:23:05 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44829 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391513AbfDRSGk (ORCPT ); Thu, 18 Apr 2019 14:06:40 -0400 Received: by mail-pl1-f196.google.com with SMTP id g12so1505220pll.11; Thu, 18 Apr 2019 11:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=M84pVHi7QUoGbkpTQqGc/KjlrR1jeH2e5lPBKjhZDPk=; b=cTAIU/kiErqEy8Si5CmKVT1NW1pUL07abrAVIzHT0BN8kExtZgl9cmiVM8eRw8pBzX y3FbTznUwrHHyWID8PqSODK7dQI1bSkl7AHqV+jTXT4buiDHyHFii8bZBPInLvb3cKlC dQTLhQFTBUA51JcOesEDuDZXTAIl6mY7i48WuKG8morCwdJpcqTR3EtmyZO07i6IG+F3 e2b3I2YgR9vji9H7iFAkpXb56e/jgclWdD8CFhe946seVPt+Lth1VA8S1U2vnNG1PI36 1Fs8Nu6XhoSLOe4UElMPpCB8ajxeB211MEWYItbTMUw6IpXObzSyay607OScDEZuKZsK soUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=M84pVHi7QUoGbkpTQqGc/KjlrR1jeH2e5lPBKjhZDPk=; b=YmXOUpUW7h0e0pVti6+awCPd/WONXRU9NwCE78d8EwWo9MMlw7WzZNqNxYX7pIqm3+ fEjhxv1orL+qG/LIhjcqrVpkbevDmTK6ON6eYUHIZ2y7e5knfavY+wUH/CEPKb2WH6/K //s93aXfn5KbPGe+yNgP1efX8aZEZ18ezCUpK8crjV/hJ3YFTtYuMEY7wo2oaIi50Bn9 7rWHv3bI4+M2pucbjdgvQe1jk5mzHNTHEq8H4H2SMXutiPgJynSa26xo1NmGCHMO6v2o qPaBPitPRS2cYmzriEFh5LouoAFjCm1kdr+XQ99545Ju7K2NFoeJYti/8bi7LeXft1qg 14qA== X-Gm-Message-State: APjAAAWa+MIjUx2CTSRu2IB9maI0nvJ+hGrQGhjvh12pdKqS3J+nyWaz qPe0ZNH73CnhrVJMALo6W4vz933k X-Received: by 2002:a17:902:7b96:: with SMTP id w22mr97518136pll.28.1555610799643; Thu, 18 Apr 2019 11:06:39 -0700 (PDT) Received: from udknight.localhost ([59.57.228.71]) by smtp.gmail.com with ESMTPSA id k1sm5172670pfc.83.2019.04.18.11.06.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 11:06:38 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id x3II0nFn004727; Fri, 19 Apr 2019 02:00:49 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id x3II0nxA004725; Fri, 19 Apr 2019 02:00:49 +0800 Date: Fri, 19 Apr 2019 02:00:49 +0800 From: Wang YanQing To: Yonghong Song Cc: "ast@kernel.org" , "daniel@iogearbox.net" , Martin Lau , Song Liu , "shuah@kernel.org" , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] selftests/bpf: fix compile errors with older glibc Message-ID: <20190418180049.GA4716@udknight> Mail-Followup-To: Wang YanQing , Yonghong Song , "ast@kernel.org" , "daniel@iogearbox.net" , Martin Lau , Song Liu , "shuah@kernel.org" , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20190417174839.GA16679@udknight> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 18, 2019 at 05:09:53AM +0000, Yonghong Song wrote: > > > On 4/17/19 10:48 AM, Wang YanQing wrote: > > The older glibc (for example, 2.23) doesn't handle __UAPI_DEF_* > > in libc-compat.h properly, and it bring below compile errors: > > I have an even old glibc 2.17 and it still works. Not sure > why it failed here. Could you explain more? We will meet these errors with the combination of some versions of kernel headers and some versions of glibc headers. After some research on the git history of glibc and kernel, I find the reason behind the scene is a little complex: There are some same definitions between glibc's netinet/in.h and kernel's linux/in6.h, IPPROTO_HOPOPTS, etc. These same definitions willn't bring trouble when we include both of them if kernel and glibc coordinates with each other well, but the reality is the coordination is poor and unsynchronous in history. Kernel and glibc uses guard macros to detect whether need to export their definitions, linux/in6.h includes libc-compat.h which will check the guard macro, _NETINET_IN_H, and netinet/in.h includes bits/in.h which will check the guard macro, _UAPI_LINUX_IN6_H (glibc-2.19~821 6c82a2f8d7c8e21e39237225c819f182ae438db3 "Coordinate IPv6 definitions for Linux and glibc"), the problem is in the installation process of kernel headers, the "_UAPI" in _UAPI_LINUX_IN6_H in linux/in6.h will be stripped due to commit 56c176c9cac9 ("UAPI: strip the _UAPI prefix from header guards during header installation"). The good news is the glibc fix this the trouble by checking the guard macro, _LINUX_IN6_H, too. (glibc c9bd40daaee18cf1d9824e4a7ebaebe321e0a5a8 "Bug 20214: Fix linux/in6.h and netinet/in.h sync."). My environment still have this trouble: lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial dpkg -l | grep libc-dev: ii libc-dev-bin 2.23-0ubuntu11 amd64 GNU C Library: Development binaries ii linux-libc-dev:amd64 4.4.0-145.171 amd64 Linux Kernel Headers for development. I will send out the v2 which I will change some words in changelog. Thanks for review.