Adding the specific command that is reporting error:
gcc -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -Iarch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf/lib/include -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf/util/include -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf/arch/x86/include -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/include/ -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/arch/x86/include/uapi -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/include/uapi -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/arch/x86/include/ -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/arch/x86/ -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf/util -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf -I/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_GETTID -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DNO_LIBPERL -DHAVE_TIMERFD_SUPPORT -DNO_LIBPYTHON -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_LIBCAP_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -Wl,-z,noexecstack -lunwind-x86_64 -lunwind -llzma -Xlinker --dynamic-list=/home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/traceevent/plugins/libtraceevent-dynamic-list \ perf-in.o pmu-events/pmu-events-in.o -Wl,--whole-archive /home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/api/libapi.a /home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/traceevent/libtraceevent.a /home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/subcmd/libsubcmd.a /home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/perf/lib/libperf.a /home/arighi/canonical/kernel/ubuntu/unstable/linux/tools/lib/bpf/libbpf.a -Wl,--no-whole-archive -Wl,--start-group -lpthread -lrt -lm -ldl -lelf -ldw -lunwind-x86_64 -lunwind -llzma -lcrypto -lslang -liberty -lz -llzma -lcap -lnuma -Wl,--end-group -o perf
Adding the specific command that is reporting error:
gcc -Wbad-function-cast -Wdeclaration- after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing- declarations -Wmissing- prototypes -Wnested-externs -Wno-system-headers -Wold-style- definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ ARCH_X86_ 64_SUPPORT -Iarch/ x86/include/ generated -DHAVE_ SYSCALL_ TABLE_SUPPORT -DHAVE_ PERF_REGS_ SUPPORT -DHAVE_ ARCH_REGS_ QUERY_REGISTER_ OFFSET -Werror -O6 -fno-omit- frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack- protector- all -D_FORTIFY_SOURCE=2 -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf/lib/ include -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf/util/ include -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf/arch/ x86/include -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ include/ -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ arch/x86/ include/ uapi -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ include/ uapi -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ arch/x86/ include/ -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ arch/x86/ -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf/util -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf -I/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/ -D_LARGEFILE64_ SOURCE -D_FILE_ OFFSET_ BITS=64 -D_GNU_SOURCE -DHAVE_ SYNC_COMPARE_ AND_SWAP_ SUPPORT -DHAVE_ PTHREAD_ ATTR_SETAFFINIT Y_NP -DHAVE_ PTHREAD_ BARRIER -DHAVE_EVENTFD -DHAVE_ GET_CURRENT_ DIR_NAME -DHAVE_GETTID -DHAVE_ DWARF_GETLOCATI ONS_SUPPORT -DHAVE_ GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_ SCHED_GETCPU_ SUPPORT -DHAVE_ SETNS_SUPPORT -DHAVE_ LIBELF_ SUPPORT -DHAVE_ LIBELF_ MMAP_SUPPORT -DHAVE_ ELF_GETPHDRNUM_ SUPPORT -DHAVE_ GELF_GETNOTE_ SUPPORT -DHAVE_ ELF_GETSHDRSTRN DX_SUPPORT -DHAVE_ DWARF_SUPPORT -DHAVE_ LIBBPF_ SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_JITDUMP -DHAVE_ DWARF_UNWIND_ SUPPORT -DNO_LIBUNWIND_ DEBUG_FRAME -DHAVE_ LIBUNWIND_ SUPPORT -DHAVE_ LIBCRYPTO_ SUPPORT -DHAVE_ SLANG_SUPPORT -DNO_LIBPERL -DHAVE_ TIMERFD_ SUPPORT -DNO_LIBPYTHON -DHAVE_ CPLUS_DEMANGLE_ SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_ LIBCAP_ SUPPORT -DHAVE_ BACKTRACE_ SUPPORT -DHAVE_ LIBNUMA_ SUPPORT -DHAVE_ KVM_STAT_ SUPPORT -DHAVE_ AUXTRACE_ SUPPORT -DHAVE_JVMTI_CMLR -Wl,-z,noexecstack -lunwind-x86_64 -lunwind -llzma -Xlinker --dynamic- list=/home/ arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/traceevent/ plugins/ libtraceevent- dynamic- list \ pmu-events- in.o -Wl,--whole-archive /home/arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/api/ libapi. a /home/arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/traceevent/ libtraceevent. a /home/arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/subcmd/ libsubcmd. a /home/arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ perf/lib/ libperf. a /home/arighi/ canonical/ kernel/ ubuntu/ unstable/ linux/tools/ lib/bpf/ libbpf. a -Wl,--no- whole-archive -Wl,--start-group -lpthread -lrt -lm -ldl -lelf -ldw -lunwind-x86_64 -lunwind -llzma -lcrypto -lslang -liberty -lz -llzma -lcap -lnuma -Wl,--end-group -o perf
perf-in.o pmu-events/