From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560AbeAZCQm (ORCPT ); Thu, 25 Jan 2018 21:16:42 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45066 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbeAZCQk (ORCPT ); Thu, 25 Jan 2018 21:16:40 -0500 X-Google-Smtp-Source: AH8x225hsfPUxALZpobqTtaT0VV6oe8NvoGAjuFl4RuwmZql/oC2OXEydcQWTLHKkoARaXaH7e7EBg== Date: Thu, 25 Jan 2018 18:16:37 -0800 From: Alexei Starovoitov To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , netdev@vger.kernel.org Subject: Re: [PATCH net-next v1] samples/bpf: Partially fixes the bpf.o build Message-ID: <20180126021636.ghu7p7ds7yvkqato@ast-mbp> References: <20180126003930.10573-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180126003930.10573-1-mic@digikod.net> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 01:39:30AM +0100, Mickaël Salaün 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). could you provide an example? What symbols will be missing? I don't think there is an issue with existing Makefile. > 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). is that some future patches? 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. > Signed-off-by: Mickaël Salaün > 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 = -target $(ARCH) > endif > > # Trick to allow make to be run from this directory > -all: > +all: $(LIBBPF) > $(MAKE) -C ../../ $(CURDIR)/ > > clean: > $(MAKE) -C ../../ M=$(CURDIR) clean > @rm -f *~ > > +$(LIBBPF): FORCE > + $(MAKE) -C $(dir $@) $(notdir $@) > + > $(obj)/syscall_nrs.s: $(src)/syscall_nrs.c > $(call if_changed_dep,cc_s_c) > > -- > 2.15.1 >