[openwrt/openwrt] include/bpf.mk: preserve the bpf .o file with debug symbols

LEDE Commits lede-commits at lists.infradead.org
Fri Nov 19 14:52:56 PST 2021


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/98ef23dda84924e01348f2354161459a06e79e58

commit 98ef23dda84924e01348f2354161459a06e79e58
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Nov 18 16:47:51 2021 +0100

    include/bpf.mk: preserve the bpf .o file with debug symbols
    
    Makes it easier to analyze verifier complaints
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/bpf.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/bpf.mk b/include/bpf.mk
index d9f1153cba..61e5b534ab 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -77,6 +77,7 @@ define CompileBPF
 	$(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
 	$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
 	$(LLVM_LLC) -march=$(BPF_TARGET) -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
+	$(CP) $(patsubst %.c,%.o,$(1)) $(patsubst %.c,%.debug.o,$(1))
 	$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
 endef
 



More information about the lede-commits mailing list