perf build error with gcc 10 on arm and aarch64

From: Thomas Backlund
Date: Mon May 04 2020 - 15:22:32 EST


This is building perf from kernel-5.6.10 on armv7hl and aarch64:

Compiler is gcc 10.1.0-RC


LD perf-in.o
ld: arch/perf-in.o: in function `.LANCHOR0':
/home/iurt/rpmbuild/BUILD/kernel-arm/linux-5.6/tools/perf/util/include/../../util/cs-etm.h:118: multiple definition of `traceid_list'; util/perf-in.o:/home/iurt/rpmbuild/BUILD/kernel-arm/linux-5.6/tools/perf/util/cs-etm.h:118: first defined here
make[3]: *** [/home/iurt/rpmbuild/BUILD/kernel-arm/linux-5.6/tools/build/Makefile.build:145: perf-in.o] Error 1

LD perf-in.o
ld: arch/perf-in.o:/home/iurt/rpmbuild/BUILD/kernel-aarch64/linux-5.6/tools/perf/util/include/../../util/cs-etm.h:118: multiple definition of `traceid_list'; util/perf-in.o:/home/iurt/rpmbuild/BUILD/kernel-aarch64/linux-5.6/tools/perf/util/cs-etm.h:118: first defined here
make[3]: *** [/home/iurt/rpmbuild/BUILD/kernel-aarch64/linux-5.6/tools/build/Makefile.build:145: perf-in.o] Error 1
make[2]: *** [Makefile.perf:616: perf-in.o] Error 2
make[1]: *** [Makefile.perf:225: sub-make] Error 2
make: *** [Makefile:70: all] Error 2


The same build succeeds with gcc 9.3.0

--


Thomas