Stefano Chiappa <stefanoc@xxxxxxxxxxxxx> writes:
I have 3 Linux machines with the following processors (I collected the
dato about procs by /proc/cpuinfo):
1) P4 HT (cpu family=15,model=4,stepping=1)
2) Athlon (cpu family=15,model=4,stepping=10)
3) Xeon (P4) quad core 64bit (cpu family=15,model=6,stepping=4).
I'd like to produce, with gcc4.1.1 a different executable for each, by
using the apt compiler/options (march). I'd like to generate all
executables on machine 1, then I compiled gcc without specifying any
target, and I believe gcc choosen i?86 as described in the gcc manual.
Now I'd like to generate code for 2) and 3), I suppose I have to
compile gcc in order to have a cross-compiler, in this case for target
ia64-linux. Is it correct?
Not correct at all. IA64 is a totally different processor; none of
your machines have it.
You may need to build 'gcc' for x86_64-linux iff you are running
64-bit kernel on machine 3.
Then if I want to specify the specific cpu while compiling my program
(using the -march= option), I think I should use for 1 and 3:
march=pentium4, for 2: march=athlon. It is correct?
Just use the 'gcc' you already have. To determine the best -march=
setting for each, look at the processor features ('grep flags /proc/cpuinfo')
and match them with 'info gcc' -> Invoking -> Submodel -> i386 and x86_64.
For machine 3, -march=nocona will probably be best.
Cheers,