[PATCH] build: Disable FORTIFY_SOURCE when optimization is disabled

Daniel Wagner wagi at monom.org
Thu Nov 29 00:38:14 PST 2012


From: Daniel Wagner <daniel.wagner at bmw-carit.de>

The last fix was wrong. We need to use U_FORTIFY_SOURCE flag for this.
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 70844ff..76c1a18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,8 @@ AC_PREFIX_DEFAULT(/usr/local)
 
 PKG_PROG_PKG_CONFIG
 
+COMPILER_FLAGS
+
 AC_SUBST(abs_top_srcdir)
 AC_SUBST(abs_top_builddir)
 
@@ -32,12 +34,10 @@ AC_PROG_LIBTOOL
 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
 			[disable code optimization through compiler]), [
 	if (test "${enableval}" = "no"); then
-		CFLAGS="$CFLAGS -O0"
+		CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
 	fi
 ])
 
-COMPILER_FLAGS
-
 GTK_DOC_CHECK
 
 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
-- 
1.8.0.rc0




More information about the connman mailing list