diff -Naur darktable-3.0.0/cmake/march-mtune.cmake darktable-3.0.0.new/cmake/march-mtune.cmake
--- darktable-3.0.0/cmake/march-mtune.cmake	2019-12-21 10:57:37.000000000 +0100
+++ darktable-3.0.0.new/cmake/march-mtune.cmake	1970-01-01 01:00:00.000000000 +0100
@@ -1,31 +0,0 @@
-if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
-  set(MARCH "-msse4.2")
-elseif(NOT BINARY_PACKAGE_BUILD AND (NOT APPLE OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang"))
-  MESSAGE("-- Checking for -march=native support")
-  CHECK_C_COMPILER_FLAG("-march=native" MARCHNATIVE)
-  if(MARCHNATIVE)
-    set(MARCH "-march=native")
-  else()
-    MESSAGE("-- Checking for -mtune=native support")
-    CHECK_C_COMPILER_FLAG("-mtune=native" MTUNENATIVE)
-    if(MTUNENATIVE)
-      set(MARCH "-mtune=native")
-    else()
-      MESSAGE("-- Checking for -mtune=generic support")
-      CHECK_C_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
-      if(MTUNEGENERIC)
-        set(MARCH "-mtune=generic")
-      else()
-        message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
-      endif()
-    endif()
-  endif()
-else()
-  MESSAGE("-- Checking for -mtune=generic support")
-  CHECK_C_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
-  if(MTUNEGENERIC)
-    set(MARCH "-mtune=generic")
-  else()
-    message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
-  endif()
-endif()
diff -Naur darktable-3.0.0/src/CMakeLists.txt darktable-3.0.0.new/src/CMakeLists.txt
--- darktable-3.0.0/src/CMakeLists.txt	2019-12-21 10:57:37.000000000 +0100
+++ darktable-3.0.0.new/src/CMakeLists.txt	2020-01-03 16:10:56.803972974 +0100
@@ -530,7 +530,7 @@
     endif()
 
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3 -ggdb3")
-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fexpensive-optimizations")
+    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ")
   else()
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
   endif()
@@ -544,7 +544,7 @@
     endif()
 
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3 -ggdb3")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fexpensive-optimizations")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ")
   else()
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
   endif()
diff -Naur darktable-3.0.0/src/external/rawspeed/cmake/compiler-flags.cmake darktable-3.0.0.new/src/external/rawspeed/cmake/compiler-flags.cmake
--- darktable-3.0.0/src/external/rawspeed/cmake/compiler-flags.cmake	2019-12-03 12:12:52.000000000 +0100
+++ darktable-3.0.0.new/src/external/rawspeed/cmake/compiler-flags.cmake	2020-01-03 16:11:46.980262583 +0100
@@ -1,5 +1,4 @@
 include(CheckCXXCompilerFlag)
-include(CpuMarch)
 include(CheckCXXCompilerFlagAndEnableIt)
 
 # yes, need to keep both the CMAKE_CXX_FLAGS and CMAKE_CXX_STANDARD.
diff -Naur darktable-3.0.0/src/external/rawspeed/cmake/Modules/CpuMarch.cmake darktable-3.0.0.new/src/external/rawspeed/cmake/Modules/CpuMarch.cmake
--- darktable-3.0.0/src/external/rawspeed/cmake/Modules/CpuMarch.cmake	2019-12-03 12:12:52.000000000 +0100
+++ darktable-3.0.0.new/src/external/rawspeed/cmake/Modules/CpuMarch.cmake	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-include(CheckCXXCompilerFlag)
-
-if(NOT BINARY_PACKAGE_BUILD)
-  message(STATUS "Checking for -march=native support")
-  CHECK_CXX_COMPILER_FLAG("-march=native" MARCHNATIVE)
-  if(MARCHNATIVE)
-    message(STATUS "Checking for -march=native support - works")
-    set(MARCH "-march=native")
-  else()
-    message(STATUS "Checking for -mtune=native support")
-    CHECK_CXX_COMPILER_FLAG("-mtune=native" MTUNENATIVE)
-    if(MTUNENATIVE)
-      message(STATUS "Checking for -mtune=native support - works")
-      set(MARCH "-mtune=native")
-    else()
-      message(STATUS "Checking for -mtune=generic support")
-      CHECK_CXX_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
-      if(MTUNEGENERIC)
-        message(STATUS "Checking for -mtune=generic support - works")
-        set(MARCH "-mtune=generic")
-      else()
-        message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
-      endif()
-    endif()
-  endif()
-else()
-  message(STATUS "Checking for -mtune=generic support")
-  CHECK_CXX_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
-  if(MTUNEGENERIC)
-    message(STATUS "Checking for -mtune=generic support - works")
-    set(MARCH "-mtune=generic")
-  else()
-    message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
-  endif()
-endif()
-
-ADD_DEFINITIONS(${MARCH})
diff -Naur darktable-3.0.0/src/tests/Makefile darktable-3.0.0.new/src/tests/Makefile
--- darktable-3.0.0/src/tests/Makefile	2019-12-21 10:57:37.000000000 +0100
+++ darktable-3.0.0.new/src/tests/Makefile	2020-01-03 16:11:16.271085290 +0100
@@ -2,4 +2,4 @@
 # LDFLAGS+=$(shell pkg-config glib-2.0 --libs)
 
 cache: cache.c ../common/cache.h ../common/cache.c Makefile
-	gcc -std=c99 -O0 -I.. -g -march=native -o cache cache.c -fopenmp ${CFLAGS} ${LDFLAGS}
+	gcc -std=c99 -O0 -I.. -g  -o cache cache.c -fopenmp ${CFLAGS} ${LDFLAGS}
