diff --git a/CMakeLists.txt b/CMakeLists.txt index a261556..553847d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,14 +138,17 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O0") set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG") set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer") - set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer") - set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer") + set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-math-errno -fno-trapping-math -fomit-frame-pointer") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer") + set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-math-errno -fno-trapping-math -fomit-frame-pointer") set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL}) set(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE}) add_compile_options(-fno-strict-aliasing) + # dear idiot compilers, don't fuck up math code with useless FMA "optimizations" + # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839) + add_compile_options(-ffp-contract=off) if(NOT AROS) CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility) @@ -198,8 +201,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") elseif(cpu STREQUAL "ppc") CHECK_CXX_COMPILER_FLAG("-arch ppc" cxx_has_arch_ppc) if(cxx_has_arch_ppc) - add_compile_options(-arch ppc) - set(ldflags "${ldflags} -arch ppc") + add_compile_options(-arch ppc -mone-byte-bool) + set(ldflags "${ldflags} -arch ppc -mone-byte-bool") endif() add_compile_options(-mmacosx-version-min=10.4)