Skip to content

fix for frequent segfaults occuring with XCOM:Enemy within (Steam/Linux)

License

Notifications You must be signed in to change notification settings

knecht/xcom-hacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

xcom-hacks

This is an ugly, nasty hack which should prevent XCOM:Enemy within (Steam/Linux) from crashing more often than UFOs. Although it looks, smells and tastes pretty hacky, it worked surprisingly well for me (not a single segfault using this hack). I finished nearly the whole "enemy within" using it and tested three consecutive "enemy unknown" missions (without the extension). Some background information about the crash: http://psydk.org/archives/2014-07-05-221-introducing-plasma-fence

Step 1 (both versions) : compile

gcc -ldl -shared -fPIC -o libxcomfix.so -std=gnu11 xcomfix.c

Step 2a: patch the enemy unknown start script

apply this patch (replace /path/to/ ):

--- SteamLibrary/SteamApps/common/XCom-Enemy-Unknown/binaries/linux/xcom.sh 2014-09-17 23:43:58.312490143 +0200 +++ SteamLibrary/SteamApps/common/XCom-Enemy-Unknown/binaries/linux/xcom.sh 2014-09-17 23:43:26.263492934 +0200 @@ -30,6 +30,8 @@ # Launch the game and grab the status STATUS=42 while [ $STATUS -eq 42 ]; do

  •   echo launching with libxcomfix.so
    
  •   export LD_PRELOAD=/path/to/libxcomfix.so
      ${DEBUGGER} "${GAMEBINARY}" $@
      STATUS=$?
    
    done

#### Step 2b: patch the enemy within start script
apply this patch (replace /path/to/ ):
>```
--- SteamLibrary/SteamApps/common/XCom-Enemy-Unknown/xew/binaries/linux/xcom_ew.sh	2014-09-17 23:43:58.312490143 +0200
+++ SteamLibrary/SteamApps/common/XCom-Enemy-Unknown/xew/binaries/linux/xcom_ew.sh	2014-09-17 23:43:26.263492934 +0200
@@ -30,6 +30,8 @@
 	# Launch the game and grab the status
 	STATUS=42
 	while [ $STATUS -eq 42 ]; do
+		echo launching with libxcomfix.so
+		export LD_PRELOAD=/path/to/libxcomfix.so
 		${DEBUGGER} "${GAMEBINARY}" $@
 		STATUS=$?
 	done

Step 3a (Enemy Unkown): launch the game

launch it normally

Step 3b (Enemy Within): launch the game

launch it normally

About

fix for frequent segfaults occuring with XCOM:Enemy within (Steam/Linux)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages