[Scummvm-cvs-logs] SF.net SVN: scummvm:[52473] scummvm/trunk

Bluddy at users.sourceforge.net Bluddy at users.sourceforge.net
Tue Aug 31 17:24:08 CEST 2010


Revision: 52473
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52473&view=rev
Author:   Bluddy
Date:     2010-08-31 15:24:08 +0000 (Tue, 31 Aug 2010)

Log Message:
-----------
PSP: fix BS2 crash by disabling strict aliasing

The problem that caused the crash in BS2 had to do with GCC making improper assumptions about our code. Specifically, the alignment trick we use for READ_UINT32/16 allows some targets(e.g. MIPS) to generate better code, but it also goes against ANSI C aliasing rules, which prohibit the sharing of addresses between a struct and another variable value. Using -fno-strict-aliasing tells GCC not to assume strict ANSI C aliasing and also unfortunately prevents it from making some good optimizations.

This change is probably needed for other platforms as well -- the crash on the PSP was simply a very rare coincidence.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/psp/Makefile
    scummvm/trunk/configure

Property Changed:
----------------
    scummvm/trunk/configure

Modified: scummvm/trunk/backends/platform/psp/Makefile
===================================================================
--- scummvm/trunk/backends/platform/psp/Makefile	2010-08-31 13:05:15 UTC (rev 52472)
+++ scummvm/trunk/backends/platform/psp/Makefile	2010-08-31 15:24:08 UTC (rev 52473)
@@ -66,7 +66,7 @@
 
 # Variables for common Scummvm makefile
 CXX      = psp-g++
-CXXFLAGS = -O3 -Wall -Wno-multichar -fno-exceptions -fno-rtti
+CXXFLAGS = -O3 -Wall -Wno-multichar -fno-exceptions -fno-rtti -fno-strict-aliasing
 DEFINES  = -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB  -DDISABLE_DOSBOX_OPL -DUSE_RGB_COLOR
 
 LDFLAGS  :=

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2010-08-31 13:05:15 UTC (rev 52472)
+++ scummvm/trunk/configure	2010-08-31 15:24:08 UTC (rev 52473)
@@ -1485,7 +1485,7 @@
 		DEFINES="$DEFINES -D_EE -D__PLAYSTATION2__"
 		;;
 	psp)
-		CXXFLAGS="$CXXFLAGS -O3 -I$PSPSDK/include -D_PSP_FW_VERSION=150"
+		CXXFLAGS="$CXXFLAGS -O3 -I$PSPSDK/include -D_PSP_FW_VERSION=150 -fno-strict-aliasing"
 		;;
 	solaris*)
 		DEFINES="$DEFINES -DSOLARIS -DSYSTEM_NOT_SUPPORTING_D_TYPE"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list