ibmtss/ibmtss-configure.ac-Do-not-disable-optimization-for-debug-b.patch

31 lines
1.1 KiB
Diff

From 6d5c05a167d847ac21315aa4a1c171715cd816af Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 17 Aug 2020 18:21:51 +0200
Subject: [PATCH] configure.ac: Do not override optimization for debug build.
-O0 conflicts with FORTIFY_SOURCE and generates completely different
assembly for debug and production. If user passes in C flags let them
override the suggested -O0.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 30e9254b339a..883c4bb84efa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@ AC_CHECK_FUNCS([gethostbyname memmove memset socket strerror strtoul])
# Replace autotools default optimization
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [Build a TSS library used for debugging]))
- AS_IF([test "$enable_debug" = "yes"], [CFLAGS="$USER_CFLAGS -g -ggdb -O0"])
+ AS_IF([test "$enable_debug" = "yes"], [CFLAGS="-O0 -g -ggdb $USER_CFLAGS -Wextra -Werror"])
# Linux requires -DTPM_POSIX
case $host_os in
--
2.46.1