Added LIBZT_SANITIZE option, removed APIFILES from lwIP build

This commit is contained in:
Joseph Henry
2017-09-11 16:59:52 -07:00
parent d1396c9917
commit b36a213d47
4 changed files with 19 additions and 11 deletions

10
FAQ.md
View File

@@ -11,4 +11,12 @@ In rare circumstances it can take a substantial amount of time for a libzt insta
### How do I get debug output?
In order of relevance, enable the following: For `libzt`-specific debug output which basically includes the POSIX socket emulation layer and network stack *drivers*, enable `LIBZT_DEBUG=1`. For situations where you suspect that the problem might lie within the network stack itself, enable `NS_DEBUG=1`. You should also check out `include/libzt.h` for additional fine-grained debug options for each network stack. If you think that your problem is with the ZeroTier protocol itself, enable `ZT_DEBUG=1`. This will output what's happening in the ZeroTier core. Note, you can enable all of these at once if you're brave.
In order of relevance, enable the following: For `libzt`-specific debug output which basically includes the POSIX socket emulation layer and network stack *drivers*, enable `LIBZT_DEBUG=1`. For situations where you suspect that the problem might lie within the network stack itself, enable `NS_DEBUG=1`. You should also check out `include/libzt.h` for additional fine-grained debug options for each network stack. If you think that your problem is with the ZeroTier protocol itself, enable `ZT_DEBUG=1`. This will output what's happening in the ZeroTier core. Note, you can enable all of these at once if you're brave. Additionally, you can use the `LIBZT_SANITIZE=1` flag to build against the [AddressSanitization]() library.
### Versioning
Each version of libzt will include a specific (and unrelated) version of the ZeroTier core, and network stacks. For instance: Version 1.1.5 of libzt might include version 1.2.5 of ZeroTier, there is no connection between these versioning schemes. Additionally, an update to libzt doesn't necessarily translate to an update to the ZeroTier core.
### How do I run unit tests?
See: [TESTING.md](TESTING.md)

View File

@@ -99,7 +99,8 @@ SIXLOWPAN=$(LWIPDIR)/netif/lowpan6.c \
# ARCHFILES: Architecture specific files.
ARCHFILES=$(wildcard $(LWIPARCH)/*.c $(LWIPARCH)tapif.c $(LWIPARCH)/netif/list.c $(LWIPARCH)/netif/tcpdump.c)
# LWIPFILES: All the above.
LWIPFILES=$(COREFILES) $(APIFILES) $(NETIFFILES) $(ARCHFILES)
LWIPFILES=$(COREFILES) $(NETIFFILES) $(ARCHFILES)
#$(APIFILES)
ifeq ($(LIBZT_IPV4),1)
LWIPFILES+=$(CORE4FILES)

View File

@@ -70,8 +70,8 @@ endif
CXXFLAGS=$(CFLAGS) -Wno-format -fno-rtti -std=c++11 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\""
# Build against address sanitization library for advanced debugging (clang)
ifeq ($(ZT_SANITIZE),1)
CXXFLAGS+=-x c++ -O -g -fsanitize=address -DASAN_OPTIONS=symbolize=1 -DASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
ifeq ($(LIBZT_SANITIZE),1)
SANFLAGS+=-x c++ -O -g -fsanitize=address -DASAN_OPTIONS=symbolize=1 -DASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
endif
INCLUDES+= -Iext \
@@ -207,7 +207,6 @@ picotcp:
cd $(STACK_DIR); make lib ARCH=shared IPV4=1 IPV6=1
lwip:
echo $(STACK_FLAGSs)
make -f make-liblwip.mk liblwip.a $(STACK_FLAGS)
##############################################################################
@@ -269,10 +268,10 @@ ztproxy:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) examples/ztproxy/ztproxy.cpp -o $(BUILD)/ztproxy $< $(UNIT_TEST_LIBS) -ldl
@./check.sh $(BUILD)/ztproxy
selftest:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__SELFTEST__ -o $(BUILD)/selftest $(UNIT_TEST_LIBS)
@$(CXX) $(CXXFLAGS) $(SANFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__SELFTEST__ -o $(BUILD)/selftest $(UNIT_TEST_LIBS)
@./check.sh $(BUILD)/selftest
nativetest:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__NATIVETEST__ -o $(BUILD)/nativetest
@$(CXX) -v $(CXXFLAGS) $(SANFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__NATIVETEST__ -o $(BUILD)/nativetest
@./check.sh $(BUILD)/nativetest

View File

@@ -71,8 +71,8 @@ endif
CXXFLAGS=$(CFLAGS) -Wno-format -fno-rtti -std=c++11 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\""
# Build against address sanitization library for advanced debugging (clang)
ifeq ($(ZT_SANITIZE),1)
CXXFLAGS+=-x c++ -O -g -fsanitize=address -DASAN_OPTIONS=symbolize=1 -DASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
ifeq ($(LIBZT_SANITIZE),1)
SANFLAGS+=-x c++ -O -g -fsanitize=address -DASAN_OPTIONS=symbolize=1 -DASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
endif
INCLUDES+= -Iext \
@@ -281,10 +281,10 @@ ztproxy:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) examples/ztproxy/ztproxy.cpp -o $(BUILD)/ztproxy $< $(UNIT_TEST_LIBS) -ldl
@./check.sh $(BUILD)/ztproxy
selftest:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__SELFTEST__ -o $(BUILD)/selftest $(UNIT_TEST_LIBS)
@$(CXX) $(CXXFLAGS) $(SANFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__SELFTEST__ -o $(BUILD)/selftest $(UNIT_TEST_LIBS)
@./check.sh $(BUILD)/selftest
nativetest:
@$(CXX) $(CXXFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__NATIVETEST__ -o $(BUILD)/nativetest
@$(CXX) $(CXXFLAGS) $(SANFLAGS) $(UNIT_TEST_INCLUDES) $(INCLUDES) test/selftest.cpp -D__NATIVETEST__ -o $(BUILD)/nativetest
@./check.sh $(BUILD)/nativetest
##############################################################################