perf symbol: Include elf.h header regardless LIBELF_SUPPORT
Namhyung Kim
maintainerPATCH 1/1 perf symbol: Include elf.h header regardless LIBELF_SUPPORT
From: Namhyung Kim <[email protected]>
The elf.h header file is used for NO_LIBELF build too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error on NO_LIBELF build:
CC tests/hists_link.otests/hists_link.c: In function ‘setup_fake_machine’:tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function) tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in
--- tools/perf/util/symbol-elf.c | 3 --- tools/perf/util/symbol-minimal.c | 1 - tools/perf/util/symbol.h | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-)
tools/perf/util/symbol-elf.c +0 -3
@@ -1,6 +1,3 @@ -#include <libelf.h> -#include <gelf.h> -#include <elf.h> #include <fcntl.h> #include <stdio.h> #include <errno.h>
tools/perf/util/symbol-minimal.c +0 -1
@@ -1,6 +1,5 @@#include "symbol.h" -#include <elf.h> #include <stdio.h> #include <fcntl.h> #include <string.h>
tools/perf/util/symbol.h +1 -1
@@ -16,8 +16,8 @@#ifdef LIBELF_SUPPORT #include <libelf.h> #include <gelf.h> -#include <elf.h> #endif +#include <elf.h> #include "dso.h"
Signature · 1 line
1.7.11.7
Quoted 6 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
The
elf.hheader file is used forNO_LIBELFbuild too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error onNO_LIBELFbuild:
Quoted 8 lines
CC
tests/hists_link.otests/hists_link.c: In function ‘setup_fake_machine’:tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function)tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears inCc Jiri Olsa <[email protected]>Cc David Ahern <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
[tip:perf/core] perf symbols: Include elf.h header regardless LIBELF_SUPPORT
In reply to Namhyung KimCommit-ID: eec185ab603fab3b7b5021e840cf4b282c4c7e6b Gitweb: http://git.kernel.org/tip/eec185ab603fab3b7b5021e840cf4b282c4c7e6b Author: Namhyung Kim <[email protected]> AuthorDate: Fri, 28 Dec 2012 16:16:49 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 24 Jan 2013 16:40:18 -0300
perf symbols: Include elf.h header regardless LIBELF_SUPPORT
The elf.h header file is used for NO_LIBELF build too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error on NO_LIBELF build:
CC tests/hists_link.otests/hists_link.c: In function ‘setup_fake_machine’:tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function) tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in
--- tools/perf/util/symbol-elf.c | 3 --- tools/perf/util/symbol-minimal.c | 1 - tools/perf/util/symbol.h | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-)
tools/perf/util/symbol-elf.c +0 -3
@@ -1,6 +1,3 @@ -#include <libelf.h> -#include <gelf.h> -#include <elf.h> #include <fcntl.h> #include <stdio.h> #include <errno.h>
tools/perf/util/symbol-minimal.c +0 -1
@@ -1,6 +1,5 @@#include "symbol.h" -#include <elf.h> #include <stdio.h> #include <fcntl.h> #include <string.h>
tools/perf/util/symbol.h +1 -1
@@ -16,8 +16,8 @@#ifdef LIBELF_SUPPORT #include <libelf.h> #include <gelf.h> -#include <elf.h> #endif +#include <elf.h> #include "dso.h"