Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Two gcc compilers on the same machine - how? Help needed!

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
drasko
Posts: 5
Joined: 2005-01-17 12:46

Two gcc compilers on the same machine - how? Help needed!

#1 Post by drasko »

I would like to know how to put two (or more) gcc version on the same debian system. I have to compile 2.4.18 kernel because i want to aply LinSec patch on it, and the new (3.3) gcc wont compile it! How to have more older versions of gcc on the same Debian and switch between them when needed?

Thanks,
Drasko

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#2 Post by lacek »

First, the new gcc _should_ compile that kernel. What are the error codes you get? Are you sure you got errors because of the compiler?

Anyway, if you want to install an older gcc, install the 'gcc-2.95' package, and export the CC variable to 'gcc-2.95' before make.

drasko
Posts: 5
Joined: 2005-01-17 12:46

#3 Post by drasko »

I read somewhere that I should do it with "CC=gcc-2.95 make bzImage", which will automaticly use needed CC variable just for thi one make. But I'm not shure what is CC variable yet. Can you tell me more about that? Right now, when I write command "ech $CC", I get nothing, and I am using gcc-3.3. Why is it now empty?

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#4 Post by lacek »

The value of CC --if empty-- is set automatically by make. That's why you don't see it. You can create a dummy Makefile to find it out, but if CC is not set, make will use the newest C compiler (more specifically, /etc/alternatives/cc, I think). Anyway, here is the Makefile:

Code: Select all

all:
        $(CC) --version
Note that there is a TAB before $(CC), not 8 spaces.

However, despite all of this, I seriously doubt that your kernel fails to compile because of the c compiler version. If it is the case (which, again, is unlikely), you should get a newer kernel tree, because you should compile your kernel AND the modules with the same version of gcc, or else it won't work. I mean, if you manage to compile your kernel, you won't be able to compile ant kernel modules for 3rd-party programs, which is probably not what you want.
If you don't want to get a newer kernel and it fails to compile because of the compiler, you should remove gcc v3, to avoid bothersome surprises in the future.

However, it would be good to see how your kernel fails to compile. I still cling to my belief that it isn't vecause of the compiler... :-)

drasko
Posts: 5
Joined: 2005-01-17 12:46

#5 Post by drasko »

Thanks for the answers... It was the compiler, all rigt.
I relinke soft link gcc to gcc-2.95, and kernel 2.4.28 compiled without errors (with the adequate modules, offcourse).

I really need this kernel version because I am trying to work on a project called LinSec (www.lisec.org), which is a bit out of date, and the latest kernel patch is for 2.4.18 kernel...

In my everyday life I use Sarge with 2.6.9 kernel, as every normal human beeing :)

So, I suceeded installing this kernel, an booting the systm in it, even making my broadcom bcm4400 car work, ang so goes for Gnome 2.8.

Problem solved for now...

Thanks once again, you have been very helpfull.
Drasko

Post Reply