commit 9bfff1d: [Minor] Use less aggressive optimisation level

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Mar 5 22:56:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-05 22:51:29 +0000
URL: https://github.com/rspamd/rspamd/commit/9bfff1d4775e19ce85272f61aecd64ce69b6a98a (HEAD -> master)

[Minor] Use less aggressive optimisation level

---
 CMakeLists.txt                      | 4 ++--
 contrib/aho-corasick/CMakeLists.txt | 2 +-
 contrib/hiredis/CMakeLists.txt      | 2 +-
 contrib/http-parser/CMakeLists.txt  | 2 +-
 contrib/lc-btrie/CMakeLists.txt     | 2 +-
 contrib/libottery/CMakeLists.txt    | 2 +-
 contrib/linenoise/CMakeLists.txt    | 2 +-
 contrib/lua-lpeg/CMakeLists.txt     | 2 +-
 contrib/t1ha/CMakeLists.txt         | 2 +-
 contrib/xxhash/CMakeLists.txt       | 2 +-
 contrib/zstd/CMakeLists.txt         | 2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ab6f7c56..2e490b6cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -819,7 +819,7 @@ IF(NOT CMAKE_C_OPT_FLAGS)
 			MARK_AS_ADVANCED(CMAKE_GCC_AR CMAKE_GCC_RANLIB)
 		ENDIF()
 		IF(CMAKE_GCC_AR AND CMAKE_GCC_RANLIB)
-			SET(CMAKE_C_OPT_FLAGS "-g -O3 -fstrict-aliasing -flto")
+			SET(CMAKE_C_OPT_FLAGS "-g -O2 -fstrict-aliasing -flto")
 			SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
 			SET(CMAKE_C_ARCHIVE_CREATE "${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>")
 			SET(CMAKE_C_ARCHIVE_APPEND "${CMAKE_GCC_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>")
@@ -829,7 +829,7 @@ IF(NOT CMAKE_C_OPT_FLAGS)
 			SET(CMAKE_CXX_ARCHIVE_FINISH "${CMAKE_GCC_RANLIB} <TARGET>")
 		ENDIF()
 	ELSE()
-		SET(CMAKE_C_OPT_FLAGS "-g -O3 -fstrict-aliasing")
+		SET(CMAKE_C_OPT_FLAGS "-g -O2 -fstrict-aliasing")
 	ENDIF()
 	ELSE(ENABLE_OPTIMIZATION MATCHES "ON")
 		IF(ENABLE_FULL_DEBUG MATCHES "ON")
