Commit 32285385 authored by Jacob Appelbaum's avatar Jacob Appelbaum
Browse files

Add cc and ld hardening options for mingw builds

Add CC_HARDENING_OPTIONS with the following options:

  -fstack-protector-all -fPIE -Wstack-protector -fwrapv
  --param ssp-buffer-size=1

Add LD_HARDENING_OPTIONS with the following options:

  --dynamicbase --nxcompat -pie

Add linking against libssp for stack-protector-all
parent 0e6c8df8
......@@ -59,15 +59,21 @@ TARGET = pidgin-otr.dll
# The target zipfile
ZIPFILE = pidgin-otr-$(PIDGIN_OTR_VERSION).zip
CC_HARDENING_OPTIONS ?= -fstack-protector-all -fPIE -Wstack-protector -fwrapv --param ssp-buffer-size=1
# In theory, we'd also like the following:
# LD_HARDENING_OPTIONS ?= -dynamicbase --nxcompat -pie -z relro -z now
LD_HARDENING_OPTIONS ?= --dynamicbase --nxcompat -pie
CC = i586-mingw32msvc-gcc
LDFLAGS = -Wl,--enable-auto-image-base
LDFLAGS = -Wl,--enable-auto-image-base $(LD_HARDENING_OPTIONS)
-L$(PIDGIN_WIN32_LIBS) -lgtk-win32-2.0 -lglib-2.0 \
-lgdk_pixbuf-2.0 -lgobject-2.0 -lpidgin -llibpurple \
-lgcrypt -lgpg-error -L$(LIBINTLLIBDIR) -lintl
-lgcrypt -lgpg-error -L$(LIBINTLLIBDIR) -lintl -lssp
CC ?= gcc
override CFLAGS += -g -O2 -Wall $(PIDGIN_HEADERS) $(PURPLE_HEADERS) \
override CFLAGS += -g -O2 -Wall $(CC_HARDENING_OPTIONS) \
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