Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp871260yba; Thu, 18 Apr 2019 10:58:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGG8vBR6walyZbx+acfdiTjLwCeD3lRdPV6vaXrVYqykj4twIoIQJb8aoGp7dSYwo5m63t X-Received: by 2002:a17:902:2c01:: with SMTP id m1mr29404510plb.22.1555610311256; Thu, 18 Apr 2019 10:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555610311; cv=none; d=google.com; s=arc-20160816; b=uI9+aKvKKhX2+4xGZHhc96XsfeHSWxnjm+urvajJnZakr0D6PgSlpyhQTD4lXCS5qX hgzdM/7aWtFcn3je6Yd9Dvq/oWJwAyUzrCo3ZYu7320WUQv2wg+jzY/54p7awTM/Z0b5 CASL55GppGvZaSLjKwhno/nDWJN04BNhDdZvAZxFwKCJDKtoi0n/E+ylOxcn+uY8tNXi M3E4oLsjSIqSZvqNqmJtvDm8BvaZNl3NoZJwSz8m/EhvWMQwN31d9mFUmsAyrJzDPhmd bZx+MmQdjyc0DWqFAOWxeuG5hxKczeIV/9bnTnN0S6lJk5xYKCK0QrGEu956ptt1c5WW FHqg== 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=ei9ZRDep78R0s/auEl9w3oKUwbX4lmff2EOSSLEf3wle7bNc3udgufq5VCAW/R6IZ9 EK4hD4VxHFoo5qpKeauPD216rhRGmcz3atZJiOLVtuildboSwFpYae7pArN7QsgWwDSB LRJv1VykolNBk8DATSEJ4MAJYA79vYA9kZLa1L68vB03/FwdDyFAGT6FHX4GGOetOn79 CV3g3O9ecd1i26Ks6JvboLnnBN0kXSnNRPnxtezs8fUNLtYgOqqfqL8ewKC/kSVdr+Y5 rWUGW+24GMpHpAPBiPGQZwaFhKGBCU+i5VdzGFaGQ77X+QW2Y2knynosH0EOvT93DiZQ /j1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mlY0oAkz; 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 y29si2579012pgk.120.2019.04.18.10.58.15; Thu, 18 Apr 2019 10:58:31 -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=mlY0oAkz; 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 S2389316AbfDRR5V (ORCPT + 99 others); Thu, 18 Apr 2019 13:57:21 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37215 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388301AbfDRR5V (ORCPT ); Thu, 18 Apr 2019 13:57:21 -0400 Received: by mail-pg1-f194.google.com with SMTP id e6so1541158pgc.4; Thu, 18 Apr 2019 10:57:20 -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=mlY0oAkzq0+MVQFSgkGQhAjwKSgeRsRSBghWqkCn1MtnC+Gvl4FKgHzfJ0Ie8Lo5kP rPjKirrf8OAaFomqCOXoFB1SjHNxJo5v27Ko0zEBQ8OqkV5vjFqHIcup/8w2IQvSLUqn KHgVtebB3PtHkOVZFZEP3IftK2Wn44fDFA63pm5Ss4wW8Pv/GjoF/OxsQFsT1pGXiWsJ VMab1ep0K4joWPdH/G8y0JmGiAE9h0d9+/36HXg1DQN3I1wtIjBiEA0UuN2PRwpAycKX Qz4xy6SiipLbGR0vbAsd8jIPvL8JzGFe8rI6SbwvYUTyVjrFnDzfizzP7Jhv/ZZ7huZn LJCA== 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=CS9TCXp3O2g2F3UVKt1ZFT4InQ3Phh7HYH3IQwnL4BsaAK/U+m7OHPKkXHnxH4EBTk osc/nKOJ6H2I0qfB7t04hExw6yoaHUOOxqdJ0UGAx2lI8/ltHzlFwurOgYC04ak+GlNn 2nL5i9umemtQ5BBGwS2nXmS7OEQJRDSWeQB4Yy2thp3ZoxeqJPN/ihm/G9RiaxoCT7Mt 1ntB4Yyfz9SSJvAmKcLPPF7L2la0RYT70RWBj8+roHIvJYISpSb+DnwmTRqoGwDZQ8JV Xn1KbRYMbtar0t/u98DP4vx/GW5LAaEKCY7YuzyYIWVPE8jOH4TdLBgLy/g1o3Ifx6Ff fOQg== X-Gm-Message-State: APjAAAUrjjafwPa2m8LYNn9u+29XDM62+X2EOkOroohccHIl8QYCPl4A BDy00AxcUgFVXRdL9sK7rv4EQmE8 X-Received: by 2002:a63:30c5:: with SMTP id w188mr89134996pgw.76.1555610239907; Thu, 18 Apr 2019 10:57:19 -0700 (PDT) Received: from udknight.localhost ([59.57.228.71]) by smtp.gmail.com with ESMTPSA id l19sm3502465pff.1.2019.04.18.10.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 10:57:19 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id x3IHxla1004504; Fri, 19 Apr 2019 01:59:47 +0800 Received: (from root@localhost) by localhost.localdomain (8.14.9/8.14.9/Submit) id x3IHBjrL020471; Fri, 19 Apr 2019 01:11:45 +0800 Date: Fri, 19 Apr 2019 01:11:44 +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: <20190418171144.GA4210@udknight-ThinkPad-E550> 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.