Commit e16f5629 authored by John Selbie's avatar John Selbie Committed by GitHub

First attempt at ASLR support on Cygwin (#31)

Co-authored-by: default avatarJohn Selbie <john@selbie.com>
parent 644d0fb2
......@@ -15,6 +15,6 @@ clean:
rm -f $(PROJECT_OBJS) $(PROJECT_TARGET)
$(PROJECT_TARGET): $(PROJECT_OBJS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS) $(ASLR_FLAGS)
......@@ -17,6 +17,8 @@ CRYPTO_LIBS := -lcrypto
#SOLARIS HACK
UNAME := $(shell uname -s)
UNAMEOS := $(shell uname -o)
ifeq ($(UNAME),SunOS)
SOCKET_LIBS := -lsocket -lnsl
endif
......@@ -26,6 +28,11 @@ ifeq ($(UNAME),Darwin)
CRYPTO_LIBS :=
endif
#Cygwin hack for ASLR
ifeq ($(UNAMEOS), Cygwin)
ASLR_FLAGS := -Xlinker --dynamicbase
endif
.PHONY: all clean debug
%.hpp.gch: %.hpp
......
......@@ -14,6 +14,6 @@ clean:
rm -f $(PROJECT_OBJS) $(PROJECT_TARGET)
$(PROJECT_TARGET): $(PROJECT_OBJS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS) $(ASLR_FLAGS)
......@@ -14,7 +14,7 @@ clean:
rm -f $(PROJECT_OBJS) $(PROJECT_TARGET)
$(PROJECT_TARGET): $(PROJECT_OBJS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS)
$(LINK.cpp) -o $@ $^ $(LIB_PATH) $(LIBS) $(SOCKET_LIBS) $(CRYPTO_LIBS) $(ASLR_FLAGS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment