Author Topic: Multiple Versions Of Gcc  (Read 16182 times)

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« on: December 06, 2004, 02:17:47 pm »
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
« Last Edit: December 06, 2004, 02:19:03 pm by Greg2 »

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Multiple Versions Of Gcc
« Reply #1 on: December 07, 2004, 07:30:25 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.

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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #2 on: December 07, 2004, 10:19:13 am »
Quote
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.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Multiple Versions Of Gcc
« Reply #3 on: December 07, 2004, 12:16:51 pm »
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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #4 on: December 07, 2004, 08:15:42 pm »
Quote
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

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Multiple Versions Of Gcc
« Reply #5 on: December 08, 2004, 05:02:10 am »
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  
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Multiple Versions Of Gcc
« Reply #6 on: December 08, 2004, 09:02:12 am »
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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #7 on: December 08, 2004, 10:20:40 am »
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.  

Thanks

Greg

Ashitaka

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Multiple Versions Of Gcc
« Reply #8 on: December 09, 2004, 02:19:51 am »
My package is based on the OZ 2.95 toolchain (iirc  ), 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.
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #9 on: December 09, 2004, 02:34:21 pm »
Ashitaka,
Thanks for making this available, but I think there's a problem.
Approximately 45 min. into the install I have this:
-snip-
Code: [Select]
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

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Multiple Versions Of Gcc
« Reply #10 on: December 10, 2004, 03:30:25 am »
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 ?
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #11 on: December 10, 2004, 09:41:40 am »
Quote
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

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Multiple Versions Of Gcc
« Reply #12 on: December 11, 2004, 12:22:10 am »
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...
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Multiple Versions Of Gcc
« Reply #13 on: December 12, 2004, 10:52:17 am »
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: [Select]
-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: [Select]
-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
« Last Edit: December 12, 2004, 10:54:45 am by Greg2 »

Ashitaka

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Multiple Versions Of Gcc
« Reply #14 on: December 12, 2004, 09:06:23 pm »
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.
« Last Edit: December 12, 2004, 09:07:35 pm by Ashitaka »
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html