linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Tom Rix" <trix@redhat.com>,
	"Roberto Sassu" <roberto.sassu@huawei.com>,
	"Quentin Monnet" <quentin@isovalent.com>,
	"Andres Freund" <andres@anarazel.de>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Pavithra Gurushankar" <gpavithrasha@gmail.com>,
	"Yang Jihong" <yangjihong1@huawei.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Leo Yan" <leo.yan@linaro.org>, "Martin Liška" <mliska@suse.cz>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	llvm@lists.linux.dev, "Stephane Eranian" <eranian@google.com>
Subject: Re: [PATCH v1 02/13] perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL
Date: Mon, 13 Mar 2023 18:05:06 -0300	[thread overview]
Message-ID: <ZA+QAvj0DIpxTGSS@kernel.org> (raw)
In-Reply-To: <ZA+Ot0dnX0MNZKmn@kernel.org>

Em Mon, Mar 13, 2023 at 05:59:35PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Mar 13, 2023 at 05:34:06PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Mon, Mar 13, 2023 at 01:27:21PM -0700, Ian Rogers escreveu:
> > > On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo
> > > > (.text+0x1b): undefined reference to `main'
> > > > /usr/bin/ld: final link failed: file in wrong format
> > > > collect2: error: ld returned 1 exit status
> > > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
> > > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1
> > > > make[3]: *** [Makefile.perf:236: sub-make] Error 2
> > > > make[2]: *** [Makefile:70: all] Error 2
> > > > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1
> > > > make: *** [Makefile:103: build-test] Error 2
> > > > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf'
> > > >
> > > > real    5m55.192s
> > > > user    62m31.596s
> > > > sys     14m30.828s
> > > > ⬢[acme@toolbox perf-tools-next]$
> > > 
> > > Sorry, I was testing this on top of:
> > > https://lore.kernel.org/lkml/20230116010115.490713-1-irogers@google.com/
> > > The issue being that we're trying to use an old libbpf that the has
> > > meant disabling things but:
> > >   NO_BPF_SKEL := 1
> > > hadn't been set as part of this. I can address in v2, but with the
> > > "assume libbpf 1.0+" patch I hadn't been worrying about this as we'd
> > > error out for this case  - rather than build error. The erroring out
> > > can be worked around by just not having libbpf be dynamic (ie static
> > > or not at all by adding NO_LIBBPF=1).
> > 
> > I'll try adding that 3-patch series before this one.
> 
> ⬢[acme@toolbox perf-tools-next]$ git log --oneline -16
> 76c8a07f51703787 (HEAD -> perf-tools-next) perf build: Error if no libelf and NO_LIBELF isn't set
> 030a6c72b38e334d perf build: Remove redundant NO_NEWT build option
> 5d1360fc84cd2e3b perf build: If libtraceevent isn't present error the build
> e25e0db4700aa39a perf build: Switch libpfm4 to opt-out rather than opt-in
> 39f53202a8961d3d perf symbol: Add abi::__cxa_demangle C++ demangling support
> d857f258f3d1214a tools build: Add feature test for abi::__cxa_demangle
> 7aae0d8341c9c373 perf build: Make binutil libraries opt in
> dc4890e772aba1e9 perf build: Error if jevents won't work and NO_JEVENTS=1 isn't set
> 334e64172816623d perf util: Remove weak sched_getcpu
> e44d7e7c60fc4ded perf build: Remove unused HAVE_GLIBC_SUPPORT
> 14ea53be45758450 perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL
> eb03903c5c119254 perf build: Support python/perf.so testing
> f8b579c1996ba4a9 perf bpf: Remove pre libbpf 1.0 conditional logic
> 2cce43c63d4d0abc perf build: Remove libbpf pre-1.0 feature tests
> a24ebff6cce14a34 tools build: Pass libbpf feature only if libbpf 1.0+
> 17535a33a9c1e4fb perf lock contention: Fix compiler builtin detection
> ⬢[acme@toolbox perf-tools-next]$
> 
>        make_libbpf_dynamic_O: cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt
> ldd: /tmp/tmp.cO9WpgtAvo/perf: No such file or directory
> cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt
>   BUILD:   Doing 'make -j32' parallel build
>   HOSTCC  /tmp/tmp.cO9WpgtAvo/fixdep.o
>   HOSTLD  /tmp/tmp.cO9WpgtAvo/fixdep-in.o
>   LINK    /tmp/tmp.cO9WpgtAvo/fixdep
> Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
> diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
> Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
> diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
> Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h'
> diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h
> Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h'
> diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h
> Makefile.config:563: *** Error: No libbpf devel library found, please install libbpf-devel.  Stop.
> make[3]: *** [Makefile.perf:236: sub-make] Error 2
> make[2]: *** [Makefile:70: all] Error 2
> make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1
> 
> 
> But:
> 
> ⬢[acme@toolbox perf-tools-next]$ rpm -qa | grep libbpf
> libbpf-0.8.0-2.fc37.x86_64
> libbpf-devel-0.8.0-2.fc37.x86_64
> ⬢[acme@toolbox perf-tools-next]$
> 
> ⬢[acme@toolbox perf-tools-next]$ cat /etc/os-release
> NAME="Fedora Linux"
> VERSION="37 (Container Image)"
> 
> 
> I'll see if this is just a matter of tweaking the error message to
> something like "libbpf-devel not found or older than 1.0.0, please install/update"

Yeah, I'll tweak the warning:

⬢[acme@toolbox perf-tools-next]$ cat /tmp/build/perf-tools-next/feature/test-libbpf.make.output
test-libbpf.c:5:2: error: #error At least libbpf 1.0 is required for Linux tools.
    5 | #error At least libbpf 1.0 is required for Linux tools.
      |  ^~~~~
⬢[acme@toolbox perf-tools-next]$

- Arnaldo

  reply	other threads:[~2023-03-13 21:07 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11  6:57 [PATCH v1 00/13] Perf tool build improvements Ian Rogers
2023-03-11  6:57 ` [PATCH v1 01/13] perf build: Support python/perf.so testing Ian Rogers
2023-03-11  6:57 ` [PATCH v1 02/13] perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL Ian Rogers
2023-03-13 20:19   ` Arnaldo Carvalho de Melo
2023-03-13 20:27     ` Ian Rogers
2023-03-13 20:34       ` Arnaldo Carvalho de Melo
2023-03-13 20:59         ` Arnaldo Carvalho de Melo
2023-03-13 21:05           ` Arnaldo Carvalho de Melo [this message]
2023-03-11  6:57 ` [PATCH v1 03/13] perf build: Remove unused HAVE_GLIBC_SUPPORT Ian Rogers
2023-03-11  6:57 ` [PATCH v1 04/13] perf build: Error if no libelf and NO_LIBELF isn't set Ian Rogers
2023-03-13 19:45   ` Arnaldo Carvalho de Melo
2023-03-13 20:18     ` Ian Rogers
2023-03-11  6:57 ` [PATCH v1 05/13] perf util: Remove weak sched_getcpu Ian Rogers
2023-03-11  6:57 ` [PATCH v1 06/13] perf build: Error if jevents won't work and NO_JEVENTS=1 isn't set Ian Rogers
2023-03-11  6:57 ` [PATCH v1 07/13] perf build: Make binutil libraries opt in Ian Rogers
2023-03-13 19:37   ` Arnaldo Carvalho de Melo
2023-03-11  6:57 ` [PATCH v1 08/13] tools build: Add feature test for abi::__cxa_demangle Ian Rogers
2023-03-11  6:57 ` [PATCH v1 09/13] perf symbol: Add abi::__cxa_demangle C++ demangling support Ian Rogers
2023-03-30 14:08   ` James Clark
2023-03-30 16:50     ` Ian Rogers
2023-03-30 19:03       ` Ian Rogers
2023-03-31  9:27         ` James Clark
2023-03-11  6:57 ` [PATCH v1 10/13] perf build: Switch libpfm4 to opt-out rather than opt-in Ian Rogers
2023-03-11  6:57 ` [PATCH v1 11/13] perf build: If libtraceevent isn't present error the build Ian Rogers
2023-03-11  6:57 ` [PATCH v1 12/13] tools headers: Make the difference output easier to read Ian Rogers
2023-03-13 19:35   ` Arnaldo Carvalho de Melo
2023-03-13 20:14     ` Ian Rogers
2023-03-11  6:57 ` [PATCH v1 13/13] perf build: Remove redundant NO_NEWT build option Ian Rogers
2023-03-14 12:11 ` [PATCH v1 00/13] Perf tool build improvements Arnaldo Carvalho de Melo
2023-03-14 12:12   ` Arnaldo Carvalho de Melo
2023-03-14 12:27     ` Arnaldo Carvalho de Melo
2023-03-14 12:29       ` Arnaldo Carvalho de Melo
2023-03-14 12:21   ` Adrian Hunter
2023-03-14 12:28     ` Arnaldo Carvalho de Melo

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=ZA+QAvj0DIpxTGSS@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andres@anarazel.de \
    --cc=eranian@google.com \
    --cc=gpavithrasha@gmail.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=mliska@suse.cz \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=quentin@isovalent.com \
    --cc=roberto.sassu@huawei.com \
    --cc=trix@redhat.com \
    --cc=yangjihong1@huawei.com \
    --cc=yangtiezhu@loongson.cn \
    /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;
as well as URLs for NNTP newsgroup(s).