Skip to content

Commit 5a25a08

Browse files
acmelgregkh
authored andcommitted
perf dwarf: Guard !x86_64 definitions under #ifdef else clause
commit 62aa0e177d278462145a29c30d3c8501ae57e200 upstream. To fix the build on Fedora Rawhide (gcc 6.0.0 20160311 (Red Hat 6.0.0-0.17): CC /tmp/build/perf/arch/x86/util/dwarf-regs.o arch/x86/util/dwarf-regs.c:66:36: error: 'x86_32_regoffset_table' defined but not used [-Werror=unused-const-variable=] static const struct pt_regs_offset x86_32_regoffset_table[] = { ^~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-fghuksc1u8ln82bof4lwcj0o@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 300d4fe commit 5a25a08

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/perf/arch/x86/util/dwarf-regs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ struct pt_regs_offset {
6363
# define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)}
6464
#endif
6565

66+
/* TODO: switching by dwarf address size */
67+
#ifndef __x86_64__
6668
static const struct pt_regs_offset x86_32_regoffset_table[] = {
6769
REG_OFFSET_NAME_32("%ax", eax),
6870
REG_OFFSET_NAME_32("%cx", ecx),
@@ -75,6 +77,8 @@ static const struct pt_regs_offset x86_32_regoffset_table[] = {
7577
REG_OFFSET_END,
7678
};
7779

80+
#define regoffset_table x86_32_regoffset_table
81+
#else
7882
static const struct pt_regs_offset x86_64_regoffset_table[] = {
7983
REG_OFFSET_NAME_64("%ax", rax),
8084
REG_OFFSET_NAME_64("%dx", rdx),
@@ -95,11 +99,7 @@ static const struct pt_regs_offset x86_64_regoffset_table[] = {
9599
REG_OFFSET_END,
96100
};
97101

98-
/* TODO: switching by dwarf address size */
99-
#ifdef __x86_64__
100102
#define regoffset_table x86_64_regoffset_table
101-
#else
102-
#define regoffset_table x86_32_regoffset_table
103103
#endif
104104

105105
/* Minus 1 for the ending REG_OFFSET_END */

0 commit comments

Comments
 (0)