Question about compiler optimization in Linux

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Hello all. For a long time, I've been meaning to install Linux From Scratch on this box. The only thing that's been keeping me from doing it is that I plan to replace my P3 stuff with a dual Athlon XP setup as soon as I get some cash, and I also intend to build LFS with really agressive optimizations.

My question is, if I compile stuff with really aggressive optimizations (-O6 and up with a bunch of other flags) on my current setup, will it break when I replace the mobo and CPU?
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Well, if you're compiling with gcc 2.95, then the P3 and the dual XP's would use the same architecture specific optimizations (i686). So it seems like things might just work. But I'd sure as heck take a backup before I started...
 

marat

Senior member
Aug 2, 2001
207
0
0
Bad:
Kernel that you compiled for P3 will work with dual athlon just fine, but you won't be able to take advantage of second processor (you have to compile SMP support to use both CPU).
If you compile kernel with extensive optimization for P3 - it will work with Athlon, but will be optimized for P3.

Good:
You can recompile kernel later and add SMP support and extra optimization. You can have an option during boot time which kernel to load. So - no loss for you.
 

Tiger

Platinum Member
Oct 9, 1999
2,312
0
0
If he's optimizing as agressively as he says he is won't it break simply because of the different chipsets on the mobo's?
 

StuckMojo

Golden Member
Oct 28, 1999
1,069
1
76

you can optimize your kernel for athlon, but everything else will be 686
you can intall now and rebuild the kernel for smp + athlon once you get the new rig
 

marat

Senior member
Aug 2, 2001
207
0
0


<< If he's optimizing as agressively as he says he is won't it break simply because of the different chipsets on the mobo's? >>



Chipset will not affect that. Linux should find changes in computer configuration during boot and load appropiate chipset driver.