Skip to contentSkip to conversation

samples/bpf: fix a build problem

PATCH Applied Yonghong Song 2 participants 3 messages Jun 21, 2017 – Jun 22, 2017

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

PATCH 1/1 samples/bpf: fix a build problem

tracex5_kern.c build failed with the following error message:
../samples/bpf/tracex5_kern.c:12:10: fatal error: 'syscall_nrs.h' file not found #include "syscall_nrs.h"
The generated file syscall_nrs.h is put in build/samples/bpf directory, but this directory is not in include path, hence build failed.

The fix is to add $(obj) into the clang compilation path.

---
 samples/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/Makefile +1 -1
index a0561dc..e7ec9b8 100644
@@ -197,7 +197,7 @@ $(obj)/tracex5_kern.o: $(obj)/syscall_nrs.h
 # But, there is no easy way to fix it, so just exclude it since it is
 # useless for BPF samples.
 $(obj)/%.o: $(src)/%.c
-	$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \
+	$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
 		-D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \
 		-Wno-compare-distinct-pointer-types \
 		-Wno-gnu-variable-sized-type-not-at-end \
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw

From: Yonghong Song <[email protected]>
Date: Wed, 21 Jun 2017 13:48:27 -0700

Quoted 9 lines

tracex5_kern.c build failed with the following error message:
../samples/bpf/tracex5_kern.c:12:10: fatal error: 'syscall_nrs.h' file not found #include "syscall_nrs.h"
The generated file syscall_nrs.h is put in build/samples/bpf directory, but this directory is not in include path, hence build failed.

The fix is to add $(obj) into the clang compilation path.

Applied, thanks.

Please be clear in the future that your patch is targetting 'net-next' by specifying this in your subject lines:

	[PATCH net-next] ...

I had to figure this out by hand.

Thank you.

#2 lore raw
Quoted 11 lines · David Miller

From: Yonghong Song <[email protected]>
Date: Wed, 21 Jun 2017 13:48:27 -0700

Quoted 8 lines

tracex5_kern.c build failed with the following error message:
../samples/bpf/tracex5_kern.c:12:10: fatal error: 'syscall_nrs.h' file not found #include "syscall_nrs.h"
The generated file syscall_nrs.h is put in build/samples/bpf directory, but this directory is not in include path, hence build failed.

The fix is to add $(obj) into the clang compilation path.

Quoted 8 lines
Quoted 1 line

Applied, thanks.

Please be clear in the future that your patch is targetting 'net-next' by specifying this in your subject lines:

	[PATCH net-next] ...

Thanks, Dave. Sorry, I forgot to tag the branch name. I will make sure it happen in the future.

Quoted 5 lines

I had to figure this out by hand.

Thank you.