Skip to content

Commit 75f3520

Browse files
committed
strings: Rename strings.h to avoid clashing with /usr/include/strings.h
This was detected with: In file included from /home/acme/git/pahole/strings.h:9, from /usr/include/string.h:432, from /home/acme/git/pahole/lib/bpf/src/libbpf_common.h:12, from /home/acme/git/pahole/lib/bpf/src/libbpf.h:20, from /home/acme/git/pahole/lib/bpf/src/ringbuf.c:20: /home/acme/git/pahole/lib/bpf/src/btf.h:33:11: error: expected ‘;’ before ‘void’ 33 | LIBBPF_API void btf__free(struct btf *btf); | ^~~~~ | ; libbpf_common.h has: #include <string.h> #ifndef LIBBPF_API #define LIBBPF_API __attribute__((visibility("default"))) #endif So before defining LIBBPF_API it includes libc's string.h that in turn includes pahole's strings.h and now it includes: #include "lib/bpf/src/btf.h" That will need the LIBBPF_API, b00m. So lets just rename pahole's strings.h to pahole_strings.h to avoid this pitfall. This patch was moved to before this problem takes place so that we keep everything bisectable. Cc: Andrii Nakryiko <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent bba7151 commit 75f3520

File tree

7 files changed

+6
-6
lines changed

7 files changed

+6
-6
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ install(TARGETS codiff ctracer dtagnames pahole pdwtags
149149
install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR})
150150
install(TARGETS dwarves dwarves_emit dwarves_reorganize LIBRARY DESTINATION ${LIB_INSTALL_DIR})
151151
install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
152-
dutil.h gobuffer.h list.h rbtree.h strings.h
152+
dutil.h gobuffer.h list.h rbtree.h pahole_strings.h
153153
btf_encoder.h config.h ctf_encoder.h ctf.h
154154
elfcreator.h elf_symtab.h hash.h libbtf.h libctf.h
155155
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/)

Diff for: MANIFEST

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rbtree.h
4242
scncopy.c
4343
syscse.c
4444
strings.c
45-
strings.h
45+
pahole_strings.h
4646
dutil.c
4747
dutil.h
4848
changes-v1.13

Diff for: dwarf_loader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "list.h"
2424
#include "dwarves.h"
2525
#include "dutil.h"
26-
#include "strings.h"
26+
#include "pahole_strings.h"
2727
#include "hash.h"
2828

2929
struct strings *strings;

Diff for: dwarves.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "list.h"
2828
#include "dwarves.h"
2929
#include "dutil.h"
30-
#include "strings.h"
30+
#include "pahole_strings.h"
3131
#include <obstack.h>
3232

3333
#define obstack_chunk_alloc malloc

Diff for: dwarves.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "dutil.h"
1919
#include "list.h"
2020
#include "rbtree.h"
21-
#include "strings.h"
21+
#include "pahole_strings.h"
2222

2323
struct cu;
2424

Diff for: strings.h renamed to pahole_strings.h

File renamed without changes.

Diff for: strings.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Copyright (C) 2008 Arnaldo Carvalho de Melo <[email protected]>
55
*/
66

7-
#include "strings.h"
7+
#include "pahole_strings.h"
88
#include "gobuffer.h"
99

1010
#include <search.h>

0 commit comments

Comments
 (0)