pinnockio Apprentice
Joined: 08 Jun 2002 Posts: 162
|
Posted: Wed May 14, 2003 6:54 pm Post subject: SOLUTION: GCC-2.95.3 and GCC-3.2.2 together with GCC-CONFIG |
|
|
Hello,
I ran in a lot of trouble trying to use gcc-config in order to switch between gcc-2.95.3 and gcc-3.2.2. Obviously, gcc-config has been written for use with gcc-3.2.2 and actually is nowhere documented (at least I did not found any direction how to create my own profile etc.).
I have build my gentoo-system from stage3, so the installed compiler is i586-pc-linux-gnu-3.2.2. Some time ago I thought emerging gcc-2.95.3 would install this compiler next to the 3.2.2 and switching between them would be made easy by gcc-config. Uhu,... . Attempting to create my own profile, and switching to it resulted in an libstdc++.so.5 error and everything that depends on it was broken (ie. python, thus emerge, thus almost everything on your system).
Although libstdc++.so.5 is there, the system can't find it. When you are in this situation you can get out of it like this:
- edit your /ect/ld.so.conf
- add /usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2 (or wherever you the libstdc is located)
- and execute ldconfig
Now the library can be found again and at least you can switch back to gcc3.2.2 using gcc-config (and just copy /etc/env.d/i586-pc-linux-3.2.2 to /etc/gcc and set CURRENT in /etc/env.d/config back to i586-pc-linux-gnu-3.2.2)
I still needed both of the compilers for CS-programming, so after some time (and since then a fresh stage3 gentoo installation). I downloaded the 2.95.3 compiler from http://www.gnu.org and installed it with the "--enable-version-specific-runtime-libs" enabled (I tought this was a good thing to do because of naming the version specific libraries that are created) and made a default installation (see the documention in the install directory of the downloaded package for more details).
This is how my profile i686-pc-linux-gnu-2.95.3 (the name IS inportant!) in /etc/env.d looks like:
PATH="/usr/local/bin"
ROOTPATH="/usr/local/bin"
LDPATH="/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2" (YES, because that is the directory where libstdc++ is installed )
MANPATH="/usr/local/man/man1"
INFOPATH="/usr/local/info"
CC="gcc"
CXX="g++"
Note that I could have put a symbolic link in /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3 to libstdc++, but I haven't run into any troubles so far doing it the way described above.
Because gcc-config tries to match the profile name against the installed versions in /usr/lib/gcc-lib, I had to make a symbolic link into that directory (ln -s /usr/local/lib/gcc-lib/i686-pc-linux-gnu i686-pc-linux-gnu (important: OMIT 2.95.3!)).
Now switching between profiles using gcc-config works fine. The only thing that I have to keep in mind is to change the CXXFLAGS an CFLAGS (they are set for Athlon-tbird optimizations) in /etc/make.conf whenever I do an emerge.
I think it is a shame that there is no documentation whatever concerning gcc-config,its profiles and the different compilers (or I must have overlooked it), because somebody really can fuck up his whole system and think the only solution is messing around with the gentoo source cd's or make a fresh install. And a lot of students rely for programming courses on the more stable 2.95.3 compiler,... .
Kind regards,
A belgian Gentoo user |
|