mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Security improvements to Linux build flags mirroring OSX improvements.
This commit is contained in:
parent
dbd7a06ea9
commit
ce09d00679
1 changed files with 8 additions and 9 deletions
|
@ -18,15 +18,18 @@ endif
|
||||||
#DEFS+=-DZT_TRACE -DZT_LOG_STDOUT
|
#DEFS+=-DZT_TRACE -DZT_LOG_STDOUT
|
||||||
|
|
||||||
# Uncomment for a release optimized build
|
# Uncomment for a release optimized build
|
||||||
CFLAGS=-Wall -O3 -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
CFLAGS=-Wall -O3 -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||||
|
LDFLAGS=-pie -Wl,-z,relro,-z,now
|
||||||
STRIP=strip --strip-all
|
STRIP=strip --strip-all
|
||||||
|
|
||||||
# Uncomment for a debug build
|
# Uncomment for a debug build
|
||||||
#CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE $(DEFS)
|
#CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE $(DEFS)
|
||||||
|
#LDFLAGS=
|
||||||
#STRIP=echo
|
#STRIP=echo
|
||||||
|
|
||||||
# Uncomment for gprof profile build
|
# Uncomment for gprof profile build
|
||||||
#CFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
|
#CFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
|
||||||
|
#LDFLAGS=
|
||||||
#STRIP=echo
|
#STRIP=echo
|
||||||
|
|
||||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||||
|
@ -35,20 +38,16 @@ include objects.mk
|
||||||
|
|
||||||
all: one
|
all: one
|
||||||
|
|
||||||
one: $(OBJS)
|
one: $(OBJS) main.o
|
||||||
$(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one main.o $(OBJS) $(LIBS)
|
||||||
$(STRIP) zerotier-one
|
$(STRIP) zerotier-one
|
||||||
ln -sf zerotier-one zerotier-cli
|
ln -sf zerotier-one zerotier-cli
|
||||||
ln -sf zerotier-one zerotier-idtool
|
ln -sf zerotier-one zerotier-idtool
|
||||||
|
|
||||||
selftest: $(OBJS)
|
selftest: $(OBJS) selftest.o
|
||||||
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.cpp $(OBJS) $(LIBS)
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
|
||||||
$(STRIP) zerotier-selftest
|
$(STRIP) zerotier-selftest
|
||||||
|
|
||||||
idtool: $(OBJS)
|
|
||||||
$(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
|
|
||||||
$(STRIP) zerotier-idtool
|
|
||||||
|
|
||||||
installer: one FORCE
|
installer: one FORCE
|
||||||
./buildinstaller.sh
|
./buildinstaller.sh
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue