Add hardening flags

Use the same hardening flags as the Debian build to enable RELRO,
stack protector and hardening.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2019-10-11 15:58:56 -07:00
parent 78655e6ee0
commit f9239e6e00
No known key found for this signature in database
GPG Key ID: 2D9CA5D475D0EE4E
1 changed files with 4 additions and 0 deletions

View File

@ -116,6 +116,10 @@ RUN set -eux; \
--prefix="$HTTPD_PREFIX" \
--enable-mods-shared=reallyall \
--enable-mpms-shared=all \
--enable-pie \
CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \
CPPFLAGS="-D_FORTIFY_SOURCE=2" \
LDFLAGS="-Wl,--as-needed -Wl,-z,relro -Wl,-z,now" \
; \
make -j "$(nproc)"; \
make install; \