Received: by 10.223.176.46 with SMTP id f43csp407608wra; Fri, 26 Jan 2018 00:32:26 -0800 (PST) X-Google-Smtp-Source: AH8x226uqeCX7jf74rtyM5PTOcn5uuHwtSgvYBXDl15CozJJuNpOulo656cZMGHSQ2YutdZO1B3Q X-Received: by 10.98.181.14 with SMTP id y14mr18625888pfe.216.1516955546466; Fri, 26 Jan 2018 00:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516955546; cv=none; d=google.com; s=arc-20160816; b=VTJLMsWUdSEzulWkYEzXk5PK1zcpOEyXM3vEO+QwvNIze9R6E027G7xpQ+sS21Lf9U crVsZz1lbf3C0Y23jutV8mC3mEZsiZu2EpbzaUDlMQj9cPJO7Cye1B5mAqwty0b8n6xC OH8z0Pg0ag2aYAXZZi/8PDZky4iNApaOxbXxaXEHl2FoghpaLv4qPO5c7VAWUnStx8FM AA2IplusI0/lJ+QbPX152Aho87+QZRNbs9/kAkxxudMp54B2r4xX/HCEHi/P3BeDZMd/ ODYa7HgSPM2xobAhhqQsjNZtWsDarIIrVJW+dL6JX09KSgpnbY6J7YXDNEdAlMb80dA3 urUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=TPx23Stsky48kint+c2oeaycrSkkX4uAjESTJQrDbK8=; b=umkGaSEtvVpWp29XIqkMyyrPsRJf19FWT/fGwDizJUoh4Pw1wNA5KvEWPtU6EkWtG8 euqGHFTQPjIn1QSshY1tAy17vKfWce+Zfm6Q3yizYuybR65qEPtgF4HSteMSBZFt0J8i gzUDgl3PwbnL4Gn31lRL97elLFtqZDUwkmatqKty5RIVDdUtr2i1YSrLewJ5XtuxXJ3r arkQ6NGWD/hzgBGXgCz1T0XQdRQIDoJ8+pWEt3yUtxjv1IT+oXVjHNLjtEXBnh0G0Run DBixfOIZdxDXYn+WzyXVksh7d0JpR12zt/2qvPjEEio/ajhIsfr1QKJQll5f02yXLgvT rvDA== 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 x1-v6si3362712pln.620.2018.01.26.00.32.10; Fri, 26 Jan 2018 00:32:26 -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 S1752531AbeAZIb1 (ORCPT + 99 others); Fri, 26 Jan 2018 03:31:27 -0500 Received: from smtp-sh2.infomaniak.ch ([128.65.195.6]:57174 "EHLO smtp-sh2.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbeAZIbT (ORCPT ); Fri, 26 Jan 2018 03:31:19 -0500 Received: from smtp6.infomaniak.ch (smtp6.infomaniak.ch [83.166.132.19]) by smtp-sh.infomaniak.ch (8.14.5/8.14.5) with ESMTP id w0Q8UpAS004828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jan 2018 09:30:52 +0100 Received: from ns3096276.ip-94-23-54.eu (ns3096276.ip-94-23-54.eu [94.23.54.103]) (authenticated bits=0) by smtp6.infomaniak.ch (8.14.5/8.14.5) with ESMTP id w0Q8Uac5056195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 26 Jan 2018 09:30:51 +0100 Subject: Re: [PATCH net-next v1] samples/bpf: Partially fixes the bpf.o build To: Alexei Starovoitov Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , netdev@vger.kernel.org References: <20180126003930.10573-1-mic@digikod.net> <20180126021636.ghu7p7ds7yvkqato@ast-mbp> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <0a92b999-c65a-0b5d-8e44-872af7003d4a@digikod.net> Date: Fri, 26 Jan 2018 09:30:26 +0100 User-Agent: MIME-Version: 1.0 In-Reply-To: <20180126021636.ghu7p7ds7yvkqato@ast-mbp> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rvY7GIb8Ka2iCEu9uWxjZrtwj2a9gpsxg" X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rvY7GIb8Ka2iCEu9uWxjZrtwj2a9gpsxg Content-Type: multipart/mixed; boundary="7gohTC9hMGMKQ3LiLsIyN15jSYdzaWLsE"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: Alexei Starovoitov Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , netdev@vger.kernel.org Message-ID: <0a92b999-c65a-0b5d-8e44-872af7003d4a@digikod.net> Subject: Re: [PATCH net-next v1] samples/bpf: Partially fixes the bpf.o build References: <20180126003930.10573-1-mic@digikod.net> <20180126021636.ghu7p7ds7yvkqato@ast-mbp> In-Reply-To: <20180126021636.ghu7p7ds7yvkqato@ast-mbp> --7gohTC9hMGMKQ3LiLsIyN15jSYdzaWLsE Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 26/01/2018 03:16, Alexei Starovoitov wrote: > On Fri, Jan 26, 2018 at 01:39:30AM +0100, Micka=EBl Sala=FCn wrote: >> Do not build lib/bpf/bpf.o with this Makefile but use the one from the= >> library directory. This avoid making a buggy bpf.o file (e.g. missing= >> symbols). >=20 > could you provide an example? > What symbols will be missing? > I don't think there is an issue with existing Makefile. You can run this commands: make -C samples/bpf; nm tools/lib/bpf/bpf.o > a; make -C tools/lib/bpf; nm tools/lib/bpf/bpf.o > b; diff -u a b Symbols like bzero and sys_bpf are missing with the samples/bpf Makefile, which makes the bpf.o shrink from 25K to 7K. >=20 >> This patch is useful if some code (e.g. Landlock tests) needs both the= >> bpf.o (from tools/lib/bpf) and the bpf_load.o (from samples/bpf). >=20 > is that some future patches? Yes, I'll send them next week. >=20 > we're trying to move everything form samples/bpf/ into selftests/bpf/ > and convert to use libbpf.a instead of obsolete bpf_load.c > Please use this approach for landlock as well. Ok, it should be better with this lib. >=20 >> Signed-off-by: Micka=EBl Sala=FCn >> Cc: Alexei Starovoitov >> Cc: Daniel Borkmann >> --- >> >> This is not a complet fix because the call to multi_depend with >> $(host-cmulti) from scripts/Makefile.host force the build of bpf.o >> anyway. I'm not sure how to completely avoid this automatic build >> though. >> --- >> samples/bpf/Makefile | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile >> index 7f61a3d57fa7..64335bb94f9f 100644 >> --- a/samples/bpf/Makefile >> +++ b/samples/bpf/Makefile >> @@ -201,13 +201,16 @@ CLANG_ARCH_ARGS =3D -target $(ARCH) >> endif >> =20 >> # Trick to allow make to be run from this directory >> -all: >> +all: $(LIBBPF) >> $(MAKE) -C ../../ $(CURDIR)/ >> =20 >> clean: >> $(MAKE) -C ../../ M=3D$(CURDIR) clean >> @rm -f *~ >> =20 >> +$(LIBBPF): FORCE >> + $(MAKE) -C $(dir $@) $(notdir $@) >> + >> $(obj)/syscall_nrs.s: $(src)/syscall_nrs.c >> $(call if_changed_dep,cc_s_c) >> =20 >> --=20 >> 2.15.1 >> >=20 --7gohTC9hMGMKQ3LiLsIyN15jSYdzaWLsE-- --rvY7GIb8Ka2iCEu9uWxjZrtwj2a9gpsxg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAlpq5ycACgkQIt7+33O9 apUJXQgAmr4bma8Jow/DSrz6c7Bt+IlJ3RgMHDPWlAUKDtdDf9cinLmvX8yt/0TT cB7llWZVIXaQ6DfcmxTVuVq/7WbdoHSihR5fWkLRPBSArfKpJsBdpaRRoEczZoKp 7BU4F7THZjGx0vqDTYFJCK4PkM7c9djaGYICirsHw2mXfaHhnsURqFBXOogNDSBe AisGDSn60Uwb7g57uv5rh1ccDmsgjiVmnIhb1gYuxsfvTFx7KJ5/cOPevUjXD+jk YZ6edq1780v+jeJBNa+m+OaQLDjibxuecg0eGm/qEPeHnnDv2do4l8RrJEqrtQsC +28eBwxIUkTslmqZZE32Rzcfov2xCA== =sqYJ -----END PGP SIGNATURE----- --rvY7GIb8Ka2iCEu9uWxjZrtwj2a9gpsxg--