• Jerome Marchand's avatar
    libbpf-tools: Allow to use different cflags for bpf targets · c353d172
    Jerome Marchand 创作于
    commit 531b698c ("libbpf-tools: Enable compilation warnings for
    BPF programs") applies CFLAGS to all targets. However, some of the c
    flags typically used by distribution are not available to the bpf
    target. Add a new BPFCFLAGS macro to take care of that.
    
    Fixes the following compilation error on fedora:
    
      BPF      bashreadline.bpf.o
    clang-13: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
    clang-13: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Wunused-command-line-argument]
    clang-13: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1' [-Wunused-command-line-argument]
    clang-13: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]
    error: option 'cf-protection=return' cannot be specified on this target
    error: option 'cf-protection=branch' cannot be specified on this target
    2 errors generated.
    c353d172