Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757557AbcCaSTe (ORCPT ); Thu, 31 Mar 2016 14:19:34 -0400 Received: from www62.your-server.de ([213.133.104.62]:46198 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756772AbcCaSTd (ORCPT ); Thu, 31 Mar 2016 14:19:33 -0400 Message-ID: <56FD6A2C.2010506@iogearbox.net> Date: Thu, 31 Mar 2016 20:19:24 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Alexei Starovoitov , "Naveen N. Rao" , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org CC: "David S . Miller" , Ananth N Mavinakayanahalli , Michael Ellerman , netdev@vger.kernel.org Subject: Re: [PATCH 2/4] samples/bpf: Use llc in PATH, rather than a hardcoded value References: <922f95fb5d16686367a66d2d4bd176149a87e9ad.1459423412.git.naveen.n.rao@linux.vnet.ibm.com> <56FD627D.5080405@fb.com> In-Reply-To: <56FD627D.5080405@fb.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2294 Lines: 47 On 03/31/2016 07:46 PM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: >> While at it, fix some typos in the comment. >> >> Cc: Alexei Starovoitov >> Cc: David S. Miller >> Cc: Ananth N Mavinakayanahalli >> Cc: Michael Ellerman >> Signed-off-by: Naveen N. Rao >> --- >> samples/bpf/Makefile | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile >> index 502c9fc..88bc5a0 100644 >> --- a/samples/bpf/Makefile >> +++ b/samples/bpf/Makefile >> @@ -76,16 +76,13 @@ HOSTLOADLIBES_offwaketime += -lelf >> HOSTLOADLIBES_spintest += -lelf >> HOSTLOADLIBES_map_perf_test += -lelf -lrt >> >> -# point this to your LLVM backend with bpf support >> -LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc >> - >> -# asm/sysreg.h inline assmbly used by it is incompatible with llvm. >> -# But, ehere is not easy way to fix it, so just exclude it since it is >> +# asm/sysreg.h - inline assembly used by it is incompatible with llvm. >> +# But, there is no easy way to fix it, so just exclude it since it is >> # useless for BPF samples. >> $(obj)/%.o: $(src)/%.c >> clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ >> -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ >> - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ >> + -O2 -emit-llvm -c $< -o -| llc -march=bpf -filetype=obj -o $@ >> clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ >> -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ >> - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=asm -o $@.s >> + -O2 -emit-llvm -c $< -o -| llc -march=bpf -filetype=asm -o $@.s > > that was a workaround when clang/llvm didn't have bpf support. > Now clang 3.7 and 3.8 have bpf built-in, so make sense to remove > manual calls to llc completely. > Just use 'clang -target bpf -O2 -D... -c $< -o $@' +1, the clang part in that Makefile should also more correctly be called with '-target bpf' as it turns out (despite llc with '-march=bpf' ...). Better to use clang directly as suggested by Alexei.