Set -fno-strict-aliasing to prevent gcc from breaking tons of code

* Technically the code is incorrect, because the C++ spec is terrible and makes
  completely normal things illegal. GCC decides that a couple of % more perf is
  worth breaking lots of code, so instead we disable this class of
  "optimisation".
This commit is contained in:
baldurk
2020-07-28 15:30:45 +01:00
parent 624da2fb25
commit d020543065
+1 -1
View File
@@ -314,7 +314,7 @@ if(cmake_build_type_lower STREQUAL "release" OR
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fstrict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
if(ENABLE_GGP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gline-tables-only -fno-omit-frame-pointer")