summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7794541964..c0656f4fb3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-fdata-sections \
-fstack-protector \
--param=ssp-buffer-size=4])
+AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
+ [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+ -flto])],
+ [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_cflags $address_sanitizer_cflags")
AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],