Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757586AbcCaRr1 (ORCPT ); Thu, 31 Mar 2016 13:47:27 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:20553 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756321AbcCaRrZ (ORCPT ); Thu, 31 Mar 2016 13:47:25 -0400 Subject: Re: [PATCH 2/4] samples/bpf: Use llc in PATH, rather than a hardcoded value To: "Naveen N. Rao" , , References: <922f95fb5d16686367a66d2d4bd176149a87e9ad.1459423412.git.naveen.n.rao@linux.vnet.ibm.com> CC: "David S . Miller" , Ananth N Mavinakayanahalli , Michael Ellerman , Daniel Borkmann , From: Alexei Starovoitov Message-ID: <56FD627D.5080405@fb.com> Date: Thu, 31 Mar 2016 10:46:37 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-31_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1956 Lines: 42 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 $@'