Pafnoutios
04-25-2004, 08:16 PM
If you own a copy of 'Civilization: Call To Power' that is now causing Segmentation Faults when you try to start a game, it is because CivCTP was compiled for glibc-2.1, and most modern systems use glibc-2.3, which are binary incompatible. I've gotten my copy working on my gentoo system. Generally speaking, you must install an additional glibc library, without overwriting your current library, and get CivCTP to use the auxiliary glibc.
This isn't so easy, though, since glibc-2.1.3 doesn't seem to want to compile with gcc-3.0 or later.
First, create /opt/usr/local.
mkdir /opt/usr
mkdir /opt/usr/local
Also, download gcc-2.95.3 (ftp://ftp.gnu.org/pub/gnu/gcc/gcc-2.95.3.tar.gz) and glibc-2.1.3 (ftp://ftp.gnu.org/gnu/glibc/glibc-2.1.3.tar.gz) from ftp.gnu.org.
Extract the archives in your favorite compiling directory (i.e. /usr/src)
<edit>
Before you install gcc, you need to fix a syntax misunderstanding between this older code and your newer gcc compiler that is trying to compile it. Open up ./gcc/ch/loop.c and go to lines 321 and 322 and delete the quotation mark that appears on each of those lines.
</edit>
Install gcc-2.95.3 into /opt/usr/local:
./configure --prefix=/opt/usr/local --exec-prefix=/opt/usr/local
make && make install
While gcc is compiling, download the glibc-linuxthreads-2.1.3 (ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.1.3.tar.gz) and glibc-crypt-2.1 (ftp://ftp.gnu.org/gnu/glibc/glibc-crypt-2.1.tar.gz) add-ons and put them into your glibc-2.1.3 working directory (i.e. /usr/src/glibc-2.1.3) and extract them there.
After gcc is compiled and installed into /opt/usr/local, add /opt/usr/local/bin to the beginning of your PATH:
export PATH=/opt/usr/local/bin:$PATH
This will only last during your current shell session.
Now, install glibc into /opt/usr/local:
./configure --prefix=/opt/usr/local --exec-prefix=/opt/usr/local --enable-add-ons
make && make install
If configure complains about no linuxthreads or crypt add-ons, then you didn't extract them properly. The .tar.gz archives should be placed into your glibc-2.1.3 directory that was extracted from glibc-2.1.3.tar.gz and extracted directly into there.
You should now have a /opt/usr/local/lib directory somewhat resembling a /lib directory, it will have the entire glibc library in it. I had some sort of error during the make install of glibc, but I ignored it since everything I wanted seems to be working and the directory looked full to me.
All the necessary glibc library files will be there, but most programs look for the libraries by their libc6 names, so we must create the same symlinks that can be seen in /lib.
cd /opt/usr/local/lib
ln -s libc-2.1.3.so libc.so.6
ln -s ld-2.1.3.so ld-linux.so.2
Now make a script in one of your bin directories, included in your PATH, that will execute the /usr/local/games/CivCTP/civctp program. It should have two lines:
export LD_LIBRARY_PATH=/opt/usr/local/lib:$LD_LIBRARY_PATH
/usr/local/games/CivCTP/civctp
I named my script civCTP. This will start civctp so that it looks in /opt/usr/local/lib for it's needed library files instead of /lib, which is the default.
Don't forget to set the script's executable bits:
chmod 755 civCTP
You should now be able to run the game from any directory by executing civCTP at a prompt. You can also add civCTP to your KDE or Gnome menu, and there is an icon file in /usr/local/games/CivCTP you can use.
This isn't so easy, though, since glibc-2.1.3 doesn't seem to want to compile with gcc-3.0 or later.
First, create /opt/usr/local.
mkdir /opt/usr
mkdir /opt/usr/local
Also, download gcc-2.95.3 (ftp://ftp.gnu.org/pub/gnu/gcc/gcc-2.95.3.tar.gz) and glibc-2.1.3 (ftp://ftp.gnu.org/gnu/glibc/glibc-2.1.3.tar.gz) from ftp.gnu.org.
Extract the archives in your favorite compiling directory (i.e. /usr/src)
<edit>
Before you install gcc, you need to fix a syntax misunderstanding between this older code and your newer gcc compiler that is trying to compile it. Open up ./gcc/ch/loop.c and go to lines 321 and 322 and delete the quotation mark that appears on each of those lines.
</edit>
Install gcc-2.95.3 into /opt/usr/local:
./configure --prefix=/opt/usr/local --exec-prefix=/opt/usr/local
make && make install
While gcc is compiling, download the glibc-linuxthreads-2.1.3 (ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.1.3.tar.gz) and glibc-crypt-2.1 (ftp://ftp.gnu.org/gnu/glibc/glibc-crypt-2.1.tar.gz) add-ons and put them into your glibc-2.1.3 working directory (i.e. /usr/src/glibc-2.1.3) and extract them there.
After gcc is compiled and installed into /opt/usr/local, add /opt/usr/local/bin to the beginning of your PATH:
export PATH=/opt/usr/local/bin:$PATH
This will only last during your current shell session.
Now, install glibc into /opt/usr/local:
./configure --prefix=/opt/usr/local --exec-prefix=/opt/usr/local --enable-add-ons
make && make install
If configure complains about no linuxthreads or crypt add-ons, then you didn't extract them properly. The .tar.gz archives should be placed into your glibc-2.1.3 directory that was extracted from glibc-2.1.3.tar.gz and extracted directly into there.
You should now have a /opt/usr/local/lib directory somewhat resembling a /lib directory, it will have the entire glibc library in it. I had some sort of error during the make install of glibc, but I ignored it since everything I wanted seems to be working and the directory looked full to me.
All the necessary glibc library files will be there, but most programs look for the libraries by their libc6 names, so we must create the same symlinks that can be seen in /lib.
cd /opt/usr/local/lib
ln -s libc-2.1.3.so libc.so.6
ln -s ld-2.1.3.so ld-linux.so.2
Now make a script in one of your bin directories, included in your PATH, that will execute the /usr/local/games/CivCTP/civctp program. It should have two lines:
export LD_LIBRARY_PATH=/opt/usr/local/lib:$LD_LIBRARY_PATH
/usr/local/games/CivCTP/civctp
I named my script civCTP. This will start civctp so that it looks in /opt/usr/local/lib for it's needed library files instead of /lib, which is the default.
Don't forget to set the script's executable bits:
chmod 755 civCTP
You should now be able to run the game from any directory by executing civCTP at a prompt. You can also add civCTP to your KDE or Gnome menu, and there is an icon file in /usr/local/games/CivCTP you can use.