]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
compiler: -Wdate-time hardening
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Feb 2019 22:49:48 +0000 (23:49 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Feb 2019 22:49:48 +0000 (23:49 +0100)
Warn when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered as
they might prevent bit-wise-identical reproducible compilations.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
configure.ac

index c59b7664d979bd5fa7bd35268dac4b1bd1208538..664ce9b1cb682c077b22c1ac1ba8a309f8cb5da9 100644 (file)
@@ -717,6 +717,7 @@ AX_CHECK_COMPILE_FLAG([-Werror=overflow], [CFLAGS="$CFLAGS -Werror=overflow"],,[
 AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option], [CFLAGS="$CFLAGS -fdiagnostics-show-option"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-Werror=shift-count-overflow], [CFLAGS="$CFLAGS -Werror=shift-count-overflow"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-Werror=shift-overflow=2], [CFLAGS="$CFLAGS -Werror=shift-overflow=2"],,[-Werror])
+AX_CHECK_COMPILE_FLAG([-Wdate-time], [CFLAGS="$CFLAGS -Wdate-time"],,[-Werror])
 
 AX_CHECK_LINK_FLAG([-z relro], [LDLAGS="$LDLAGS -z relro"],,[])
 AX_CHECK_LINK_FLAG([-z now], [LDLAGS="$LDLAGS -z now"],,[])