diff --git a/contrib/aho-corasick/CMakeLists.txt b/contrib/aho-corasick/CMakeLists.txt
index 93c51a146..fb0e70bbc 100644
--- a/contrib/aho-corasick/CMakeLists.txt
+++ b/contrib/aho-corasick/CMakeLists.txt
@@ -3,7 +3,7 @@ SET(AHOCORASICSRC	acism_create.c
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
 endif ()
 ENDIF()
 
diff --git a/contrib/hiredis/CMakeLists.txt b/contrib/hiredis/CMakeLists.txt
index f8b233996..7648c0dcc 100644
--- a/contrib/hiredis/CMakeLists.txt
+++ b/contrib/hiredis/CMakeLists.txt
@@ -9,7 +9,7 @@ SET(HIREDIS_CFLAGS "")
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	SET(HIREDIS_CFLAGS "${HIREDIS_CFLAGS} -O3")
+	SET(HIREDIS_CFLAGS "${HIREDIS_CFLAGS} -O2")
 ENDIF()
 ENDIF()
 
diff --git a/contrib/http-parser/CMakeLists.txt b/contrib/http-parser/CMakeLists.txt
index 499c85e93..cb6767272 100644
--- a/contrib/http-parser/CMakeLists.txt
+++ b/contrib/http-parser/CMakeLists.txt
@@ -4,7 +4,7 @@ SET(HTTPSRC            http_parser.c)
 SET(HTTP_COMPILE_FLAGS "-DRSPAMD_LIB")
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	set(HTTP_COMPILE_FLAGS "${HTTP_COMPILE_FLAGS} -O3")
+	set(HTTP_COMPILE_FLAGS "${HTTP_COMPILE_FLAGS} -O2")
 endif ()
 ENDIF()
 
diff --git a/contrib/lc-btrie/CMakeLists.txt b/contrib/lc-btrie/CMakeLists.txt
index b520bda86..3b7a1cf24 100644
--- a/contrib/lc-btrie/CMakeLists.txt
+++ b/contrib/lc-btrie/CMakeLists.txt
@@ -4,7 +4,7 @@ ADD_LIBRARY(lcbtrie STATIC ${LCTRIESRC})
 SET(LCTRIE_CFLAGS "-DBUILD_RSPAMD")
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-    SET(LCTRIE_CFLAGS "${LCTRIE_CFLAGS} -O3")
+    SET(LCTRIE_CFLAGS "${LCTRIE_CFLAGS} -O2")
 endif ()
 ENDIF()
 
diff --git a/contrib/libottery/CMakeLists.txt b/contrib/libottery/CMakeLists.txt
index 4a6ee31db..8a2385307 100644
--- a/contrib/libottery/CMakeLists.txt
+++ b/contrib/libottery/CMakeLists.txt
@@ -10,7 +10,7 @@ ADD_LIBRARY(ottery STATIC ${OTTERYSRC})
 SET(OTTERY_CFLAGS "-DBUILD_RSPAMD -DOTTERY_NO_PID_CHECK -DOTTERY_NO_INIT_CHECK")
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-    SET(OTTERY_CFLAGS "${OTTERY_CFLAGS} -O3")
+    SET(OTTERY_CFLAGS "${OTTERY_CFLAGS} -O2")
 endif ()
 ENDIF()
 set_target_properties(ottery PROPERTIES COMPILE_FLAGS "${OTTERY_CFLAGS}")
\ No newline at end of file
diff --git a/contrib/linenoise/CMakeLists.txt b/contrib/linenoise/CMakeLists.txt
index 8fc9ff843..93279f0b9 100644
--- a/contrib/linenoise/CMakeLists.txt
+++ b/contrib/linenoise/CMakeLists.txt
@@ -5,6 +5,6 @@ SET_TARGET_PROPERTIES(rspamd-linenoise PROPERTIES VERSION ${RSPAMD_VERSION})
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	SET_TARGET_PROPERTIES(rspamd-linenoise PROPERTIES COMPILE_FLAGS "-O3")
+	SET_TARGET_PROPERTIES(rspamd-linenoise PROPERTIES COMPILE_FLAGS "-O2")
 endif ()
 ENDIF()
diff --git a/contrib/lua-lpeg/CMakeLists.txt b/contrib/lua-lpeg/CMakeLists.txt
index 2362aac9c..e8b337935 100644
--- a/contrib/lua-lpeg/CMakeLists.txt
+++ b/contrib/lua-lpeg/CMakeLists.txt
@@ -6,7 +6,7 @@ SET(LPEGSRC lpcap.c
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-    SET(LPEG_CFLAGS "${LPEG_CFLAGS} -O3")
+    SET(LPEG_CFLAGS "${LPEG_CFLAGS} -O2")
 endif ()
 ENDIF()
 
diff --git a/contrib/t1ha/CMakeLists.txt b/contrib/t1ha/CMakeLists.txt
index 491010ff9..626dda509 100644
--- a/contrib/t1ha/CMakeLists.txt
+++ b/contrib/t1ha/CMakeLists.txt
@@ -7,6 +7,6 @@ ADD_DEFINITIONS("-DT1HA_USE_FAST_ONESHOT_READ=0")
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
     if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-        SET_TARGET_PROPERTIES(rspamd-t1ha PROPERTIES COMPILE_FLAGS "-O3")
+        SET_TARGET_PROPERTIES(rspamd-t1ha PROPERTIES COMPILE_FLAGS "-O2")
     endif ()
 ENDIF()
diff --git a/contrib/xxhash/CMakeLists.txt b/contrib/xxhash/CMakeLists.txt
index 8caf319e4..b4feec1d6 100644
--- a/contrib/xxhash/CMakeLists.txt
+++ b/contrib/xxhash/CMakeLists.txt
@@ -4,6 +4,6 @@ ADD_LIBRARY(xxhash STATIC ${XXHASHSRC})
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	SET_TARGET_PROPERTIES(xxhash PROPERTIES COMPILE_FLAGS "-O3")
+	SET_TARGET_PROPERTIES(xxhash PROPERTIES COMPILE_FLAGS "-O2")
 endif ()
 ENDIF()
diff --git a/contrib/zstd/CMakeLists.txt b/contrib/zstd/CMakeLists.txt
index 2cccee0c1..cda9b66d6 100644
--- a/contrib/zstd/CMakeLists.txt
+++ b/contrib/zstd/CMakeLists.txt
@@ -25,6 +25,6 @@ ADD_DEFINITIONS(-DZSTD_STATIC_LINKING_ONLY)
 
 IF(ENABLE_FULL_DEBUG MATCHES "OFF")
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-	SET_TARGET_PROPERTIES(rspamd-zstd PROPERTIES COMPILE_FLAGS "-O3")
+	SET_TARGET_PROPERTIES(rspamd-zstd PROPERTIES COMPILE_FLAGS "-O2")
 endif ()
 ENDIF()


More information about the Commits mailing list