Skip to content

Commit

Permalink
perf symbols: Include elf.h header regardless LIBELF_SUPPORT
Browse files Browse the repository at this point in the history
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.o
tests/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

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1356679009-32122-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Jan 24, 2013
1 parent a65c234 commit eec185a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions tools/perf/util/symbol-elf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#include <libelf.h>
#include <gelf.h>
#include <elf.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
Expand Down
1 change: 0 additions & 1 deletion tools/perf/util/symbol-minimal.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "symbol.h"

#include <elf.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#ifdef LIBELF_SUPPORT
#include <libelf.h>
#include <gelf.h>
#include <elf.h>
#endif
#include <elf.h>

#include "dso.h"

Expand Down

0 comments on commit eec185a

Please sign in to comment.