You are not logged in.

#1 2006-02-04 00:34:12

Fatih
Member
From: Ankara-Türkiye
Registered: 2005-12-17
Posts: 67
Website

Howto: Parallel GCC using(4.0 and 3.4 at the same time)

I try to explain, how you can use parallel Gcc.
Gcc 4.0 and 3.4.

It is good, when you must compile a package with 3.4, but you have 4.0

At first  download from :http://gcc.gnu.org/mirrors.html the latest 3.4 gcc-core.tar.bz2 

Open it in /usr/lib/gcc/i686-pc-linux-gnu/

tar xjf gcc-core-3.4.3.tar.bz2 -C /usr/lib/gcc/i686-pc-linux-gnu/

and then

cd /usr/lib/gcc/i686-pc-linux-gnu/ 

Make a new directory which is called gcc-build

mkdir gcc-build

Go to the dir:

cd gcc-build

And do

sh /usr/lib/gcc/i686-pc-linux-gnu/gcc-3.4.3/configure

After that make the bootstrap

make bootstrap

And last, install it

make install

We have now, only a little things to do.

cd /usr/local/bin/
ln -s cpp g++
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++

Ok That's all. When you want compile a package with Gcc 3.4, you have to   put these two sentences in the PKGBUILD.

CC=/usr/local/bin/gcc
CXX=/usr/local/bin/g++

You must put it after this word

build() {

I have tried it with Trickle, and it works. I use Gcc 4. But compile Trickle with 3.4.

This Howto is good, for everyone who want to use 4.0 and 3.4 at the same time. You haven't to do downgrade your actually system, to 3.4 and then later retry upgrade to 4.0

My English isn't perfect. If I have mistakes, let me know it smile

Offline

#2 2006-02-04 01:06:53

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

CC=/usr/local/bin/gcc 
 CXX=/usr/local/bin/g++

AFAIK, the standard place to put these is /etc/makepkg.conf, not in a PKGBUILD.

iphitus

Offline

#3 2006-02-04 01:28:48

Fatih
Member
From: Ankara-Türkiye
Registered: 2005-12-17
Posts: 67
Website

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

The standart is Gcc 4.0. Only when you want to use Gcc 3.4, then you put the sentences in PKGBUILD.

What happen when I put these sentences in makepkg.conf,and I compile it makepkg? Compile it with 3.4 or 4.0?

Offline

#4 2006-02-04 01:35:32

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

If you put those in /etc/makepkg.conf, it will compile with 3.4.

The idea is you comment/uncomment them when you need 3.4 or 4.

Its best not to put them in a PKGBUILD, as if you share that pkgbuild, you are giving them your setup, which won't work in most peoples cases.

iphitus

Offline

#5 2006-02-04 01:46:28

Fatih
Member
From: Ankara-Türkiye
Registered: 2005-12-17
Posts: 67
Website

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

Thanks for your information.

I write this Howto, because a lot of people have problem, that the old Gcc conflicts with the newer version. For example:

http://bbs.archlinux.org/viewtopic.php?t=17221


But in fact, you have right with the PKGBUILD. These is only good, if somebody has conflicts with some paket, and he need a older version GCC.

Offline

#6 2006-02-04 16:43:20

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

The instructions you give look fairly simple.
Maybe they could be used to make a package ?

To avoid conflicts with the gcc from current, it could have a name like oldgcc-3.4


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2006-02-05 06:01:48

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

In my opinion, supporting old gcc is the wrong way to go.  If software doesn't compile under gcc4, then that software is broken.  Supporting gcc3.4 just to compile crappy software is exactly the same as IE supporting broken HTML and thus causing the state of things in the web-design world.

Offline

#8 2006-02-22 08:29:11

solskogen
Member
From: Norway
Registered: 2005-03-06
Posts: 121

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

phrakture wrote:

In my opinion, supporting old gcc is the wrong way to go.  If software doesn't compile under gcc4, then that software is broken.  Supporting gcc3.4 just to compile crappy software is exactly the same as IE supporting broken HTML and thus causing the state of things in the web-design world.

I see your point, but I think you are wrong. Gcc could also be broken.
Take a look at qemu for example.

Offline

#9 2006-02-22 08:31:55

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

How is GCC broken? If Qemu doesnt work with GCC4, then *Qemu* is broken.

iphitus

Offline

#10 2006-02-24 12:13:48

solskogen
Member
From: Norway
Registered: 2005-03-06
Posts: 121

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

Whats makes you think gcc is perfect?

Offline

#11 2006-02-24 20:20:18

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

iphitus wrote:

How is GCC broken? If Qemu doesnt work with GCC4, then *Qemu* is broken.

iphitus

Whats makes you think gcc is perfect?

...not sure where I ever said that.

Offline

#12 2006-02-26 16:29:46

solskogen
Member
From: Norway
Registered: 2005-03-06
Posts: 121

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

iphitus wrote:
iphitus wrote:

How is GCC broken? If Qemu doesnt work with GCC4, then *Qemu* is broken.

iphitus

Whats makes you think gcc is perfect?

...not sure where I ever said that.

Heh, you never did smile
My point is if applications dont work with gcc in archlinux (since we only got one version), we should consider having to versions installable.
Some commercial applications wont work without having a "old" gcc, when they only deploy binaries.

Offline

#13 2006-02-27 07:45:58

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Howto: Parallel GCC using(4.0 and 3.4 at the same time)

There hasnt really ever been a demand or need...... and obviously Arch users havnt been using those commercial apps wink

Offline

Board footer

Powered by FluxBB