From: Brian Aker Date: Wed, 5 Sep 2012 04:46:01 +0000 (-0400) Subject: Update hardening flags. X-Git-Tag: 1.0.11~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8f57b3b4586bca9dc17266a29e6384ac542c1c86;p=m6w6%2Flibmemcached Update hardening flags. --- diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4 index b8474321..65cfdf5f 100644 --- a/m4/ax_harden_compiler_flags.m4 +++ b/m4/ax_harden_compiler_flags.m4 @@ -48,25 +48,50 @@ #serial 1 AC_DEFUN([AX_HARDEN_COMPILER_FLAGS], -[AC_REQUIRE([AX_CHECK_COMPILE_FLAG]) -AC_REQUIRE([AX_APPEND_FLAG]) +[AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) AC_REQUIRE([AX_CHECK_LINK_FLAG]) AX_APPEND_COMPILE_FLAGS([-O2]) AX_APPEND_COMPILE_FLAGS([-Werror]) AX_APPEND_COMPILE_FLAGS([-Wall]) AX_APPEND_COMPILE_FLAGS([-Wextra]) +dnl AX_APPEND_COMPILE_FLAGS([-std=c++11]) +AX_APPEND_COMPILE_FLAGS([-Wpragmas]) +dnl AX_APPEND_COMPILE_FLAGS([-pedantic]) +AX_APPEND_COMPILE_FLAGS([--paramssp-buffer-size=1]) +AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2]) +AX_APPEND_COMPILE_FLAGS([-Waddress]) +AX_APPEND_COMPILE_FLAGS([-Warray-bounds]) +AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast]) +AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts]) +AX_APPEND_COMPILE_FLAGS([-Wcomment]) +AX_APPEND_COMPILE_FLAGS([-Wdeclaration-after-statement]) +AX_APPEND_COMPILE_FLAGS([-Wfloat-equal]) +AX_APPEND_COMPILE_FLAGS([-Wformat=2]) AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized]) +AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers]) +AX_APPEND_COMPILE_FLAGS([-Wmissing-noreturn]) +AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes]) +AX_APPEND_COMPILE_FLAGS([-Wnested-externs]) +AX_APPEND_COMPILE_FLAGS([-Wnormalized=id]) +AX_APPEND_COMPILE_FLAGS([-Wold-style-definition]) +AX_APPEND_COMPILE_FLAGS([-Woverride-init]) +AX_APPEND_COMPILE_FLAGS([-Wpointer-arith]) +AX_APPEND_COMPILE_FLAGS([-Wredundant-decls]) +AX_APPEND_COMPILE_FLAGS([-Wshadow]) +AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32]) AX_APPEND_COMPILE_FLAGS([-Wsign-compare]) +AX_APPEND_COMPILE_FLAGS([-Wstack-protector]) +AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1]) +AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes]) +AX_APPEND_COMPILE_FLAGS([-Wswitch-enum]) +AX_APPEND_COMPILE_FLAGS([-Wundef]) AX_APPEND_COMPILE_FLAGS([-Wunused-result]) AX_APPEND_COMPILE_FLAGS([-Wunused-variable]) +AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all]) AX_APPEND_COMPILE_FLAGS([-fstack-protector-all]) -AX_APPEND_COMPILE_FLAGS([-ggdb]) -AX_APPEND_COMPILE_FLAGS([-fstack-protector-all]) -AX_APPEND_COMPILE_FLAGS([-Wstack-protector]) AX_APPEND_COMPILE_FLAGS([-fwrapv]) -AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2]) -AX_APPEND_COMPILE_FLAGS([--param],[ssp-buffer-size=1]) +AX_APPEND_COMPILE_FLAGS([-ggdb]) AX_CHECK_LINK_FLAG([-Werror]) AX_CHECK_LINK_FLAG([-z relro -z now]) ])dnl AX_HARDEN_COMPILER_FLAGS