Default RPM build ops in released packages
I was noticing that the default compiler options on my 9.3 based distro when I remake a source _appear_ to be: -O2 -g -march=i586 -mcpu=i686 Are these the options used to build the SuSE binary RPMs (for the i586 arch)? When did the "-mcpu=i686" get added for standard i586 binaries? For the few packages that are compiled i686, glib, db and db4, are the default options changed to: -O2 -g -march=i686 -mcpu=i686? In looking at the gcc manpage, it doesn't appear the MMX instructions are part of the i686 architecture -- it's just for a pentiumpro versus the pentium (i586) or pentium-mmx (i586 + MMX). So what are the code differences for i686? I thought it included MMX, but that doesn't seem to be the case from the man page. Is the man page misleading? I "thought" the i686 was essentially the same as a pentium2, but gcc notes the pentium2 includes MMX, but not for the i686. Have the build defaults changed in the [Open]SuSE10 series? Thanks, -linda
On Saturday 11 February 2006 03:50, Linda Walsh wrote:
I was noticing that the default compiler options on my 9.3 based
distro when I remake a source _appear_ to be:
-O2 -g -march=i586 -mcpu=i686
Are these the options used to build the SuSE binary RPMs (for the i586 arch)? When did the "-mcpu=i686" get added for standard i586 binaries?
That's been there a while. But the official packages aren't built with this rpmrc. For example, -g isn't used in the official packages (if you rebuild a package, it will invariably be much larger than the original, at least in part because of all the debug stuff you get in your version) Not being an Intel assembly expert (or even novice) I won't attempt to answer your other questions, except
Have the build defaults changed in the [Open]SuSE10 series?
Slightly. Now it's optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2
Thanks! Anders Johansson wrote:
That's been there a while. But the official packages aren't built with this rpmrc. For example, -g isn't used in the official packages (if you rebuild a package, it will invariably be much larger than the original, at least in part because of all the debug stuff you get in your version)
Have the build defaults changed in the [Open]SuSE10 series?
Slightly. Now it's optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2
On Fri, Feb 10, 2006 at 06:50:23PM -0800, Linda Walsh wrote:
I was noticing that the default compiler options on my 9.3 based
distro when I remake a source _appear_ to be:
-O2 -g -march=i586 -mcpu=i686
Are these the options used to build the SuSE binary RPMs (for the i586 arch)? When did the "-mcpu=i686" get added for standard i586 binaries?
For the few packages that are compiled i686, glib, db and db4, are the default options changed to:
-O2 -g -march=i686 -mcpu=i686?
In looking at the gcc manpage, it doesn't appear the MMX instructions are part of the i686 architecture -- it's just for a pentiumpro versus the pentium (i586) or pentium-mmx (i586 + MMX). So what are the code differences for i686? I thought it included MMX, but that doesn't seem to be the case from the man page. Is the man page misleading? I "thought" the i686 was essentially the same as a pentium2, but gcc notes the pentium2 includes MMX, but not for the i686.
Have the build defaults changed in the [Open]SuSE10 series?
Most packages are built for i586 architecture and use these optflags: "-O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2" Some packages are compiled for i686 arch directly (to enable specific NPTL/TLS features), these are glibc and db mostly. (you find them in the suse/i686/ directory). These use: "-O2 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2" Ciao, Marcus
Marcus Meissner wrote:
On Fri, Feb 10, 2006 at 06:50:23PM -0800, Linda Walsh wrote:
I was noticing that the default compiler options on my 9.3 based
distro when I remake a source _appear_ to be:
-O2 -g -march=i586 -mcpu=i686
Are these the options used to build the SuSE binary RPMs (for the i586 arch)? When did the "-mcpu=i686" get added for standard i586 binaries?
For the few packages that are compiled i686, glib, db and db4, are the default options changed to:
-O2 -g -march=i686 -mcpu=i686?
In looking at the gcc manpage, it doesn't appear the MMX instructions are part of the i686 architecture -- it's just for a pentiumpro versus the pentium (i586) or pentium-mmx (i586 + MMX). So what are the code differences for i686? I thought it included MMX, but that doesn't seem to be the case from the man page. Is the man page misleading? I "thought" the i686 was essentially the same as a pentium2, but gcc notes the pentium2 includes MMX, but not for the i686.
Have the build defaults changed in the [Open]SuSE10 series?
Most packages are built for i586 architecture and use these optflags: "-O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Some packages are compiled for i686 arch directly (to enable specific NPTL/TLS features), these are glibc and db mostly. (you find them in the suse/i686/ directory).
These use: "-O2 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Ciao, Marcus
If you're compiling for your own machine(s), why not optimize the compiled code? For example, my cpu is a pentium 4M, so I include "-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code. -- "This world ain't big enough for the both of us," said the big noema to the little noema.
Most packages are built for i586 architecture and use these optflags: "-O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Some packages are compiled for i686 arch directly (to enable specific NPTL/TLS features), these are glibc and db mostly. (you find them in the suse/i686/ directory).
These use: "-O2 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Ciao, Marcus
If you're compiling for your own machine(s), why not optimize the compiled code? For example, my cpu is a pentium 4M, so I include "-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code.
The ones above are the SUSE compiler settings for the shipping packages. Ciao, Marcus
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2006-02-15 at 07:48 -0500, ken wrote:
"-O2 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Ciao, Marcus
If you're compiling for your own machine(s), why not optimize the compiled code? For example, my cpu is a pentium 4M, so I include "-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code.
I think you would get better perfomance with "-march=pentium4m" instead. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFD+NS5tTMYHG2NR9URAuSyAJ94GOpyMG5wbvYz6b+vbVxFgZqRkACfTK6D WeYEROzhho0eLcUjMhGEodg= =8tw8 -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Wednesday 2006-02-15 at 07:48 -0500, ken wrote:
"-O2 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2"
Ciao, Marcus
If you're compiling for your own machine(s), why not optimize the compiled code? For example, my cpu is a pentium 4M, so I include "-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code.
I think you would get better perfomance with "-march=pentium4m" instead.
Actually, I have both set the same. (I set it in some config file a long time ago and don't even remember anymore where I did it.) Yeah, according to the gcc manpage, it's redundant this way: -march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mcpu. Moreover, spec‐ ifying -march=cpu-type implies -mcpu=cpu-type. but it doesn't give a non-redundant way to specify it. :/ I'm thinking the optimized code is saving this laptop's batteries literally millions of electrons. And a fast machine is a happy machine. Cyberhappy, ken -- "This world ain't big enough for the both of us," said the big noema to the little noema.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2006-02-19 at 19:27 -0500, ken wrote:
"-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code.
I think you would get better perfomance with "-march=pentium4m" instead.
Actually, I have both set the same. (I set it in some config file a long time ago and don't even remember anymore where I did it.)
Yeah, according to the gcc manpage, it's redundant this way:
Not really.
-march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mcpu. Moreover, spec- ifying -march=cpu-type implies -mcpu=cpu-type.
but it doesn't give a non-redundant way to specify it. :/
I'm going by memory, no, it is not redundant, both options are... hold on... but... heck, they have changed the options again. -mcpu was what - -mtune is now. Obsserve, for an old gcc-2.95.3: `-mcpu=CPU TYPE' Assume the defaults for the machine type CPU TYPE when scheduling instructions. The choices for CPU TYPE are: `-march=CPU TYPE' Generate instructions for the machine type CPU TYPE. The choices for CPU TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU TYPE' implies `-mcpu=CPU TYPE'. In gcc 3.3.5 it says instead: `-mtune=CPU_TYPE' Set only the instruction scheduling parameters for machine type CPU_TYPE. The instruction set is not changed. `-mcpu=CPU-TYPE' Tune to CPU-TYPE everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for CPU-TYPE are: `-march=CPU-TYPE' Generate instructions for the machine type CPU-TYPE. The choices for CPU-TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU-TYPE' implies `-mcpu=CPU-TYPE'. Things have changed... I didn't notice this before :-( Anyway, "march" is the "boss" option, it seems. As it was time ago. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFD+RmQtTMYHG2NR9URAjXbAJwMN87B0Rvn6NaIAUp8y+rnBJFs/wCfQUOO A/83sXInBNPXQol01MCRAAA= =2f2K -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Sunday 2006-02-19 at 19:27 -0500, ken wrote:
"-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code. I think you would get better perfomance with "-march=pentium4m" instead. Actually, I have both set the same. (I set it in some config file a long time ago and don't even remember anymore where I did it.)
Yeah, according to the gcc manpage, it's redundant this way:
Not really.
-march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mcpu. Moreover, spec- ifying -march=cpu-type implies -mcpu=cpu-type.
but it doesn't give a non-redundant way to specify it. :/
I'm going by memory, no, it is not redundant, both options are... hold on... but... heck, they have changed the options again. -mcpu was what -mtune is now. Obsserve, for an old gcc-2.95.3:
`-mcpu=CPU TYPE' Assume the defaults for the machine type CPU TYPE when scheduling instructions. The choices for CPU TYPE are:
`-march=CPU TYPE' Generate instructions for the machine type CPU TYPE. The choices for CPU TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU TYPE' implies `-mcpu=CPU TYPE'.
In gcc 3.3.5 it says instead:
`-mtune=CPU_TYPE' Set only the instruction scheduling parameters for machine type CPU_TYPE. The instruction set is not changed.
`-mcpu=CPU-TYPE' Tune to CPU-TYPE everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for CPU-TYPE are:
`-march=CPU-TYPE' Generate instructions for the machine type CPU-TYPE. The choices for CPU-TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU-TYPE' implies `-mcpu=CPU-TYPE'.
Things have changed... I didn't notice this before :-(
Anyway, "march" is the "boss" option, it seems. As it was time ago.
Good, at least we're running the same version of gcc. Taking another look, I see it says that "-mtune" is a machine-dependent option, i.e., it's available only for some machines-- e.g., Sparc, RS/6000 and PowerPC, MIPS, DEC Alpha. The "-mtune" option isn't listed in the gcc manpage as being an option for i386 or x86-64 and other machines. I'm sure we can't assume that everyone on this list is running on x86s, but I guess I was doing that for you, the OP, and myself. :) When I think about it, "-mcpu" is a rather strange option. You tell gcc what kind of processor you have but gcc doesn't use (all of) that cpu's available instructions?? I'm sure the uebergeeks who wrote gcc had some reason for this, but I don't see it. -- "This world ain't big enough for the both of us," said the big noema to the little noema.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2006-02-20 at 06:57 -0500, ken wrote:
Things have changed... I didn't notice this before :-(
Anyway, "march" is the "boss" option, it seems. As it was time ago.
Good, at least we're running the same version of gcc. Taking another look, I see it says that "-mtune" is a machine-dependent option, i.e., it's available only for some machines-- e.g., Sparc, RS/6000 and PowerPC, MIPS, DEC Alpha. The "-mtune" option isn't listed in the gcc manpage as being an option for i386 or x86-64 and other machines. I'm sure we can't assume that everyone on this list is running on x86s, but I guess I was doing that for you, the OP, and myself. :)
I was going to say that the info page showed different info, but I ate my words before spelling them. I was at node: File: gcc.info, Node: i386 and x86-64 Options, Next: HPPA Options, Prev: MIPS Options, Up: Submodel Options and used "/" to search for string "-mtune". I hadn't noticed it searched several nodes and stopped in "Node: DEC Alpha Options". Yagh :-/ I was misled because I usually use "pinfo" instead of "info", and it doesn't do that. Unfortunately, it is broken in SuSE 9.3 and crashes sometimes, so this once I used "info".
When I think about it, "-mcpu" is a rather strange option. You tell gcc what kind of processor you have but gcc doesn't use (all of) that cpu's available instructions?? I'm sure the uebergeeks who wrote gcc had some reason for this, but I don't see it.
Let me see again. `-mcpu=CPU-TYPE' Tune to CPU-TYPE everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for CPU-TYPE are: `-march=CPU-TYPE' Generate instructions for the machine type CPU-TYPE. The choices for CPU-TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU-TYPE' implies `-mcpu=CPU-TYPE'. (both for "Intel 386 and AMD x86-64"). So... I think you can set -march=_i386_ and -mcpu=_pentium4 - for example; the code would run in the humblest of the processors (instruction set), but would be optimized for a pentium4, somewhat. Ok, then, things are more or less as they were previously. They have improved on it, because previously -mcpu only affected the scheduling, now they play with more things: all they can, but with the same instruction set. I think I have answered your question, more or less ;-) - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFD+m8UtTMYHG2NR9URAm7TAJ9iwJqbxuolnLFQjxScWZpNS77qDACeLDEl 3tDghWjWRpT8M1MNcup+/EQ= =0gFS -----END PGP SIGNATURE-----
participants (5)
-
Anders Johansson
-
Carlos E. R.
-
ken
-
Linda Walsh
-
Marcus Meissner