All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "Jakub Kicinski" <jakub.kicinski@netronome.com>,
	daniel@iogearbox.net, oss-drivers@netronome.com,
	netdev@vger.kernel.org, "Björn Töpel" <bjorn.topel@gmail.com>,
	"Y Song" <ys114321@gmail.com>,
	brouer@redhat.com
Subject: Re: [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf
Date: Tue, 15 May 2018 11:16:43 +0200	[thread overview]
Message-ID: <20180515111643.1507fead@redhat.com> (raw)
In-Reply-To: <20180515081009.4cd33c8e@redhat.com>

SOLVED, how see below

On Tue, 15 May 2018 08:10:09 +0200
Jesper Dangaard Brouer <brouer@redhat.com> wrote:

> On Mon, 14 May 2018 22:57:53 -0700
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> 
> > On Mon, May 14, 2018 at 10:35:01PM -0700, Jakub Kicinski wrote:  
> > > Hi!
> > > 
> > > Following patches address build issues after recent move to libbpf.
> > > For out-of-tree builds we would see the following error:
> > > 
> > > gcc: error: samples/bpf/../../tools/lib/bpf/libbpf.a: No such file or directory
> > > 
> > > libbpf build system is now always invoked explicitly rather than
> > > relying on building single objects most of the time.  We need to
> > > resolve the friction between Kbuild and tools/ build system.
> > > 
> > > Mini-library called libbpf.h in samples is renamed to bpf_insn.h,
> > > using linux/filter.h seems not completely trivial since some samples
> > > get upset when order on include search path in changed.  We do have
> > > to rename libbpf.h, however, because otherwise it's hard to reliably
> > > get to libbpf's header in out-of-tree builds.
> > > 
> > > v2:
> > >  - fix the build error harder (patch 3);
> > >  - add patch 5 (make clang less noisy).    
> > 
> > Applied, Thanks  
> 
> I just tried it out, but the build fails.
> 
> $ make samples/bpf/
>   CHK     include/config/kernel.release
>   CHK     include/generated/uapi/linux/version.h
>   CHK     include/generated/utsrelease.h
>   CHK     include/generated/bounds.h
>   CHK     include/generated/timeconst.h
>   CHK     include/generated/asm-offsets.h
>   CALL    scripts/checksyscalls.sh
>   DESCEND  objtool
>   CHK     scripts/mod/devicetable-offsets.h
> make -C /home/jbrouer/git/kernel/bpf-next/samples/bpf/../../tools/lib/bpf/ RM='rm -rf' LDFLAGS= srctree=/home/jbrouer/git/kernel/bpf-next/samples/bpf/../../ O=
> 
> Auto-detecting system features:
> ...                        libelf: [ OFF ]
> ...                           bpf: [ OFF ]
> 
> No libelf found
> make[2]: *** [Makefile:212: elfdep] Error 1
> make[1]: *** [samples/bpf/Makefile:207: /home/jbrouer/git/kernel/bpf-next/samples/bpf/../../tools/lib/bpf/libbpf.a] Error 2
> make: *** [Makefile:1743: samples/bpf/] Error 2
>  
> 
> But it might not be related to this change, as the problem seems to the
> with the "Auto-detecting system features".  It is the build of libbpf
> that is the problem.
> 
> $ cd tools/lib/bpf/
> $ make
> 
> Auto-detecting system features:
> ...                        libelf: [ OFF ]
> ...                           bpf: [ OFF ]
> 
> No libelf found
> make: *** [Makefile:212: elfdep] Error 1
> 
> 
> And do have 'libelf' installed on this system... the same build/make
> commands works on net-next.
> 
> On net-next I see:
> 
> $ cd tools/lib/bpf/
> $ make
> 
> Auto-detecting system features:
> ...                        libelf: [ on  ]
> ...                           bpf: [ on  ]
> 
> Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
> Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
>   CC       libbpf.o
>   CC       bpf.o
>   CC       nlattr.o
>   CC       btf.o
>   LD       libbpf-in.o
>   LINK     libbpf.a
>   LINK     libbpf.so

SOLVED

It seems that the "Auto-detecting system" needed a 'make clean'.
My problem goes away when I did the following:

$ cd tools/
$ make clean

$ cd lib/bpf/
$ make

Auto-detecting system features:
...                        libelf: [ on  ]
...                           bpf: [ on  ]

  HOSTCC   fixdep.o
  HOSTLD   fixdep-in.o
  LINK     fixdep
Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
  CC       libbpf.o
  CC       bpf.o
  CC       nlattr.o
  CC       btf.o
  LD       libbpf-in.o
  LINK     libbpf.a
  LINK     libbpf.so


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2018-05-15  9:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15  5:35 [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf Jakub Kicinski
2018-05-15  5:35 ` [PATCH bpf-next v2 1/5] samples: bpf: include bpf/bpf.h instead of local libbpf.h Jakub Kicinski
2018-05-15  5:35 ` [PATCH bpf-next v2 2/5] samples: bpf: rename libbpf.h to bpf_insn.h Jakub Kicinski
2018-05-15  5:35 ` [PATCH bpf-next v2 3/5] samples: bpf: fix build after move to compiling full libbpf.a Jakub Kicinski
2018-05-15  6:05   ` Björn Töpel
2018-05-15  5:35 ` [PATCH bpf-next v2 4/5] samples: bpf: move libbpf from object dependencies to libs Jakub Kicinski
2018-05-15  5:35 ` [PATCH bpf-next v2 5/5] samples: bpf: make the build less noisy Jakub Kicinski
2018-05-15  5:57 ` [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf Alexei Starovoitov
2018-05-15  6:10   ` Jesper Dangaard Brouer
2018-05-15  9:16     ` Jesper Dangaard Brouer [this message]
2018-05-15 17:46       ` Jakub Kicinski

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=20180515111643.1507fead@redhat.com \
    --to=brouer@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bjorn.topel@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=ys114321@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.