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
gcc -ldl -shared -fPIC -o libxcomfix.so -std=gnu11 xcomfix.c
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
-
done
export LD_PRELOAD=/path/to/libxcomfix.so ${DEBUGGER} "${GAMEBINARY}" $@ STATUS=$?
#### 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
launch it normally
launch it normally