Re: [PATCH] perf record: fix link time error with sample_reg_masks on non x86

From: Adrian Hunter
Date: Wed Sep 02 2015 - 05:49:41 EST


On 01/09/15 12:30, Stephane Eranian wrote:
> This patch makes perf compile on non x86 platforms by defining
> a weak symbol for sample_reg_masks[] in util/perf_regs.c.
>
> The patch also moves the REG() and REG_END() macros into the
> util/per_regs.h header file. The macros are renamed to
> SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
>
> Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx>

Doesn't seem to work on powerpc, presumably because util/perf_regs.c is not built?

$ make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc -C tools/perf >/dev/null
config/Makefile:245: No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev
config/Makefile:329: Disabling post unwind, no support found.
config/Makefile:370: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
config/Makefile:385: slang not found, disables TUI support. Please install slang-devel or libslang-dev
config/Makefile:399: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev
config/Makefile:427: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
config/Makefile:470: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev
config/Makefile:560: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev
config/Makefile:573: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
PERF_VERSION = 4.2.g02f9f7
libperf.a(libperf-in.o): In function `parse_regs':
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks'
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
collect2: error: ld returned 1 exit status
make[1]: *** [perf] Error 1
make: *** [all] Error 2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/