Re: Setting CPUTYPE and CFLAGS in make.conf

2008-04-09 Thread RW
On Tue, 8 Apr 2008 13:14:45 -0700
David Allen [EMAIL PROTECTED] wrote:

 The advice I've read in several posts on the subject involve
 everything from setting one, setting both, to ignoring both,
 sometimes with the =? notation and sometimes without.  And then, I've
 read comments that suggest when compiling the kernel, for example,
 both are ignored, and default values (tucked away somewhere) are
 always applied.  IIRC, the handbook recommends at least setting
 CPUTYPE.

Avoid setting CFLAGS unless you have a good reason - Gentoo
documentation has a lot to answer for. CPUTYPE causes -march to be
applied, so it can affect compatibility. AFAIK both setting do affect
world and kernel because CFLAGS can cause a build to fail, and I've
seen matching march settings in kernel builds.


 Or are those settings relevant to the
 compilation process only?  Or to both the compilation process and the
 actual performance of the binary?

It can be either, -O2 is related to execution, -pipe speeds-up
compilation.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting CPUTYPE and CFLAGS in make.conf

2008-04-09 Thread David Allen
On Wed, Apr 9, 2008 at 10:44 AM, RW wrote:
 On Tue, 8 Apr 2008 13:14:45 -0700 David Allen wrote:

  The advice I've read in several posts on the subject involve
  everything from setting one, setting both, to ignoring both,
  sometimes with the =? notation and sometimes without.  And then, I've
  read comments that suggest when compiling the kernel, for example,
  both are ignored, and default values (tucked away somewhere) are
  always applied.  IIRC, the handbook recommends at least setting
  CPUTYPE.

 Avoid setting CFLAGS unless you have a good reason - Gentoo
 documentation has a lot to answer for. CPUTYPE causes -march to be
 applied, so it can affect compatibility. AFAIK both setting do affect
 world and kernel because CFLAGS can cause a build to fail, and I've
 seen matching march settings in kernel builds.

  Or are those settings relevant to the
  compilation process only?  Or to both the compilation process and the
  actual performance of the binary?

 It can be either, -O2 is related to execution, -pipe speeds-up
 compilation.

Thank you for your reply.   It's starting to make a lot more sense.
Just to confirm, then, if there's no CPUTYPE set,  I can then set up
a build server on an Opteron box, for example, to build world, kernel
and ports binaries that can then be installed on my Thinkpad or
a PIII box?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting CPUTYPE and CFLAGS in make.conf

2008-04-09 Thread Jonathan Chen
On Wed, Apr 09, 2008 at 11:35:51AM -0700, David Allen wrote:

[...]
 Thank you for your reply.   It's starting to make a lot more sense.
 Just to confirm, then, if there's no CPUTYPE set,  I can then set up
 a build server on an Opteron box, for example, to build world, kernel
 and ports binaries that can then be installed on my Thinkpad or
 a PIII box?

Yes, provided they use the same architectures, eg: i386
-- 
Jonathan Chen [EMAIL PROTECTED]

We laugh in the face of danger, we drop icecubes down the vest of fear
 - Edmond Blackadder III
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting CPUTYPE and CFLAGS in make.conf

2008-04-09 Thread Roland Smith
On Wed, Apr 09, 2008 at 11:35:51AM -0700, David Allen wrote:
  Avoid setting CFLAGS unless you have a good reason - Gentoo
  documentation has a lot to answer for. CPUTYPE causes -march to be
  applied, so it can affect compatibility. AFAIK both setting do affect
  world and kernel because CFLAGS can cause a build to fail, and I've
  seen matching march settings in kernel builds.
 
   Or are those settings relevant to the
   compilation process only?  Or to both the compilation process and the
   actual performance of the binary?
 
  It can be either, -O2 is related to execution, -pipe speeds-up
  compilation.
 
 Thank you for your reply.   It's starting to make a lot more sense.
 Just to confirm, then, if there's no CPUTYPE set,  I can then set up
 a build server on an Opteron box, for example, to build world, kernel
 and ports binaries that can then be installed on my Thinkpad or
 a PIII box?

Only if they use the same architecture! If your opteron is running amd64, its
binaries won't run on a pIII, which can only run the i386 architecture.

If you read through /usr/src/share/mk/bsd.cpu.mk you can see the
different CPU types and the effect they have on build
parameters. E.g. on the i386 architecture, if no CPUTYPE is set, the CPU
type is set to i486, which is the lowest common denominator that gcc supports.

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgplMUMLIBvOx.pgp
Description: PGP signature


Re: Setting CPUTYPE and CFLAGS in make.conf

2008-04-09 Thread RW
On Wed, 9 Apr 2008 11:35:51 -0700
David Allen [EMAIL PROTECTED] wrote:


 Thank you for your reply.   It's starting to make a lot more sense.
 Just to confirm, then, if there's no CPUTYPE set,  I can then set up
 a build server on an Opteron box, for example, to build world, kernel
 and ports binaries that can then be installed on my Thinkpad or
 a PIII box?

CPUTYPE=pentiumpro

is a good choice for mainstream i386 processors since it's the common
ancestor of the Athlon and modern Pentium series - the exceptions are
some of the low-power cpus for small form-factor motherboards. The
default is i486, which should handle anything.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Setting CPUTYPE and CFLAGS in make.conf

2008-04-08 Thread David Allen
The advice I've read in several posts on the subject involve everything
from setting one, setting both, to ignoring both, sometimes with the =?
notation and sometimes without.  And then, I've read comments that suggest
when compiling the kernel, for example, both are ignored, and default
values (tucked away somewhere) are always applied.  IIRC, the handbook
recommends at least setting CPUTYPE.

My question isn't a holy grail type of quest for maximised performance,
but concerns the meaning of those settings with respect to
building world, building kernel and anything in ports.  Put another way,
I'm not a computer science major, but do have different systems that I
compile for, and I'd like to have a better understand WTF I'm really doing.

For example, what is the difference, if any, between a binary compiled
with:

CPUTYPE=opteron
CFLAGS=-O -pipe

compares with compiling it using:

CPUTYPE=pentium3
CFLAGS=

compares with compiling it using what I think are the universal defaults
of:

CPUTYPE=
CFLAGS=-O2 -fno-strict-aliasing -pipe

that get applied if the make.conf is blank?  Can the resulting binary be
run on each other's system?  Or is it simply optimised to run on one,
versus another?  Or are those settings relevant to the compilation process
only?  Or to both the compilation process and the actual performance of
the binary?  Or should I be taking the dog for a nice long walk instead of
watching scrolling compiler output? ;-)

If someone could take a moment to explain in moderately technical terms
what all the above means, or suggest a source for further reading, I'd be
grateful.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]