pcsx2/debian_unofficial/patches/55_cmake_opt_clean.patch

405 lines
9.1 KiB
Diff

Index: pcsx2.snapshot-3208/pcsx2/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3208.orig/pcsx2/CMakeLists.txt 2010-06-15 13:12:59.655335900 +0200
+++ pcsx2.snapshot-3208/pcsx2/CMakeLists.txt 2010-06-15 13:14:33.597334089 +0200
@@ -11,12 +11,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
@@ -32,55 +28,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
@@ -88,9 +80,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
@@ -98,9 +90,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
@@ -598,7 +590,7 @@
set(Platform
${pcsx2LinuxSources}
${pcsx2LinuxHeaders})
-endif(Linux)
+endif(Linux)
# Windows
if(Windows)
@@ -611,7 +603,7 @@
if(MacOSX)
set(PlatformSources
)
-endif(MacOSX)
+endif(MacOSX)
# additonal include directories
include_directories(.
@@ -632,7 +624,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-3208/common/src/x86emitter/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3208.orig/common/src/x86emitter/CMakeLists.txt 2010-06-15 13:10:41.000000000 +0200
+++ pcsx2.snapshot-3208/common/src/x86emitter/CMakeLists.txt 2010-06-15 13:14:33.597334089 +0200
@@ -16,10 +16,6 @@
# set common flags
set(CommonFlags
-pthread
- -fno-guess-branch-probability
- -fno-dse
- -fno-tree-dse
- -fno-strict-aliasing
-m32
-march=i486
-msse
@@ -35,66 +31,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-3208/common/src/Utilities/CMakeLists.txt
===================================================================
--- pcsx2.snapshot-3208.orig/common/src/Utilities/CMakeLists.txt 2010-06-15 13:10:41.000000000 +0200
+++ pcsx2.snapshot-3208/common/src/Utilities/CMakeLists.txt 2010-06-15 13:14:33.598334111 +0200
@@ -19,82 +19,76 @@
-m32
-march=i486
-msse
- -msse2
- -fno-dse
- -fno-guess-branch-probability
- -fno-strict-aliasing
- -fno-tree-dse
+ -msse2
-pipe
- -Wno-format
- -Wno-unused-parameter
- -Wno-unused-value
- -Wunused-variable)
+ -Wno-format
+ -Wno-unused-parameter
+ -Wno-unused-value
+ -Wunused-variable)
# set warning flags
set(DebugFlags
-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