From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>,
netdev@vger.kernel.org, bblanco@plumgrid.com,
borkmann@iogearbox.net, linux-kbuild@vger.kernel.org
Subject: Re: [net-next PATCH 3/4] samples/bpf: add a README file to get users started
Date: Tue, 26 Apr 2016 07:34:12 -0700 [thread overview]
Message-ID: <20160426143410.GA39797@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <571F61D6.50101@iogearbox.net>
On Tue, Apr 26, 2016 at 02:40:54PM +0200, Daniel Borkmann wrote:
> On 04/26/2016 01:56 PM, Jesper Dangaard Brouer wrote:
> >>>+Compiling requires having installed:
> >>>+ * clang
> >>>+ * llvm >= version 3.7.0
please change it to 3.7.1, since 3.7.0 had several bugs.
They're rare, but better to avoid the issue.
> >>>+
> >>>+Note that LLVM's tool 'llc' must support target 'bpf', list with command::
> >>>+
> >>>+ $ llc --version
> >>>+ LLVM (http://llvm.org/):
> >>>+ LLVM version 3.x.y
> >>>+ [...]
> >>>+ Host CPU: xxx
> >>>+
> >>>+ Registered Targets:
> >>>+ [...]
> >>>+ bpf - BPF (host endian)
> >>>+ bpfeb - BPF (big endian)
> >>>+ bpfel - BPF (little endian)
there always be 3 targets for bpf, since some folks need to cross-compile.
> >>>+Manually compiling LLVM with 'bpf' support
> >>>+------------------------------------------
> >>>+
> >>>+In some LLVM versions the BPF target were marked experimental. To
> >>>+compile LLVM manually and enable BPF target run (build dependencies
> >>>+are cmake and gcc-c++)::
> >>>+
> >>>+ $ git clone http://llvm.org/git/llvm.git
> >>>+ $ cd llvm
> >>>+ $ mkdir build; cd build
> >>>+ $ cmake .. -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=BPF
> >>>+ $ make
> >>
> >>That's perhaps a bit misleading in the sense that when you clone the
> >>tree from git, you'd nowadays invoke cmake normally with LLVM_TARGETS_TO_BUILD
> >>instead of LLVM_EXPERIMENTAL_TARGETS_TO_BUILD for BPF, as BPF is not an
> >>experimental target anymore. It's probably also recommended to clone
> >>clang into tools/ dir as well under your llvm/ repo when you compile
> >>from scratch anyways.
yes. LLVM_EXPERIMENTAL_TARGETS_TO_BUILD is the thing of the past
when bpf was just merged into llvm < 3.7
By default llvm will build all non-experimental backends including bpf.
If you need to make llc binary smaller you can use:
-DLLVM_TARGETS_TO_BUILD="BPF;X86"
Also fedora and ubuntu ship with llvm that has bpf support.
> >Can you come up with a formulation/desc I can use instead then?
>
> You mean how to build with clang? There are various docs/snippets out
> there, for example, see the 'Build LLVM and Clang development libs'
> part of [1], that you can tweak for your README with.
>
> [1] https://gist.github.com/brendangregg/cfa482acb71aa577789c
yep. +1 for the link.
next prev parent reply other threads:[~2016-04-26 14:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 11:09 [net-next PATCH 0/4] samples/bpf: Improve user experience Jesper Dangaard Brouer
2016-04-26 11:09 ` [net-next PATCH 1/4] samples/bpf: add back functionality to redefine LLC command Jesper Dangaard Brouer
2016-04-26 11:36 ` Daniel Borkmann
2016-04-26 11:09 ` [net-next PATCH 2/4] samples/bpf: Makefile verify LLVM compiler avail and bpf target is supported Jesper Dangaard Brouer
2016-04-26 11:09 ` [net-next PATCH 3/4] samples/bpf: add a README file to get users started Jesper Dangaard Brouer
2016-04-26 11:44 ` Daniel Borkmann
2016-04-26 11:56 ` Jesper Dangaard Brouer
2016-04-26 12:40 ` Daniel Borkmann
2016-04-26 14:34 ` Alexei Starovoitov [this message]
2016-04-26 11:09 ` [net-next PATCH 4/4] samples/bpf: allow make to be run from samples/bpf/ directory Jesper Dangaard Brouer
2016-04-26 14:35 ` Alexei Starovoitov
2016-04-27 13:15 ` David Laight
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=20160426143410.GA39797@ast-mbp.thefacebook.com \
--to=alexei.starovoitov@gmail.com \
--cc=bblanco@plumgrid.com \
--cc=borkmann@iogearbox.net \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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