HOWTO Running Old Loki Games
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article
[edit] The Problem
Unknown changes in glibc 2.3 (and newer) cause problems for these old games resulting in a segmentation fault when trying to run them, the suspects are threading and C++ ABI incompatibility. Using the static binaries can be problematic as the libraries compiled into them are old and have bugs such as SDL using a low screen refresh rate with XFree 4.3 or newer.
Workarounds such as using LD_ASSUME_KERNEL and/or pre-loading a smpeg library compiled with an old GCC version only sometimes work and the movies may be blank or have to be disabled. In the future for glibc 2.4, LinuxThreads and the LD_ASSUME_KERNEL workaround are going away.
[edit] The Solution
The solution is to use an old version of glibc such as 2.2.5. However all the other libraries used by the game must also be compiled against an equally old (or older) version of glibc.
The libraries used by the Loki games have been compiled and provided by Swanson for others to run their old games too. Other than glibc 2.2.5 which was the last (security) release from Debian, all the libraries included in the tar are based on the current Gentoo ebuilds available at the time. Further details on library versions at bottom.
loki_compat_libs-1.2.tar.bz2 22 July 2006 2.5Mb GPG Sig
To use the old glibc libraries set the LD_LIBRARY_PATH environment variable to the directory where these libraries are located. This tells the dynamic linker/loader which directories to search for libraries first. The game is then run by prepending the game binary to run the game with the old ld-linux.so.2 dynamic linker/loader (as the one with glibc 2.3 does not include the GLIBC_2.2, GLIBC_2.2.1 or GLIBC_2.2.3 profiles used with glibc 2.2.5 for some reason).
If the old glibc libraries are not required but other old libraries are, set the LD_PRELOAD environment variable to these libraries. This tells the dynamic linker/loader which libraries to preload before it loads any other shared libraries the game binary might need.
[edit] The Games
Assuming the games are updated to the last available patch (installation and patching problems are not covered here) then to run them use the following instructions. The dynamic binaries are used where available.
[edit] Civilisation: Call To Power
Requires an old glibc so to run use the following command:
LD_LIBRARY_PATH=/path/Loki_Compat/ /path/Loki_Compat/ld-linux.so.2 /path/CivCTP/civctp.dynamic
A patch to enable execution of the 1.2a x86 update is here.
Seems to have problems playing videos. Playing a video will often crash the video player, and hence the game.
[edit] Descent 3
Compatible with new glibc using smpeg library created with old compiler but needs a capitalised symbolic link for the ppics.hog file to be created;
cd /path/Descent3 ln -s ppics.hog PPics.Hog
Then to run use the following command;
LD_PRELOAD=/path/Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/path/Loki_Compat/libsmpeg-0.4.so.0.1.3 /path/Descent3/descent3.dynamic
[edit] Heavy Metal: FAKK2
Compatible with newer glibc but requires an old zlib version. It is also recommended to use the pak4.pk3 file provided by Chunky Kibbles's to fix a crashing problem during the game.
cp pak4.pk3 /path/FAKK2/fakk/
Then to run use the following command;
LD_PRELOAD=/path/Loki_Compat/libz.so.1.1.4 /path/FAKK2/fakk2
[edit] Heretic II
# emerge heretic2
Wants to pull in dev-libs/glib-1.2.10-r5 which isn't practical for newer systems.
[edit] Heroes Of Might And Magic 3
Requires old libc, libsmpeg, and libsmjpeg, so to run use the following command:
LD_PRELOAD=/usr/local/lib/Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/local/lib/Loki_Compat/libsmpeg-0.4.so.0.1.3:/usr/local/lib/Loki_Compat/libsmjpeg-0.2.so.0 /opt/heroes3/heroes3.dynamic
[edit] Kohan: Immortal Sovereigns
Requires an old glibc so to run use the following command;
LD_LIBRARY_PATH=/path/Loki_Compat/ /path/Loki_Compat/ld-linux.so.2 /path/Kohan/kohan.dynamic
[edit] MindRover
No workarounds are required as it is compatible with newer glibc.
[edit] Myth 2: Soulblighter
Requires an old glibc but the movies must be disabled. They play but immediately after playing a segmentation fault occurs. If movies were installed, either rename or delete the cutscenes directory;
cd /patch/Myth2 mv cutscenes cutscenes.disabled
Then to run use the following command;
LD_LIBRARY_PATH=/path/Loki_Compat/ /path/Loki_Compat/ld-linux.so.2 /path/Myth2/myth2_x11.dynamic
[edit] Rune
On regular start it gave me a message
| Code: rune |
|
dirname: too few arguments |
Solution is
cd /usr/local/games/rune/
./rune
[edit] Shogo: Mobile Armor Division
No workarounds are required as it is compatible with newer glibc. However it may run too fast on modern computers. Add the following line to the ~/.hyperion/Shogo/autoexec.cfg configuration file.
| File: ~/.hyperion/Shogo/autoexec.cfg |
|
"MaxFPS" "30"
|
[edit] Sid Meier's Alpha Centauri
Requires old libc and smpeg, so to run use the following command:
LD_PRELOAD=/usr/local/lib/Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/local/lib/Loki_Compat/libsmpeg-0.4.so.0 /opt/smac/smac.dynamic
To run the Alien Crossfire expansion use the following command:
LD_PRELOAD=/usr/local/lib/Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/local/lib/Loki_Compat/libsmpeg-0.4.so.0 /opt/smac/smacx.dynamic
You may encounter the following error though:
| Code: |
X Error: BadMatch Request Major code 66 () Error Serial #533 Current Serial #536 |
If this happens, you'll see it as soon as your pod touches down on Planet at the beginning of the game. If that's the case, make sure that you don't have "Composite" enabled in your xorg.conf. Comment out the following if it's present:
| File: xorg.conf |
Section "Extensions" Option "Composite" "Enable" EndSection |
Taking out Composite will fix the "BadMatch" error. This implies that you won't be able to run SMAC while using Compiz/Beryl.
[edit] Sim City 3000
This game must be patched. But the patch (positively) must be patched before patch the game. Make a file containing:
49,52c49,52
< [ $sum1 -ne $CRCsum ] && {
< echo Error in checksums $sum1 $CRCsum
< exit 2;
< }
---
> #[ $sum1 -ne $CRCsum ] && {
> # echo Error in checksums $sum1 $CRCsum
> # exit 2;
> # }
118,121c118,121
< [ $sum1 -ne $CRCsum ] && {
< $echo Error in check sums $sum1 $CRCsum
< eval $finish; exit 2;
< }
---
> #[ $sum1 -ne $CRCsum ] && {
> # $echo Error in check sums $sum1 $CRCsum
> # eval $finish; exit 2;
> #}
140c140
< [ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res'
---
> [ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res' 0
We'll assume you named it sc3u-2.0a-x86.run.patch
# patch sc3u-2.0a-x86.run sc3u-2.0a-x86.run.patch # export _POSIX2_VERSION=199209 # ./sc3u-2.0a-x86.run
Simcity 3000 requires an old glibc so to run use the following command:
LD_LIBRARY_PATH=/path/Loki_Compat/ /path/Loki_Compat/ld-linux.so.2 /path/SimCity3000/sc3u.dynamic -intro:off
Note that intro is turned off. If you enable it, you'll probably have problems.
If you get an error like: Inconsistency detected by ld.so: dynamic-link.h: 62: elf_get_dynamic_info: Assertion `! "bad dynamic tag"' failed!
Then use the loki compat files from: http://www.linuxrising.org/files/lokicompat.tar.bz2
[edit] Sin
Compatible with newer glibc using smpeg library created with old compiler but needs an old SDL library name in system. Create a symbolic link in the system from the old name to the new name;
cd /usr/lib ln -s libSDL-1.2.so libSDL-1.1.so
Then change to your SiN install directory and use the following command;
LD_PRELOAD=/path/Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/path/Loki_Compat/libsmpeg-0.4.so.0.1.3 /path/SiN/sin.exe
[edit] Soldier Of Fortune
No workarounds are required as it is compatible with newer glibc.
[edit] Unreal Tournament
No workarounds are required as it is compatible with newer glibc. However do ensure it uses the newer system SDL library. First either rename or delete the old library installed with the game; No workarounds are required as it is compatible with glibc 2.3. However update it to use the newer system SDL library. First move the old library out of the way;
cd /path/UnrealTournament/System mv libSDL-1.1.so.0 libSDL-1.1.so.0.orig
Then create a symbolic link in the system from the old name to the new name; Then either create a link from the game directory to the system SDL library;
cd /usr/lib ln -s libSDL-1.2.so.0 libSDL-1.1.so.0
[edit] Other Games
For any other Loki games, post the output of running scanelf -Rnq /path/game in the game directory or the ldd command on the games binaries to Talk:HOWTO_Running_Old_Loki_Games to verify what additional libraries they may need. I'll compile the required libraries and add the instructions here.
If any game exits with an X Error of failed request: BadMatch (invalid parameter attributes) for Major opcode of failed request: 142 (XVideo) then disable hardware YUV acceleration by prepending the following to the command that runs the game;
SDL_VIDEO_YUV_HWACCEL=0
[edit] The Libraries
The libraries included were built in a chrooted Debian 3.0 Woody using GCC 2.95.4 with CFLAGS "-O2 -march=i686" as upgrading from Gentoo 1.2, which has glibc 2.2.5 and gcc 2.95.3, to the current portage is decidedly non-trivial.
GLIBC 2.2.5 libc-2.2.5.so ... ...
From the last Debian Woody 3.0 glibc (security) release which was libc6_2.2.5-11.8_i386.deb. Only the files in the /lib directory were required.
ZLIB 1.1.4 libz.so.1.1.4
From the last Debian Woody 3.0 zlib release which was zlib1g_1.1.4-1.0woody0_i386.deb.
XORG 6.8.2 libX11.so.6.2 libXext.so.6.4 libGL.so.1.2 libXrandr.so.2.0 libXrender.so.1.2.2
Based on the Gentoo xorg-x11-6.8.2-r4 ebuild and patches.
ALSA 1.0.11 libasound.so.2.0.0
Based on the Gentoo alsa-lib-1.0.11 ebuild.
SDL 1.2.11 libSDL-1.2.so.0.11.0
Based on the Gentoo libsdl-1.2.11 ebuild and patches but without esd or arts support.
SMPEG 0.4.4 libsmpeg-0.4.so.0.1.3
Based on the Gentoo smpeg-0.4.4-r7 ebuild and patches.
SMJPEG 0.2.1 libsmjpeg-0.2.so.0.0.1
Based on the Gentoo smjpeg-0.2.1-r2 ebuild and patches.
SDL-MIXER 1.2.7 libSDL_mixer-1.2.so.0.2.5
Based on the Gentoo sdl-mixer-1.2.7 ebuild but without ogg support.
SDL-TTF 2.0.8 libSDL_ttf-2.0.so.0.6.2
Based on the Gentoo sdl-ttf-2.0.8 ebuild.
FREETYPE 1.3.1 libttf.so.2.2.0
Based on the Gentoo freetype-1.3.1-r4 ebuild.
FREETYPE 2.1.10 libfreetype.so.6.3.8
Based on the Gentoo freetype-2.1.10-r2 ebuild and patches but without the security patches as they caused text to disappear with SMAC.
OPENAL 0.0 libopenal-0.0.so
Taken from Unreal Tournament patched to 436. Although the OpenAL CVS was tagged for 0.0 prior to 1.0 I do not know if it is stable. The libopenal-0.0.so included with patch 1.06a for Soldier Of Fortune may possibly be newer with a fix for small wav files but the Unreal Tournament one works for my games.
[edit] Links
Other than various information found on forums via Google and general browsing;
Linux Gamers FAQ
Old Loki Games Under New(ish) Linux
Kohan: Immortal Sovereigns on Newer Linux Distributions
Gentoo Bug 71044 Not used
Gentoo Ebuild sys-libs/lib-compat-loki Not used
