Skip to contentSkip to conversation

libbpf: Fix libbpf_common.h when installing libbpf through 'make install'

PATCH Applied Toke Høiland-Jørgensen 3 participants 3 messages Dec 17, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: Fix libbpf_common.h when installing libbpf through 'make install'

This fixes two issues with the newly introduced libbpf_common.h file:

- The header failed to include <string.h> for the definition of memset()
- The new file was not included in the install_headers rule in the Makefile

Both of these issues cause breakage when installing libbpf with 'make install' and trying to use it in applications.

Fixes 544402d4b493 ("libbpf: Extract common user-facing helpers")
---
 tools/lib/bpf/Makefile        | 1 +
 tools/lib/bpf/libbpf_common.h | 2 ++
 2 files changed, 3 insertions(+)
tools/lib/bpf/Makefile +1 -0
index a3718cb275f2..d4790121adf4 100644
@@ -251,6 +251,7 @@ install_headers: bpf_helper_defs.h
 		$(call do_install,libbpf.h,$(prefix)/include/bpf,644); \
 		$(call do_install,btf.h,$(prefix)/include/bpf,644); \
 		$(call do_install,libbpf_util.h,$(prefix)/include/bpf,644); \
+		$(call do_install,libbpf_common.h,$(prefix)/include/bpf,644); \
 		$(call do_install,xsk.h,$(prefix)/include/bpf,644); \
 		$(call do_install,bpf_helpers.h,$(prefix)/include/bpf,644); \
 		$(call do_install,bpf_helper_defs.h,$(prefix)/include/bpf,644); \
tools/lib/bpf/libbpf_common.h +2 -0
index 4fb833840961..a23ae1ac27eb 100644
@@ -9,6 +9,8 @@
 #ifndef __LIBBPF_LIBBPF_COMMON_H
 #define __LIBBPF_LIBBPF_COMMON_H
 
+#include <string.h>
+
 #ifndef LIBBPF_API
 #define LIBBPF_API __attribute__((visibility("default")))
 #endif
Signature · 1 line
2.24.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Toke Høiland-Jørgensen

This fixes two issues with the newly introduced libbpf_common.h file:

- The header failed to include <string.h> for the definition of memset()
- The new file was not included in the install_headers rule in the Makefile

Both of these issues cause breakage when installing libbpf with 'make install' and trying to use it in applications.

Fixes 544402d4b493 ("libbpf: Extract common user-facing helpers")
maintainer Applied
#2 lore raw
Quoted 6 lines · Yonghong Song
Quoted 5 lines · Toke Høiland-Jørgensen

This fixes two issues with the newly introduced libbpf_common.h file:

- The header failed to include <string.h> for the definition of memset()
- The new file was not included in the install_headers rule in the Makefile

Quoted 7 lines
Quoted 5 lines

Both of these issues cause breakage when installing libbpf with 'make install' and trying to use it in applications.

Fixes 544402d4b493 ("libbpf: Extract common user-facing helpers")

Applied, thanks!