Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4412550yba; Wed, 17 Apr 2019 10:55:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoPe0rk/lmbDxxrx/nvcj/76DyBpU9wDiZm9BYLqm9MAoDbg466dsbBTnesp6MYxyoN2wG X-Received: by 2002:a63:5a4b:: with SMTP id k11mr49517990pgm.119.1555523758974; Wed, 17 Apr 2019 10:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555523758; cv=none; d=google.com; s=arc-20160816; b=BpA0T/gK7cOWeqJdPMeyBUBbFsp+izXwZ5Q5IjnerJ0t6ZpTrj+tBLXNmpmxo+oCKP /QO5njlUPjfJdCHtsrw/bXftFa9dwWXfaxRyts9rgs3VuG3ChG01FaaaZ2WDKQdtLvR5 GtXlup5Xj+/+nzmUE12wgAEx5J+izyo+SUu5m3f2PE7uTKgGQJxgyuxm7YGHIu7RTpEt tKp1JJfN84lEOGoE7Q2CJM38r5blIfAjBbJOC2dJevx0ihngq0nxfYGuKv0snl1stFAp mPwa0YaVuAjhOMOrcSTBVCudU20QLgJbjh+2cn8bl2qKs+3zLHR+byFanDG40fotJ1Hg JEkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=y9rf2VbQ19opfqPjdZnguxWyfymBk0j8jACOfJPVGDU=; b=ImNNytihFWPx3DlK/LPl5V2k5Z6bJ7JD0AAwTPh2ScUX+7EKXACGiuE3AhFpIcdfmW 7XgFl1DuWVrZxUi3HlW/f8TFN8a7sWsdGxLqmb8w2TkHrV8GMddSfj246p9yPiKx/Xon 5FntKZcC85t1K0vvBmg4A8jOhnR4gtbAjsiqPCJu6nA4VzUQ4Bjf6ueuTkUpuSPFLisG D9kRGa1YAcK6xoxgwLSKIb5iumceWqMdsvT5+eBsnCiuC3ZUGK4WRbRbQJNaHuHHdawO MvoyJdV8FvJWDNnQyxitlNGqNMGJfns66IADIDi6z35Zza7sw53jkY1HMjWeIK+chSwt Ltjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QvUYi924; 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 g11si47441172pgo.563.2019.04.17.10.55.43; Wed, 17 Apr 2019 10:55:58 -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=QvUYi924; 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 S1733191AbfDQRxg (ORCPT + 99 others); Wed, 17 Apr 2019 13:53:36 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38984 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730799AbfDQRxg (ORCPT ); Wed, 17 Apr 2019 13:53:36 -0400 Received: by mail-pl1-f195.google.com with SMTP id a96so12378451pla.6; Wed, 17 Apr 2019 10:53:35 -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:mime-version :content-disposition:user-agent; bh=y9rf2VbQ19opfqPjdZnguxWyfymBk0j8jACOfJPVGDU=; b=QvUYi924emJGksEr2foZ1lKY+boQEAnIQd8Yvqm3uc2Xx0nijMzVFlSkERP0TP1HSI cf4s+i64cxltbSE2a+lw3LwmtctuwpUlvdSaQXGSdUf01n21iMX8wTfFbklb5dwpgJ8w w5WfpHixPYEe/v5A69r52L3LDnDdqbey8q3BTMBwrgs7TdUmkhzlKaVLV21mHR6fIyeb GyaWv3dU/jt3AMbWkiuyl9pv7VVI3MroMn8mcgKGwthHissWSQvn1IbMiC454aLn1une p0L1yHclC8XTq68H8CeBdZvwQpaiOaAkSof8QOoDd5RTvuMdy8/CBMx2z3Wh05whIX0+ Ganw== 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:mime-version:content-disposition:user-agent; bh=y9rf2VbQ19opfqPjdZnguxWyfymBk0j8jACOfJPVGDU=; b=UfAjFB7RTlij5y80DGuhFp4LhjlunxHZH08XT3s8hx0DxYAhQQSEv0SHlzY/z8VaJW E6JxDI4/hjA8LEco/LNKuVX816BfI+2iC/9LLhs/4vzbYoYyN/NjzUbX3mI8x2a3yIYJ 1Owsm+9P5R3t66eb1pTEJ34BljBnPZU6O63TC2xyBhVU9qXjLtBQ9CShB9LGZ+JvhXat dSg2qH6PP2T77oF1JFGKXUXtzkaHCWmzwaE2ImFnpsHyGSb11uAIu3VbTQOQhf/zc9qa /IbEOVZBaWStlrJ9m86jzzaY1HsM3GERXsRW09r5VOHAV6TnXLqKC6n38eHU36rCTvCX x7KA== X-Gm-Message-State: APjAAAWEuR3KFc3QSIl42nLan7JrIm9W+GEjKhcOuLWxxuUmsX3cQZ4y 3J6I+tptlOQYgw1derzbOoC1H8NH X-Received: by 2002:a17:902:8ecc:: with SMTP id x12mr90506705plo.0.1555523615459; Wed, 17 Apr 2019 10:53:35 -0700 (PDT) Received: from udknight.localhost ([59.57.228.71]) by smtp.gmail.com with ESMTPSA id d25sm73973725pfn.154.2019.04.17.10.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:53:34 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id x3HHmmbt016727; Thu, 18 Apr 2019 01:48:48 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id x3HHmddJ016691; Thu, 18 Apr 2019 01:48:39 +0800 Date: Thu, 18 Apr 2019 01:48:39 +0800 From: Wang YanQing To: ast@kernel.org Cc: daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/bpf: fix compile errors with older glibc Message-ID: <20190417174839.GA16679@udknight> Mail-Followup-To: Wang YanQing , ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 The older glibc (for example, 2.23) doesn't handle __UAPI_DEF_* in libc-compat.h properly, and it bring below compile errors: " In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:101:5: error: expected identifier IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ ^ /usr/include/linux/in6.h:131:26: note: expanded from macro 'IPPROTO_HOPOPTS' ^ In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:103:5: error: expected identifier IPPROTO_ROUTING = 43, /* IPv6 routing header. */ ^ /usr/include/linux/in6.h:132:26: note: expanded from macro 'IPPROTO_ROUTING' ^ In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:105:5: error: expected identifier IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ ^ /usr/include/linux/in6.h:133:26: note: expanded from macro 'IPPROTO_FRAGMENT' " The same compile errors are reported for test_tcpbpf_kern.c too. This patch fixes the compile errors by moving to before the . Signed-off-by: Wang YanQing --- tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c | 2 +- tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c index 74f73b3..c7c3240 100644 --- a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include @@ -9,7 +10,6 @@ #include #include #include -#include #include "bpf_helpers.h" #include "bpf_endian.h" #include "test_tcpbpf.h" diff --git a/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c b/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c index edbca20..ec6db6e 100644 --- a/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include @@ -9,7 +10,6 @@ #include #include #include -#include #include "bpf_helpers.h" #include "bpf_endian.h" #include "test_tcpnotify.h" -- 1.8.5.6.2.g3d8a54e.dirty