All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org
Subject: libbpf: Build failures due to access to out of tools/ headers
Date: Thu, 21 Mar 2024 16:03:30 -0300	[thread overview]
Message-ID: <ZfyEgoG3JFiOs2Fs@x1> (raw)

Andrii,

	I think that after this patch:

commit 9eea8fafe33eb70868f6ace2fc1e17c4ff5539c3
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Thu Jan 25 12:55:05 2024 -0800

    libbpf: fix __arg_ctx type enforcement for perf_event programs
    
    Adjust PERF_EVENT type enforcement around __arg_ctx to match exactly
    what kernel is doing.
    
    Fixes: 76ec90a996e3 ("libbpf: warn on unexpected __arg_ctx type when rewriting BTF")
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/r/20240125205510.3642094-3-andrii@kernel.org
    Signed-off-by: Alexei Starovoitov <ast@kernel.org


I'm seeing:

  19     5.42 debian:experimental-x-arm64   : FAIL gcc version 13.2.0 (Debian 13.2.0-12) 
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:2:10: fatal error: ../../arch/arm64/include/uapi/asm/bpf_perf_event.h: No such file or directory
        2 | #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
      LD      /tmp/build/perf/libperf/libperf-in.o
      LD      /tmp/build/perf/libapi/libapi-in.o
      AR      /tmp/build/perf/libperf/libperf.a
      AR      /tmp/build/perf/libapi/libapi.a
    In file included from /git/perf-6.8.0/tools/include/uapi/linux/bpf_perf_event.h:11,
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:2:10: fatal error: ../../arch/arm64/include/uapi/asm/bpf_perf_event.h: No such file or directory
        2 | #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[4]: *** [/git/perf-6.8.0/tools/build/Makefile.build:105: /tmp/build/perf/libbpf/staticobjs/libbpf.o] Error 1
    make[4]: *** Waiting for unfinished jobs....
      LD      /tmp/build/perf/libsubcmd/libsubcmd-in.o
      AR      /tmp/build/perf/libsubcmd/libsubcmd.a
    make[3]: *** [Makefile:157: /tmp/build/perf/libbpf/staticobjs/libbpf-in.o] Error 2

  44     4.47 ubuntu:18.04-x-riscv64        : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:8:10: fatal error: ../../arch/riscv/include/uapi/asm/bpf_perf_event.h: No such file or directory
     #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
      LD      /tmp/build/perf/libapi/libapi-in.o
      AR      /tmp/build/perf/libapi/libapi.a
      LD      /tmp/build/perf/libperf/libperf-in.o
      AR      /tmp/build/perf/libperf/libperf.a
    In file included from /git/perf-6.8.0/tools/include/uapi/linux/bpf_perf_event.h:11:0,
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:8:10: fatal error: ../../arch/riscv/include/uapi/asm/bpf_perf_event.h: No such file or directory
     #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    /git/perf-6.8.0/tools/build/Makefile.build:105: recipe for target '/tmp/build/perf/libbpf/staticobjs/libbpf.o' failed
    make[4]: *** [/tmp/build/perf/libbpf/staticobjs/libbpf.o] Error 1
    make[4]: *** Waiting for unfinished jobs....
      LD      /tmp/build/perf/libsubcmd/libsubcmd-in.o
      AR      /tmp/build/perf/libsubcmd/libsubcmd.a
  45     4.79 ubuntu:18.04-x-s390           : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:6:10: fatal error: ../../arch/s390/include/uapi/asm/bpf_perf_event.h: No such file or directory
     #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
      LD      /tmp/build/perf/libapi/libapi-in.o
      LD      /tmp/build/perf/libperf/libperf-in.o
      AR      /tmp/build/perf/libperf/libperf.a
      AR      /tmp/build/perf/libapi/libapi.a
    In file included from /git/perf-6.8.0/tools/include/uapi/linux/bpf_perf_event.h:11:0,
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:6:10: fatal error: ../../arch/s390/include/uapi/asm/bpf_perf_event.h: No such file or directory
     #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    /git/perf-6.8.0/tools/build/Makefile.build:105: recipe for target '/tmp/build/perf/libbpf/staticobjs/libbpf.o' failed
    make[4]: *** [/tmp/build/perf/libbpf/staticobjs/libbpf.o] Error 1
    make[4]: *** Waiting for unfinished jobs....
      LD      /tmp/build/perf/libsubcmd/libsubcmd-in.o
      AR      /tmp/build/perf/libsubcmd/libsubcmd.a


  51     4.78 ubuntu:22.04-x-riscv64        : FAIL gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:8:10: fatal error: ../../arch/riscv/include/uapi/asm/bpf_perf_event.h: No such file or directory
        8 | #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
      CC      /tmp/build/perf/libbpf/staticobjs/usdt.o
      CC      /tmp/build/perf/libbpf/staticobjs/zip.o
      CC      /tmp/build/perf/libbpf/staticobjs/elf.o
      CC      /tmp/build/perf/libbpf/staticobjs/features.o
    In file included from /git/perf-6.8.0/tools/include/uapi/linux/bpf_perf_event.h:11,
                     from libbpf.c:37:
    /git/perf-6.8.0/tools/include/uapi/asm/bpf_perf_event.h:8:10: fatal error: ../../arch/riscv/include/uapi/asm/bpf_perf_event.h: No such file or directory
        8 | #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[4]: *** [/git/perf-6.8.0/tools/build/Makefile.build:105: /tmp/build/perf/libbpf/staticobjs/libbpf.o] Error 1
    make[4]: *** Waiting for unfinished jobs....
      LD      /tmp/build/perf/libsubcmd/libsubcmd-in.o
      AR      /tmp/build/perf/libsubcmd/libsubcmd.a
    make[3]: *** [Makefile:157: /tmp/build/perf/libbpf/staticobjs/libbpf-in.o] Error 2


When building out of the kernel sources tree, i.e. when build perf from
a tarball, which seems to indicate that tools/lib/bpf/libbpf.c is
accessing out of tools/ files from the kernel.

- Arnaldo

             reply	other threads:[~2024-03-21 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 19:03 Arnaldo Carvalho de Melo [this message]
2024-03-21 20:28 ` libbpf: Build failures due to access to out of tools/ headers Andrii Nakryiko

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=ZfyEgoG3JFiOs2Fs@x1 \
    --to=acme@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@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 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.