diff options
author | Kay Sievers <kay@vrfy.org> | 2013-11-21 21:56:18 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-11-21 21:56:18 +0100 |
commit | b850b06e1efcc7e27cfd785759a3a913ac9ed196 (patch) | |
tree | cb8203931639a9b77af4f9ff893ae2e50bdcb7ba /configure.ac | |
parent | 92b315dfb482626ca6c98b67cd862e4af483a499 (diff) |
build-sys: enable gcc Link Time Optimization when optimization is enabled
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 4 |
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\ ]]*], |