Help - Search - Members - Calendar
Full Version: Multiple Versions Of Gcc
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > OpenZaurus/Opie/Qtopia
Greg2
From the Zug How-to's
QUOTE
Note that many of the newer distributions now use GCC3.2 or later as their default compiler. This means that when compiling for the desktop it will not be able to link to the sdk files as they were created using GCC 2.95. To fix this problem you need to install 2.95 for your distribution.


Does anyone have, or know of a simple how-to for installing and using multiple versions of gcc on a linux box? I was looking at graft... but there must be an easier way?

I have a little extra time during the Holidays and would like to try some things without damaging my current setup.

Greg
lardman
Talking about cross-compilers? They should end up in seperate directories anyway so it should be fine, then just source a script to alter $PATH accordingly.

That said, if you're talking about OZ, download and use OE - it sorts out the GCC 3.x.x toolchain for you (the 2.95 toolchain is only needed to compile kernels)

Si
Greg2
QUOTE(lardman @ Dec 7 2004, 07:30 AM)
Talking about cross-compilers? They should end up in seperate directories anyway so it should be fine, then just source a script to alter $PATH accordingly.

Yes, cross-compilers.

I have gcc3.3.1 on my Mandrake9.2 and would like to use the gcc2.9.5 for the Zaurus kernel and some apps. I need to keep the 3.3.1 intact but I'm not sure how to go about it. I have searched this for 2 days on other forums and google only to become more frustrated and confused then when I started. Can I do this with rpms, or do I have to compile the gcc2.9.5 on my present system to rename it and call it (e.g. gcc or gcc2) to compile?

Thanks, and please note I have only recently been compiling anything on my box.

Greg

P.S. In early spring I will finally have access to affordable 'high speed' internet, then I will set up OE. smile.gif
lardman
They should install in seperate locations, then you'll just have to alter your $PATH to use one or the other.

If you need to use both (in the same script/Makefile/etc/), then yes, you need to rename one to gcc-2.95 etc.


Si
Greg2
QUOTE(lardman @ Dec 7 2004, 12:16 PM)
They should install in seperate locations, then you'll just have to alter your $PATH to use one or the other.

I must be simple minded because I can't make the rpms install in different locations and coexist on my system. Not with the package manager or any rpm command that I know of would make this work properly. If anyone reads this and knows of a way... please let me know.

Anyway, I have d/led the gcc2.9.5 tarball and will compile and install tomorrow. That is the only way I know of to rename and install where I want it.

Thanks lardman

Greg
Ashitaka
You can download on http://www.nautilus6.org/operation/zaurus.html my package which will install automatically a complete GCC 2.95 cross-compile environment (which naturally doesn't interfere with your current configuration). Enjoy wink.gif
lardman
The OZ 2.95 toolchain is a tarball which you extract to /usr/local/arm/2.95 (iirc).

It was available from oz.org


Si
Greg2
I can't find that oz 2.95 toolchain anywhere... it's probably gone now with the new OE and oe.org and hh.org are still not available to look for it.

Ashitaka, I will give your cross-compile package a try when I complete the d/l... which will be awhile on my dail-up connection. smile.gif

Thanks

