Hi all, i just managed for the first time to compile the proper gcc version (4.1.2) for maya on ubuntu.
I’ll try to be as clear as possible but if any problem occurs feel free to write a comment! I obvioulsy expect that the questions are quite techincal and i also expect that you know at least how to move on linux.
First of all you ave to download the proper gcc version from . I choosed the tar.gz version and my guide refers to that one.
Create a folder where to build the gcc version
Extract the downloaded gcc release to that folder
tar -C ~/gcc412/ -xzvf /path/to/the/file/gcc-4.1.2.tar.gz
Make a build folder:
At this stage we should be ready to build but first we need to be sure that we’ve got all the dependencies needed to compile. We need the linux-headers gcc-multilib, zlib1g, zlib1g-dev, zlibc
sudo apt-get install linux-headers-$(uname -r) gcc-multilib zlib1g zlib1g-dev zlibc
Then we need also to fix some file in the gcc folder.
First of all you need to edit the file ~/gcc412/gcc-4.1.2/gcc/config/i386/t-linux64.
At line 9 you should find:
MULTILIB_OSDIRNAMES = ../lib64 ../lib
You need to modify it as follows:
MULTILIB_OSDIRNAMES = ../lib64 ../lib32
Open the file ~/gcc412/gcc-4.1.2/libstdc++-v3/configure and at line 8284 replace:
sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
sed -e 's/GNU ld (GNU Binutils for Ubuntu) \([0-9.][0-9.]*\).*/\1/'`
Than we need to edit another file (Thanks Karl!!). Open the file ~/gcc412/gcc-4.1.2/gcc/config/i386/linux-unwind.h:
Line 139: from: struct siginfo *pinfo; to: siginfo_t *pinfo; Line 141: from: struct siginfo info; to: siginfo_t info;
Another thing to do is to link some library otherwise the compiler won’t find it.
cd /usr/lib sudo ln -s x86_64-linux-gnu/crt1.o crt1.o sudo ln -s x86_64-linux-gnu/crti.o crti.o sudo ln -s x86_64-linux-gnu/crtn.o crtn.o
At this point we are ready to compile gcc.
Go in the build folder:
run the configure as autodesk suggests:
../gcc-4.1.2/configure --prefix=/opt/gcc412 --program-suffix=412 --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-languages=c,c++
and then compile it:
make -j 2 bootstrap MAKEINFO=makeinfo
As soon as the compiling process ends without throwing errors you will be able to run:
sudo make install
Then we may decide to link it:
sudo ln -s /opt/gcc412/bin/gcc412 /usr/bin/gcc412