public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox•net>
To: Alexei Starovoitov <ast@fb•com>,
	"Naveen N. Rao" <naveen.n.rao@linux•vnet.ibm.com>,
	linux-kernel@vger•kernel.org, linuxppc-dev@lists•ozlabs.org
Cc: "David S . Miller" <davem@davemloft•net>,
	Ananth N Mavinakayanahalli <ananth@in•ibm.com>,
	Michael Ellerman <mpe@ellerman•id.au>,
	netdev@vger•kernel.org
Subject: Re: [PATCH 2/4] samples/bpf: Use llc in PATH, rather than a hardcoded value
Date: Thu, 31 Mar 2016 20:19:24 +0200	[thread overview]
Message-ID: <56FD6A2C.2010506@iogearbox.net> (raw)
In-Reply-To: <56FD627D.5080405@fb.com>

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 <ast@fb•com>
>> Cc: David S. Miller <davem@davemloft•net>
>> Cc: Ananth N Mavinakayanahalli <ananth@in•ibm.com>
>> Cc: Michael Ellerman <mpe@ellerman•id.au>
>> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux•vnet.ibm.com>
>> ---
>>   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.

  reply	other threads:[~2016-03-31 18:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <922f95fb5d16686367a66d2d4bd176149a87e9ad.1459423412.git.naveen.n.rao@linux.vnet.ibm.com>
2016-03-31 17:43 ` [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c Alexei Starovoitov
2016-03-31 18:46   ` Naveen N. Rao
2016-03-31 19:19     ` Alexei Starovoitov
     [not found] ` <ba23d688b3550c3f22dd0dd6d5cb1233c2f34816.1459423412.git.naveen.n.rao@linux.vnet.ibm.com>
2016-03-31 17:46   ` [PATCH 2/4] samples/bpf: Use llc in PATH, rather than a hardcoded value Alexei Starovoitov
2016-03-31 18:19     ` Daniel Borkmann [this message]
2016-04-01 14:37       ` Naveen N. Rao
2016-04-01 17:56         ` Alexei Starovoitov
     [not found] ` <0ce1c8bdff478db55490a90db6732c4db9de6f22.1459423412.git.naveen.n.rao@linux.vnet.ibm.com>
2016-03-31 17:49   ` [PATCH 3/4] samples/bpf: Simplify building BPF samples Alexei Starovoitov
2016-03-31 18:51     ` Naveen N. Rao
2016-03-31 19:20       ` Alexei Starovoitov
     [not found] ` <28a3811d03f6e8f7dca989a4ade536bf9aa8c7ce.1459423412.git.naveen.n.rao@linux.vnet.ibm.com>
2016-03-31 17:52   ` [PATCH 4/4] samples/bpf: Enable powerpc support Alexei Starovoitov
2016-04-01 14:41     ` Naveen N. Rao
2016-04-01 17:58       ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FD6A2C.2010506@iogearbox.net \
    --to=daniel@iogearbox$(echo .)net \
    --cc=ananth@in$(echo .)ibm.com \
    --cc=ast@fb$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=naveen.n.rao@linux$(echo .)vnet.ibm.com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox