[Nexus 4 Q&A, Help & Troubleshooting] dshoe:
I am attempting to compile the cm-11.0 kernel from https://github.com/CyanogenMod/android_kernel_google_msm with the AOSP 4.6 and 4.7 toolchains, but I keep getting this same build error.

CLEAN .
CLEAN arch/arm/kernel
CLEAN kernel
CLEAN usr
CLEAN .tmp_versions
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/linux/version.h
HOSTCC scripts/kallsyms
CC scripts/mod/empty.o
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/mod/mk_elfconfig
HOSTCC scripts/selinux/mdp/mdp
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/conmakehash
HOSTCC scripts/bin2c
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC init/main.o
CC init/do_mounts.o
HOSTCC usr/gen_init_cpio
UPD include/generated/compile.h
CC init/do_mounts_rd.o
GEN usr/initramfs_data.cpio
AS usr/initramfs_data.o
LD usr/built-in.o
CC arch/arm/vfp/vfpmodule.o
CC init/do_mounts_initrd.o
CC init/initramfs.o
AS arch/arm/vfp/entry.o
CC init/calibrate.o
AS arch/arm/vfp/vfphw.o
CC arch/arm/vfp/vfpsingle.o
CC init/version.o
LD init/mounts.o
CC arch/arm/kernel/elf.o
AS arch/arm/kernel/entry-armv.o
AS arch/arm/kernel/entry-common.o
CC arch/arm/kernel/irq.o
CC arch/arm/kernel/opcodes.o
LD init/built-in.o
CC arch/arm/mm/dma-mapping.o
CC arch/arm/kernel/process.o
CC arch/arm/vfp/vfpdouble.o
CC arch/arm/kernel/ptrace.o
CC arch/arm/kernel/return_address.o
CC arch/arm/mm/extable.o
arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp]
CC arch/arm/kernel/sched_clock.o
CC arch/arm/kernel/setup.o
CC arch/arm/mm/fault.o
CC arch/arm/kernel/signal.o
LD arch/arm/vfp/vfp.o
LD arch/arm/vfp/built-in.o
CC arch/arm/common/gic.o
CC arch/arm/kernel/stacktrace.o
CC arch/arm/mm/init.o
CC arch/arm/kernel/sys_arm.o
CC arch/arm/kernel/time.o
CC arch/arm/common/cpaccess.o
CC arch/arm/kernel/traps.o
CC arch/arm/kernel/cpuidle.o
AS arch/arm/kernel/sleep.o
CC arch/arm/kernel/suspend.o
LD arch/arm/common/built-in.o
CC arch/arm/mm/iomap.o
LD arch/arm/net/built-in.o
CC arch/arm/kernel/smp.o
CC arch/arm/kernel/smp_tlb.o
CC arch/arm/kernel/smp_scu.o
CC arch/arm/mm/fault-armv.o
CC arch/arm/kernel/sys_oabi-compat.o
CC arch/arm/kernel/unwind.o
CC arch/arm/mm/flush.o
CC arch/arm/mm/idmap.o
CC arch/arm/kernel/swp_emulate.o
CC arch/arm/mm/ioremap.o
CC arch/arm/kernel/hw_breakpoint.o
CC arch/arm/mm/mmap.o
CC arch/arm/kernel/update_vsyscall_arm.o
CC arch/arm/mm/pgd.o
CC arch/arm/kernel/pmu.o
CC arch/arm/mm/mmu.o
CC arch/arm/mm/vmregion.o
CC arch/arm/kernel/perf_event.o
CC arch/arm/kernel/topology.o
CC arch/arm/mm/alignment.o
CC arch/arm/kernel/user_accessible_timer.o
CC arch/arm/kernel/io.o
CC arch/arm/mm/highmem.o
AS arch/arm/kernel/head.o
AS arch/arm/mm/abort-ev7.o
AS arch/arm/mm/pabort-v7.o
AS arch/arm/mm/cache-v7.o
CC arch/arm/mm/copypage-v6.o
CC arch/arm/mach-msm/io.o
CC arch/arm/mm/context.o
AS arch/arm/mm/tlb-v7.o
CC arch/arm/mach-msm/dma.o
CC arch/arm/mach-msm/memory.o
AS arch/arm/mm/proc-v7.o
LD arch/arm/mm/built-in.o
CC arch/arm/perfmon/perf-function-hooks.o
CC arch/arm/kernel/init_task.o
CC arch/arm/mach-msm/timer.o
LD arch/arm/perfmon/built-in.o
CC kernel/fork.o
LDS arch/arm/kernel/vmlinux.lds
LD arch/arm/kernel/built-in.o
CC arch/arm/mach-msm/clock.o
CC mm/filemap.o
CC arch/arm/mach-msm/clock-voter.o
CC arch/arm/mach-msm/clock-dummy.o
CC arch/arm/mach-msm/modem_notifier.o
CC arch/arm/mach-msm/subsystem_map.o
CC arch/arm/mach-msm/nohlt.o
CC arch/arm/mach-msm/clock-debug.o
CC arch/arm/mach-msm/acpuclock.o
CC kernel/exec_domain.o
CC arch/arm/mach-msm/perf_trace_counters.o
CC arch/arm/mach-msm/acpuclock-krait.o
In file included from arch/arm/mach-msm/perf_trace_counters.h:126:0,
from arch/arm/mach-msm/perf_trace_counters.c:16:
include/trace/define_trace.h:79:43: fatal error: ./perf_trace_counters.h: No such file or directory
compilation terminated.
scripts/Makefile.build:307: recipe for target 'arch/arm/mach-msm/perf_trace_counters.o' failed
make[1]: *** [arch/arm/mach-msm/perf_trace_counters.o] Error 1
make[1]: *** Waiting for unfinished jobs....
CC kernel/panic.o
CC mm/mempool.o
CC kernel/printk.o
CC kernel/cpu.o
CC mm/oom_kill.o
Makefile:949: recipe for target 'arch/arm/mach-msm' failed
make: *** [arch/arm/mach-msm] Error 2
make: *** Waiting for unfinished jobs....
CC mm/fadvise.o
CC kernel/exit.o
CC mm/maccess.o
CC mm/page_alloc.o
CC kernel/itimer.o
CC mm/page-writeback.o
TIMEC kernel/timeconst.h
defined(@array) is deprecated at kernel/timeconst.pl line 373.
(Maybe you should just omit the defined()?)
CC kernel/softirq.o
CC kernel/resource.o
CC kernel/sysctl.o
CC mm/readahead.o
CC kernel/sysctl_binary.o
CC mm/swap.o
CC kernel/capability.o
CC kernel/ptrace.o
CC mm/truncate.o
CC kernel/timer.o
CC mm/vmscan.o
CC mm/shmem.o
CC kernel/user.o
CC kernel/signal.o
CC kernel/sys.o
CC mm/prio_tree.o
CC mm/util.o
CC mm/mmzone.o
CC mm/vmstat.o
CC kernel/kmod.o
CC kernel/workqueue.o
CC mm/backing-dev.o
CC kernel/pid.o
CC mm/page_isolation.o
CC mm/mm_init.o
CC mm/mmu_context.o
CC mm/percpu.o
CC kernel/rcupdate.o
CC mm/compaction.o
CC kernel/extable.o
CC kernel/params.o
CC mm/fremap.o
CC kernel/posix-timers.o
CC kernel/kthread.o
CC mm/highmem.o
CC mm/madvise.o
CC kernel/wait.o
CC mm/memory.o
CC kernel/kfifo.o
CC mm/mincore.o
CC kernel/sys_ni.o
CC kernel/posix-cpu-timers.o
CC mm/mlock.o
CC kernel/mutex.o
CC kernel/hrtimer.o
CC mm/mmap.o
CC kernel/rwsem.o
CC kernel/nsproxy.o
CC kernel/srcu.o
CC mm/mprotect.o
CC kernel/semaphore.o
CC kernel/notifier.o
CC mm/mremap.o
CC kernel/ksysfs.o
CC kernel/cred.o
CC mm/msync.o
CC kernel/async.o
CC mm/rmap.o
CC mm/vmalloc.o
CC kernel/range.o
CC kernel/groups.o
CC kernel/smpboot.o
CC kernel/events/core.o
CC kernel/irq/irqdesc.o
CC mm/pagewalk.o
CC kernel/irq/handle.o
CC mm/pgtable-generic.o
CC kernel/irq/manage.o
CC mm/process_vm_access.o
CC mm/init-mm.o
CC mm/bootmem.o
CC mm/memblock.o
CC kernel/irq/spurious.o
CC mm/bounce.o
CC kernel/irq/resend.o
CC kernel/irq/chip.o
CC mm/dmapool.o
CC mm/slub.o
CC mm/migrate.o
CC kernel/irq/dummychip.o
CC kernel/irq/devres.o
CC kernel/irq/autoprobe.o
CC kernel/irq/irqdomain.o
CC kernel/events/ring_buffer.o
CC mm/cleancache.o
CC kernel/irq/proc.o
CC kernel/events/callchain.o
CC kernel/events/hw_breakpoint.o
CC kernel/irq/pm.o
CC kernel/power/qos.o
LD kernel/irq/built-in.o
CC kernel/sched/core.o
LD kernel/events/built-in.o
CC kernel/time/timekeeping.o
CC kernel/power/main.o
CC kernel/power/console.o
CC kernel/time/ntp.o
CC kernel/power/process.o
LD mm/built-in.o
CC kernel/time/clocksource.o
CC kernel/time/jiffies.o
CC kernel/power/suspend.o
CC kernel/time/timer_list.o
CC kernel/time/timecompare.o
CC kernel/power/wakelock.o
CC kernel/time/timeconv.o
CC kernel/time/posix-clock.o
CC kernel/time/clockevents.o
CC kernel/power/userwakelock.o
CC kernel/time/tick-common.o
CC kernel/time/tick-broadcast.o
CC kernel/time/tick-oneshot.o
CC kernel/power/earlysuspend.o
CC kernel/time/tick-sched.o
CC kernel/time/timer_stats.o
CC kernel/power/fbearlysuspend.o
CC kernel/trace/trace_clock.o
CC kernel/power/poweroff.o
LD kernel/time/built-in.o
CC kernel/freezer.o
LD kernel/power/built-in.o
CC kernel/profile.o
CC kernel/trace/ring_buffer.o
CC kernel/stacktrace.o
CC kernel/futex.o
CC kernel/rtmutex.o
CC kernel/sched/clock.o
CC kernel/smp.o
CC kernel/sched/idle_task.o
CC kernel/sched/fair.o
CC kernel/spinlock.o
CC kernel/trace/trace.o
CC kernel/uid16.o
CC kernel/kallsyms.o
CC kernel/cgroup.o
CC kernel/cgroup_freezer.o
GZIP kernel/config_data.gz
CC kernel/res_counter.o
CC kernel/stop_machine.o
CC kernel/sched/rt.o
CC kernel/audit.o
CC kernel/trace/trace_output.o
CC kernel/sched/stop_task.o
CC kernel/auditfilter.o
CC kernel/sched/sched_avg.o
CC kernel/auditsc.o
CC kernel/sched/cpupri.o
CC kernel/trace/trace_stat.o
LD kernel/sched/built-in.o
CC kernel/audit_watch.o
CC kernel/trace/trace_printk.o
CC kernel/audit_tree.o
CC kernel/rcutree.o
CC kernel/trace/trace_sched_switch.o
CC kernel/trace/trace_nop.o
CC kernel/utsname_sysctl.o
CC kernel/trace/blktrace.o
CC kernel/delayacct.o
CC kernel/trace/trace_events.o
CC kernel/trace/trace_export.o
CC kernel/taskstats.o
CC kernel/tsacct.o
CC kernel/trace/trace_event_perf.o
CC kernel/tracepoint.o
CC kernel/trace/trace_events_filter.o
CC kernel/elfcore.o
CC kernel/trace/power-traces.o
CC kernel/irq_work.o
CC kernel/cpu_pm.o
CC kernel/time.o
CHK kernel/config_data.h
UPD kernel/config_data.h
CC kernel/configs.o
CC kernel/trace/rpm-traces.o
LD kernel/trace/built-in.o
LD kernel/built-in.o

I can't find a perf_trace_counters.h file in my source at all, and the line of code where this is referenced actually uses a pointer so I'm having trouble debugging this.