HBSD: Add RELRO Support

github-issue: #40

This adds support for RELRO and BINDNOW in the build system. This
patch was obtained from Baptiste Darroussin from his patch submitted
to FreeBSD Phabricator. Further work will need to happen in the ports
tree.

Obtained-from: Baptiste Daroussin (bapt@freebsd.org)
Obtained-from: FreeBSD Phabricator - https://reviews.freebsd.org/D3001

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>
This commit is contained in:
Shawn Webb 2015-08-14 11:41:00 -04:00
parent 9ec646d6aa
commit 43216284f9
No known key found for this signature in database
GPG Key ID: 6A84658F52456EEE
2 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,8 @@ SHARED_CXXFLAGS+= -g
CTFFLAGS+= -g
.endif
LDFLAGS+= -Wl,-z,relro -Wl,-z,now
.include <bsd.libnames.mk>
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries

View File

@ -19,6 +19,8 @@ LDFLAGS+= -pie
.endif
.endif
LDFLAGS+= -Wl,-z,relro -Wl,-z,now
.if ${MK_ASSERT_DEBUG} == "no"
CFLAGS+= -DNDEBUG
NO_WERROR=