Fixes make test errors with clang compiler on aarch64 97/12697/3
authorSirshak Das <sirshak.das@arm.com>
Fri, 18 May 2018 18:14:52 +0000 (13:14 -0500)
committerDamjan Marion <dmarion.lists@gmail.com>
Sun, 27 May 2018 10:53:49 +0000 (10:53 +0000)
(VAPI_*BIN).d targets didnt have fake.api.vapi.h* as dependencies
this causes the compilation to proceed before the python script
generates the header files.
Explicit linking of stdc++ is required for clang as errors like
undefined reference to 'new operator' pop up.

Change-Id: I3ca0ef048f392c4a032160ce0e4f7ae759f4c79d
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Brian Brooks <brian.brooks@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
test/ext/Makefile

index 631d7ff..a66a72c 100644 (file)
@@ -16,7 +16,7 @@ ifneq ($(filter centos opensuse opensuse-tumbleweed opensuse-leap,$(OS_ID)),$(OS
 VAPI_LIBS += -lsubunit
 endif
 
-FLAGS = -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(VAPI_BINDIR)
+FLAGS = -g -Wall -lstdc++ -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(VAPI_BINDIR)
 CFLAGS = -std=gnu99 $(FLAGS)
 CPPFLAGS = -std=c++11 $(FLAGS) -I$(WS_ROOT)/extras/vom
 
@@ -36,7 +36,7 @@ $(VAPI_BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi
 $(VAPI_CBIN): $(CSRC) $(VAPI_BINDIR)/fake.api.vapi.h
        $(CC) -o $@ $(CFLAGS) $(CSRC) $(VAPI_LIBS)
 
-$(VAPI_CBIN).d: $(CSRC) $(VAPI_BINDIR)
+$(VAPI_CBIN).d: $(CSRC) $(VAPI_BINDIR)/fake.api.vapi.h
        $(CC) -o $@ $(CFLAGS) -MM -MT '$(VAPI_CBIN)' $(CSRC) > $@
 
 
@@ -45,7 +45,7 @@ CPPSRC = vapi_cpp_test.cpp
 $(VAPI_CPPBIN): $(CPPSRC) $(VAPI_BINDIR)/fake.api.vapi.hpp
        $(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(VAPI_LIBS)
 
-$(VAPI_CPPBIN).d: $(CPPSRC) $(VAPI_BINDIR)
+$(VAPI_CPPBIN).d: $(CPPSRC) $(VAPI_BINDIR)/fake.api.vapi.hpp
        $(CXX) -o $@ $(CPPFLAGS) -MM -MT '$(VAPI_CPPBIN)' $(CPPSRC) > $@
 
 VOM_CPPSRC = vom_test.cpp