pcsx2/debian-upstream/patches/55_cmake_opt_clean.patch

414 lines
9.4 KiB
Diff
Raw Normal View History

Index: pcsx2.snapshot-3337/pcsx2/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3337.orig/pcsx2/CMakeLists.txt 2010-06-28 22:43:06.223607055 +0200
+++ pcsx2.snapshot-3337/pcsx2/CMakeLists.txt 2010-06-28 22:43:08.082609942 +0200
@@ -17,12 +17,8 @@
set(CMAKE_CXX_FLAGS_RELEASE "")
# set common flags
-set(CommonFlags
+set(CommonFlags
-pthread
- -fno-guess-branch-probability
- -fno-dse
- -fno-tree-dse
- -fno-strict-aliasing
-m32
-march=i486
-msse
@@ -38,55 +34,51 @@
-W
-g)
+# Remove optimization that can break the code. Must be retested
+set(BadFlags_O0
+ -fno-guess-branch-probability
+ -fno-dse
+ -fno-tree-dse
+ )
+
+set(BadFlags_O1
+ -fno-argument-alias
+ -fno-branch-count-reg
+ -fno-ipa-pure-const
+ -fno-ipa-reference
+ -fno-omit-frame-pointer
+ -fno-split-wide-types
+ -fno-tree-copy-prop
+ -fno-tree-dse
+ -fno-tree-sink
+ )
+
+set(BadFlags_O2
+ -fno-expensive-optimizations
+ -fno-forward-propagate
+ -fno-inline-small-functions
+ -fno-ipa-cp
+ -fno-schedule-insns2
+ -fno-strict-aliasing
+ -fno-tree-builtin-call-dce
+ )
+
# set optimization flags
set(OptimizationFlags
- -falign-functions
- -falign-jumps
- -falign-labels
- -falign-loops
- -fcaller-saves
- -fcprop-registers
- -fcrossjumping
- -fcse-follow-jumps
-fcse-skip-blocks
- -fdefer-pop
- -fdelete-null-pointer-checks
- -fgcse
- -fgcse-lm
- -fif-conversion
- -fif-conversion2
- -fmerge-constants
- -foptimize-sibling-calls
- -fpeephole2
- -fregmove
- -freorder-blocks
- -freorder-functions
- -frerun-cse-after-loop
- -fsched-interblock
- -fsched-spec
-fstrict-overflow
- -fthread-jumps
- -ftree-ccp
- -ftree-ch
- -ftree-copyrename
- -ftree-dce
- -ftree-dominator-opts
- -ftree-fre
-ftree-lrs
- -ftree-pre
- -ftree-sra
- -ftree-ter
- -ftree-vrp
- -funit-at-a-time)
+ -O2
+ )
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
-
+
# executable name
set(pcsx2Name pcsx2)
-
+
# add defines
- add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP)
+ add_definitions(${CommonFlags} ${DebugFlags} ${BadFlags_O0} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
@@ -94,9 +86,9 @@
# executable name
set(pcsx2Name pcsx2)
-
+
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG)
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
@@ -104,9 +96,9 @@
# executable name
set(pcsx2Name pcsx2)
-
+
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG)
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2} -DWX_PRECOMP -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# you must have both svn client executable and a source that contains svn metadata
@@ -606,7 +598,7 @@
set(Platform
${pcsx2LinuxSources}
${pcsx2LinuxHeaders})
-endif(Linux)
+endif(Linux)
# Windows
if(Windows)
@@ -619,7 +611,7 @@
if(MacOSX)
set(PlatformSources
)
-endif(MacOSX)
+endif(MacOSX)
# additonal include directories
include_directories(.
@@ -640,7 +632,7 @@
# link target with project internal libraries
target_link_libraries(${pcsx2Name} Utilities x86emitter)
-
+
# link target with wx
target_link_libraries(${pcsx2Name} ${wxWidgets_LIBRARIES})
Index: pcsx2.snapshot-3337/common/src/x86emitter/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3337.orig/common/src/x86emitter/CMakeLists.txt 2010-06-28 22:39:30.000000000 +0200
+++ pcsx2.snapshot-3337/common/src/x86emitter/CMakeLists.txt 2010-06-28 22:43:08.084613185 +0200
@@ -22,10 +22,6 @@
# set common flags
set(CommonFlags
-pthread
- -fno-guess-branch-probability
- -fno-dse
- -fno-tree-dse
- -fno-strict-aliasing
-m32
-march=i486
-msse
@@ -41,66 +37,63 @@
-W
-g)
+# Remove optimization that can break the code. Must be retested
+set(BadFlags_O0
+ -fno-guess-branch-probability
+ -fno-dse
+ -fno-tree-dse
+ )
+
+set(BadFlags_O1
+ -fno-argument-alias
+ -fno-branch-count-reg
+ -fno-ipa-pure-const
+ -fno-ipa-reference
+ -fno-omit-frame-pointer
+ -fno-split-wide-types
+ -fno-tree-copy-prop
+ -fno-tree-dse
+ -fno-tree-sink
+ )
+
+
+set(BadFlags_O2
+ -fno-expensive-optimizations
+ -fno-forward-propagate
+ -fno-inline-small-functions
+ -fno-ipa-cp
+ -fno-schedule-insns2
+ -fno-strict-aliasing
+ -fno-tree-builtin-call-dce
+ )
+
# set optimization flags
set(OptimizationFlags
- -falign-functions
- -falign-jumps
- -falign-labels
- -falign-loops
- -fcaller-saves
- -fcprop-registers
- -fcrossjumping
- -fcse-follow-jumps
-fcse-skip-blocks
- -fdefer-pop
- -fdelete-null-pointer-checks
- -fgcse
- -fgcse-lm
- -fif-conversion
- -fif-conversion2
- -fmerge-constants
- -foptimize-sibling-calls
- -fpeephole2
- -fregmove
- -freorder-blocks
- -freorder-functions
- -frerun-cse-after-loop
- -fsched-interblock
- -fsched-spec
-fstrict-overflow
- -fthread-jumps
- -ftree-ccp
- -ftree-ch
- -ftree-copyrename
- -ftree-dce
- -ftree-dominator-opts
- -ftree-fre
-ftree-lrs
- -ftree-pre
- -ftree-sra
- -ftree-ter
- -ftree-vrp
- -funit-at-a-time)
+ -O2
+ )
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
- add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
+ add_definitions(${CommonFlags} ${DebugFlags} ${BadFlags_O0} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD)
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2} -DPCSX2_DEVBUILD)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags})
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
Index: pcsx2.snapshot-3337/common/src/Utilities/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3337.orig/common/src/Utilities/CMakeLists.txt 2010-06-28 22:39:30.000000000 +0200
+++ pcsx2.snapshot-3337/common/src/Utilities/CMakeLists.txt 2010-06-28 22:43:08.084613185 +0200
@@ -20,16 +20,12 @@
set(CMAKE_CXX_FLAGS_RELEASE "")
# set common flags
-set(CommonFlags
+set(CommonFlags
-pthread
-m32
-march=i486
-msse
-msse2
- -fno-dse
- -fno-guess-branch-probability
- -fno-strict-aliasing
- -fno-tree-dse
-pipe
-Wno-format
-Wno-unused-parameter
@@ -41,66 +37,64 @@
-g
-W)
+# Remove optimization that can break the code. Must be retested
+set(BadFlags_O0
+ -fno-guess-branch-probability
+ -fno-dse
+ -fno-tree-dse
+ )
+
+set(BadFlags_O1
+ -fno-argument-alias
+ -fno-branch-count-reg
+ -fno-ipa-pure-const
+ -fno-ipa-reference
+ -fno-omit-frame-pointer
+ -fno-split-wide-types
+ -fno-tree-copy-prop
+ -fno-tree-dse
+ -fno-tree-sink
+ )
+
+
+set(BadFlags_O2
+ -fno-expensive-optimizations
+ -fno-forward-propagate
+ -fno-inline-small-functions
+ -fno-ipa-cp
+ -fno-schedule-insns2
+ -fno-strict-aliasing
+ -fno-tree-builtin-call-dce
+ )
+
+
# set optimization flags
set(OptimizationFlags
- -falign-functions
- -falign-jumps
- -falign-labels
- -falign-loops
- -fcaller-saves
- -fcprop-registers
- -fcrossjumping
- -fcse-follow-jumps
-fcse-skip-blocks
- -fdefer-pop
- -fdelete-null-pointer-checks
- -fgcse
- -fgcse-lm
- -fif-conversion
- -fif-conversion2
- -fmerge-constants
- -foptimize-sibling-calls
- -fpeephole2
- -fregmove
- -freorder-blocks
- -freorder-functions
- -frerun-cse-after-loop
- -fsched-interblock
- -fsched-spec
-fstrict-overflow
- -fthread-jumps
- -ftree-ccp
- -ftree-ch
- -ftree-copyrename
- -ftree-dce
- -ftree-dominator-opts
- -ftree-fre
-ftree-lrs
- -ftree-pre
- -ftree-sra
- -ftree-ter
- -ftree-vrp
- -funit-at-a-time)
+ -O2
+ )
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
-
+
# add defines
- add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
+ add_definitions(${CommonFlags} ${DebugFlags} ${BadFlags_O0} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
-
+
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD)
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2} -DPCSX2_DEVBUILD)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
-
+
# add defines
- add_definitions(${CommonFlags} ${OptimizationFlags})
+ add_definitions(${CommonFlags} ${OptimizationFlags} ${BadFlags_O0} ${BadFlags_O1} ${BadFlags_O2})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
@@ -178,7 +172,7 @@
# link target with wx
target_link_libraries(${UtilitiesName} ${wxWidgets_LIBRARIES})
-
+
# Force the linker into 32 bits mode
target_link_libraries(${UtilitiesName} -m32)