Greg
Ashitaka
My package is based on the OZ 2.95 toolchain (iirc tongue.gif ), but it has additional documentation, relatively smart installation scripts, and that it also installs several libraries which you will probably need if you try compiling something for the Zaurus.
Greg2
Ashitaka,
Thanks for making this available, but I think there's a problem.
Approximately 45 min. into the install I have this:
-snip-
CODE
global1.cpp:39:23: uuid/uuid.h: No such file or directory
global1.cpp: In static member function `static QUuid Global::generateUuid()':
global1.cpp:188: error: `::uuid_generate' undeclared (first use here)
make[1]: *** [.obj/linux-generic-g++//global1.o] Error 1
make[1]: Leaving directory `/opt/Qtopia/src/libraries/qtopia1'
make: *** [libraries/qtopia1] Error 2
Problem while compiling Qtopia!
[root@localhost cross_install-2.95]#


everything seems to be installed correctly in /usr/local/arm/2.95.3/

but I'm not sure about /opt/Qtopia/

any thoughts?

Greg
Ashitaka
Hum strange I have this line in my script :

cp $PACKAGE_DIR/uuid.h $CROSS_PREFIX/arm-linux/include/uuid

Can you check if /usr/loca/arm/2.95.3/arm-linux/include/uuid/uuid.h exists ?
Greg2
QUOTE(Ashitaka @ Dec 10 2004, 03:30 AM)
Can you check if /usr/loca/arm/2.95.3/arm-linux/include/uuid/uuid.h exists ?

It doesn't exist. If I create the directory and place uuid.h in it could you show me how to modify your script (or, maybe you modify?) to start at

echo “Installing Qtopia...”

That would fix it... I think.

Thanks

Greg
Ashitaka
Just start it from the beginning (it will be a little longer of course).
But that is really a strange problem, the script should stop with an error if some file cannot be copied, I need to check this today...
Greg2
Ashitaka,
I ran your script again, now I have the directory in place as per your last post. I'm not completely sure it wasn't there the first time?... I've been working on this too late at night... my head hurts! Anyway, it's the same output as before.

Here's what I've found:

Your script
CODE
-snip-
    mkdir -p $CROSS_PREFIX/arm-linux/include/uuid && \
    cp $PACKAGE_DIR/uuid.h $CROSS_PREFIX/arm-linux/include/uuid && \
-snip-

makes this directory:
/usr/local/arm/2.95.3/arm-linux/include/uuid/uuid.h

Then your script
CODE
-snip-
    cd Qtopia
    export QTDIR=/opt/QtEmbedded
    export QPEDIR=$PWD
    export PATH=$PWD/bin:$PATH

    cd src && \
    ./configure && \
    make
-snip-

Starts to compile Qtopia and fails with the output in my previous post.

I'm sorry I can't help you more, but it's just been recently I've found the time to research and try to learn this. If there's anything else you would like me to check, let me know? If you don't have the time to do this right now, don't worry about it but let me know? I have found and learned to use a little tool that was already on my system... rpm2cpio. With this I can place the rpm files where I want, then use the Zug's how-tos for compiler-setup.

Thanks

Greg
Ashitaka
Sorry I did not answer earlier. I realized where the problem was coming from just after turning off my computer and going to bed... From the readme of my package :

QUOTE
  2.a/ Requirements
  -----------------
First, MAKE SURE you have all this:
  - X11, uuid, libjpeg and zlib development files

The problem is not when cross-compiling Qtopia, but when simply compiling Qtopia with your local system to be able to run on the Zaurus emulator.
Greg2
QUOTE(Ashitaka @ Dec 12 2004, 09:06 PM)
The problem is not when cross-compiling Qtopia, but when simply compiling Qtopia with your local system to be able to run on the Zaurus emulator.

OK...I'm starting to see things more clearly now. I'm going to move forward and use qtopia-free-1.7 for my setup over the holidays, the Zug has a lot of info on the use of this. I can see there's still much to learn, but I have a good start now.

Thanks for helping out.

Greg
sms_james
The listed below are the basic steps and you would be done.. to read the complete article you can visit http://www.tarunworld.com/index.php?option...id=26&Itemid=36

1. Copy the bz2 file to a director say /usr/src.
2. Make a dir say named gcc 3.5 in /usr/src.
3. Untar the contents of the zip file in this directory.
4. go to the directory gcc 3.5 as cd gcc3.5
5. on shell give the command as /usr/src/gcc3.5/configure --prefix=/opt/gcc
6. on shell run make bootstrap.
7. on shell run make install(do it as root).
8. The gcc would be compiled 3 times and you might have to wait a while.
9. After the process is completed on shell run export PATH=/opt/gcc/bin:$PATH.
10. This command appends the gcc path to the environment path variable.
11. Now check gcc --v and you would get version as 3.5.

Regards
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.