On Mon, Apr 5, 2021 at 1:04 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote: > > I hoped to drop "test_core_extern.skel.h" > tools/testing/selftests/bpf/Makefile as test_cpp.cpp includes it: > > $ git grep include tools/testing/selftests/bpf/test_cpp.cpp > tools/testing/selftests/bpf/test_cpp.cpp:#include "test_core_extern.skel.h" > > $ git diff > diff --git a/tools/testing/selftests/bpf/Makefile > b/tools/testing/selftests/bpf/Makefile > index 044bfdcf5b74..a93e4d6ff93c 100644 > --- a/tools/testing/selftests/bpf/Makefile > +++ b/tools/testing/selftests/bpf/Makefile > @@ -450,7 +450,7 @@ $(OUTPUT)/test_verifier: test_verifier.c > verifier/tests.h $(BPFOBJ) | $(OUTPUT) > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > # Make sure we are able to include and link libbpf against c++. > -$(OUTPUT)/test_cpp: test_cpp.cpp $(OUTPUT)/test_core_extern.skel.h $(BPFOBJ) > +$(OUTPUT)/test_cpp: test_cpp.cpp $(BPFOBJ) > $(call msg,CXX,,$@) > $(Q)$(CXX) $(CFLAGS) $^ $(LDLIBS) -o $@ > > When using g++: > > $ llvm-objdump-12 -Dr test_cpp | grep test_core_extern > 77dd: e8 be 01 00 00 callq 0x79a0 > <_ZL25test_core_extern__destroyP16test_core_extern> > 7842: e8 59 01 00 00 callq 0x79a0 > <_ZL25test_core_extern__destroyP16test_core_extern> > 00000000000079a0 <_ZL25test_core_extern__destroyP16test_core_extern>: > 79a3: 74 1a je 0x79bf > <_ZL25test_core_extern__destroyP16test_core_extern+0x1f> > 79af: 74 05 je 0x79b6 > <_ZL25test_core_extern__destroyP16test_core_extern+0x16> > 799e: 74 06 je 0x79a6 > <_ZL25test_core_extern__destroyP16test_core_extern+0x6> > 7942: 73 61 jae 0x79a5 > <_ZL25test_core_extern__destroyP16test_core_extern+0x5> > 7945: 70 6c jo 0x79b3 > <_ZL25test_core_extern__destroyP16test_core_extern+0x13> > 794b: 70 65 jo 0x79b2 > <_ZL25test_core_extern__destroyP16test_core_extern+0x12> > 7954: 73 5f jae 0x79b5 > <_ZL25test_core_extern__destroyP16test_core_extern+0x15> > 79aa: 79 00 jns 0x79ac > <_ZL25test_core_extern__destroyP16test_core_extern+0xc> > Just to clarify: Using g++ results in the same llvm-objdump output - independent of keeping or dropping "$(OUTPUT)/test_core_extern.skel.h". - Sedat -