Skip to contentSkip to conversation

perf: Link error on non x86 with sample_reg_masks

PATCH Dominik Dingel 1 participant 1 message Sep 30, 2015 perf events

lore
Share & tools
lore
#0 lore raw

Greetings,

With 4.3-rc3 during the build of perf (on s390) I get following error:

libperf.a(libperf-in.o): In function `parse_regs':
/home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:28: undefined reference to sample_reg_masks' /home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:45: undefined reference to sample_reg_masks' /home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
collect2: error: ld returned 1 exit status
Makefile.perf:306: recipe for target 'perf' failed
make[1]: *** [perf] Error 1
Makefile:68: recipe for target 'all' failed
make: *** [all] Error 2

By doing the same thing, as:

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026

Author: Stephane Eranian <[email protected]>
Date:   Tue Sep 1 11:30:14 2015 +0200

perf tools: Fix link time error with sample_reg_masks on non x86

does:

tools/perf/util/parse-regs-options.c +4 -0
@@ -4,6 +4,10 @@
 #include "util/parse-options.h"
 #include "util/parse-regs-options.h"
 
+const struct sample_reg __weak sample_reg_masks[] = {
+       SMPL_REG_END
+};
+
 

I was able to fix the problem, but is it the right thing to do?

Thanks,
Dominik