linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
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 13:27:21 -0700	[thread overview]
Message-ID: <CAP-5=fUG1CbzevoS=+Jj_pBO4umNj6ekaMeEuSHGC4kAZgVJJg@mail.gmail.com> (raw)
In-Reply-To: <ZA+FOpzJswZx8os+@kernel.org>

On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Fri, Mar 10, 2023 at 10:57:42PM -0800, Ian Rogers escreveu:
> > BPF skeleton support is now key to a number of perf features. Rather
> > than making it so that BPF support must be enabled for the build, make
> > this the default and error if the build lacks a clang and libbpf that
> > are sufficient. To avoid the error and build without BPF skeletons the
> > NO_BPF_SKEL=1 flag can be used. Add a build-options flag to 'perf
> > version' to enable detection of the BPF skeleton support and use this
> > in the offcpu shell test.
>
> Checking this:
>
> cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.Rr5xDuXo13 DESTDIR=/tmp/tmp.cYdDvy09eY
>   BUILD:   Doing 'make -j32' parallel build
>   HOSTCC  /tmp/tmp.Rr5xDuXo13/fixdep.o
>   HOSTLD  /tmp/tmp.Rr5xDuXo13/fixdep-in.o
>   LINK    /tmp/tmp.Rr5xDuXo13/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:1130: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
>
>   GEN     /tmp/tmp.Rr5xDuXo13/common-cmds.h
>   CC      /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.o
>   CC      /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.o
>   LINK    /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.so
>   LINK    /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.so
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/exec-cmd.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/help.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/pager.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/parse-options.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/run-command.h
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/exec-cmd.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/help.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/pager.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/parse-options.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/run-command.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/sigchain.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsubcmd/subcmd-config.o
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/
>   INSTALL libsubcmd_headers
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/hashmap.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/relo_core.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_internal.h
>   PERF_VERSION = 6.3.rc1.g0b82b38b7b56
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/bpf_perf.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/core.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/cpumap.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/threadmap.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libsymbol/include/symbol/kallsyms.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/cpu.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evlist.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/debug.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evsel.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/io.h
>   GEN     perf-archive
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/event.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fd/array.h
>   GEN     perf-iostat
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/mmap.h
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/core.o
>   CC      /tmp/tmp.Rr5xDuXo13/libsymbol/kallsyms.o
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/cpu.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/cpumap.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/fs.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/tracing_path.h
>   MKDIR   /tmp/tmp.Rr5xDuXo13/libapi/fd/
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/debug.o
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/str_error_r.o
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/cpumap.o
>   INSTALL libsymbol_headers
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evlist.h
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/threadmap.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evsel.h
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/evsel.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/lib.h
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/evlist.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/mmap.h
>   MKDIR   /tmp/tmp.Rr5xDuXo13/libapi/fs/
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/threadmap.h
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/fd/array.o
>   MKDIR   /tmp/tmp.Rr5xDuXo13/libapi/fs/
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/mmap.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/xyarray.h
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/fs/fs.o
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/zalloc.o
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/xyarray.o
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/fs/cgroup.o
>   CC      /tmp/tmp.Rr5xDuXo13/libperf/lib.o
>   INSTALL libapi_headers
>   CC      /tmp/tmp.Rr5xDuXo13/libapi/fs/tracing_path.o
>   INSTALL libperf_headers
>   GEN     /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/bpf_helper_defs.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/btf.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_common.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_legacy.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helpers.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_tracing.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_endian.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_core_read.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/skel_internal.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_version.h
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/usdt.bpf.h
>   LD      /tmp/tmp.Rr5xDuXo13/libapi/fd/libapi-in.o
>   LD      /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol-in.o
>   AR      /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol.a
>   LD      /tmp/tmp.Rr5xDuXo13/libapi/fs/libapi-in.o
>   INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helper_defs.h
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   INSTALL libbpf_headers
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   LD      /tmp/tmp.Rr5xDuXo13/libapi/libapi-in.o
>   MKDIR   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_probes.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/hashmap.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/nlattr.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_dump.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_errno.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/str_error.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/netlink.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ringbuf.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o
>   LD      /tmp/tmp.Rr5xDuXo13/libperf/libperf-in.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/strset.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/linker.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/gen_loader.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/relo_core.o
>   AR      /tmp/tmp.Rr5xDuXo13/libapi/libapi.a
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/usdt.o
>   AR      /tmp/tmp.Rr5xDuXo13/libperf/libperf.a
>   LD      /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd-in.o
>   AR      /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd.a
>   GEN     /tmp/tmp.Rr5xDuXo13/python/perf.cpython-311-x86_64-linux-gnu.so
>   LD      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf-in.o
>   LINK    /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/libbpf.a
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/main.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/common.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/json_writer.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/gen.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/xlated_dumper.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf_dumper.o
>   CC      /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/disasm.o
>   LINK    /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/bpftool
>   GEN     /tmp/tmp.Rr5xDuXo13/util/bpf_skel/vmlinux.h
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o
>   CLANG   /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o
> util/bpf_skel/lock_contention.bpf.c:192:7: error: call to undeclared function 'bpf_core_type_matches'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
>                 if (bpf_core_type_matches(struct rw_semaphore___old)) {
>                     ^
> util/bpf_skel/lock_contention.bpf.c:192:29: error: expected expression
>                 if (bpf_core_type_matches(struct rw_semaphore___old)) {
>                                           ^
> util/bpf_skel/lock_contention.bpf.c:195:36: error: expected expression
>                 } else if (bpf_core_type_matches(struct rw_semaphore___new)) {
>                                                  ^
> 3 errors generated.
> /usr/bin/ld: bpf architecture of input file `/tmp/bperf_follower-74fba5.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: bpf architecture of input file `/tmp/bperf_leader-b2ec61.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.text+0x1b): undefined reference to `main'
> /usr/bin/ld: final link failed: file in wrong format
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.text+0x1b): undefined reference to `main'
> /usr/bin/ld: final link failed: file in wrong format
> collect2: error: ld returned 1 exit status
> collect2: error: ld returned 1 exit status
> clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
> clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
> /usr/bin/ld: bpf architecture of input file `/tmp/func_latency-70b7d4.o' is incompatible with i386:x86-64 output
> make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o] Error 1
> make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o] Error 1
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.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/func_latency.bpf.o] Error 1
> /usr/bin/ld: bpf architecture of input file `/tmp/bpf_prog_profiler-6e9720.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.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/bpf_prog_profiler.bpf.o] Error 1
> /usr/bin/ld: bpf architecture of input file `/tmp/kwork_trace-8d5b4e.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.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/kwork_trace.bpf.o] Error 1
> /usr/bin/ld: bpf architecture of input file `/tmp/off_cpu-1cb75d.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.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/off_cpu.bpf.o] Error 1
> /usr/bin/ld: bpf architecture of input file `/tmp/bperf_cgroup-45eb44.o' is incompatible with i386:x86-64 output
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start':
> (.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).

Thanks,
Ian

>

  reply	other threads:[~2023-03-13 20:28 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 [this message]
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
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='CAP-5=fUG1CbzevoS=+Jj_pBO4umNj6ekaMeEuSHGC4kAZgVJJg@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=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=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).