Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-14 Thread Giorgos Keramidas
On 2004-05-13 23:29, platanthera [EMAIL PROTECTED] wrote:
 [/etc/make.conf]
 ...
 # To compile just the kernel with special optimizations, you should use
 # this instead of CFLAGS (which is not applicable to kernel builds anyway).
 # There is very little to gain by using higher optimization levels, and doing
 # so can cause problems.
 #
 COPTFLAGS= [whatever]
 ...

 just the kernel... sounds like COPTFLAGS setting should not effect world or
 port builds, but apparently it does.
 Or do I misunderstand something?

Yes, you do.  But I'm sure that you will find the make.conf(5) manpage
very informative and useful.  Especially the following parts:

| The following list provides a name and short description for variables
| that are used for all builds, or are used by the makefiles for things
| other than builds. [...]
|
| CFLAGS(str) Controls the compiler setting when compiling C code.
|   Optimization levels above -O (-O2, ...) are not supported.
|
| [...]
|
| The following list provides a name and short description for variables
| that are only used doing a kernel build: [...]
|
| COPTFLAGS (str) Controls the compiler settings when building the ker-
|   nel.  Optimization levels above [-O (-O2, ...)] are not

I hope this helps a bit.

- Giorgos

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-14 Thread platanthera
On Friday 14 May 2004 00:03, Giorgos Keramidas wrote:
 On 2004-05-13 23:29, platanthera [EMAIL PROTECTED] wrote:
  [/etc/make.conf]
  ...
  # To compile just the kernel with special optimizations, you should
  use # this instead of CFLAGS (which is not applicable to kernel
  builds anyway). # There is very little to gain by using higher
  optimization levels, and doing # so can cause problems.
  #
  COPTFLAGS= [whatever]
  ...
 
  just the kernel... sounds like COPTFLAGS setting should not effect
  world or port builds, but apparently it does.
  Or do I misunderstand something?

 Yes, you do.  But I'm sure that you will find the make.conf(5)
 manpage very informative and useful.  

not really. it says
...
The /etc/make.conf file is included from the appropriate Makefile which  
specifies the default settings for all the available options.  Options 
need only be specified in /etc/make.conf when the system administrator
wishes to override these defaults.
...


and in (/usr/share/examples)/etc/make.conf you can find
..
# CFLAGS controls the compiler settings used when compiling C code
...
#CFLAGS= -O -pipe
...
# To compile just the kernel with special optimizations, you should use
# this instead of CFLAGS (which is not applicable to kernel builds 
anyway).
...
#COPTFLAGS= -O -pipe
...

to my understanding this explains what CFLAGS/COPTFLAGS are intended for 
and _implies_ you'd have to uncomment the flag definitions 
in /etc/make.conf to set them active, otherwise the settings specified 
in the respective Makefile would be used.

I had explicitly specified COPTFLAGS (-O -pipe) but not CFLAGS and saw 
-O overriding -O2 when compiling a port...

quite confusing that uncommenting the example settings in make.conf 
changes exactly nothing, since these are the (undocumented?) system 
defaults anyway. probably a doc issue? 
- or just my stupidity .-)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-14 Thread Kris Kennaway
On Sat, May 15, 2004 at 03:03:31AM +0200, platanthera wrote:

 quite confusing that uncommenting the example settings in make.conf 
 changes exactly nothing, since these are the (undocumented?) system 
 defaults anyway. probably a doc issue? 
 - or just my stupidity .-)

Error in your expectations.  It's standard the UNIX world over for the
default configuration files to document the default settings.

Kris


pgpXDX9h6d3xR.pgp
Description: PGP signature


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-14 Thread Chuck Swiger
platanthera wrote:
On Friday 14 May 2004 00:03, Giorgos Keramidas wrote:
[ ... ]
Yes, you do.  But I'm sure that you will find the make.conf(5)
manpage very informative and useful.  
not really. it says
...
The /etc/make.conf file is included from the appropriate Makefile which  
specifies the default settings for all the available options.  Options 
need only be specified in /etc/make.conf when the system administrator
wishes to override these defaults.
...
The manpage is correct.  /etc/make.conf behaves much the same way as 
/etc/rc.conf and other config files with regard to default values.

Take a look in /etc/defaults/make.conf, /etc/defaults/rc.conf, etc.
[ ... ]
to my understanding this explains what CFLAGS/COPTFLAGS are intended for 
and _implies_ you'd have to uncomment the flag definitions 
in /etc/make.conf to set them active,  
Your understanding is not correct, although it's not clear what we should 
change to help resolve the confusion.

CFLAGS has a default value which will be used for everything you compile 
(meaning ports, the base system, and other things as well [1]) unless you 
specify something else.

otherwise the settings specified in the respective Makefile would be used.
No, the various Makefiles throughout the system *don't* set CFLAGS for 
themselves, they inherit it.  The reason this happens is so that you, the 
user, can specify CFLAGS once, in a well-documented location, and actually 
have your settings respected by the various software you might compile.

I had explicitly specified COPTFLAGS (-O -pipe) but not CFLAGS and saw 
-O overriding -O2 when compiling a port...
Please tell us which port was listing the -O2?  Ports which disregard CFLAGS 
are considered BROKEN and ought to be fixed...

--
-Chuck
[1]: Observe what happens if one does touch foo.c ; make foo.o...
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread platanthera
[/etc/make.conf]
...
# To compile just the kernel with special optimizations, you should use
# this instead of CFLAGS (which is not applicable to kernel builds anyway).
# There is very little to gain by using higher optimization levels, and doing
# so can cause problems.
#
COPTFLAGS= [whatever]
...

just the kernel... sounds like COPTFLAGS setting should not effect world or 
port builds, but apparently it does.
Or do I misunderstand something?
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread Kris Kennaway
On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
 [/etc/make.conf]
 ...
 # To compile just the kernel with special optimizations, you should use
 # this instead of CFLAGS (which is not applicable to kernel builds anyway).
 # There is very little to gain by using higher optimization levels, and doing
 # so can cause problems.
 #
 COPTFLAGS= [whatever]
 ...
 
 just the kernel... sounds like COPTFLAGS setting should not effect world or 
 port builds, but apparently it does.

It shouldn't, CFLAGS is used for that.

Kris


pgp0.pgp
Description: PGP signature


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread platanthera
On Friday 14 May 2004 00:48, Kris Kennaway wrote:
 On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
  [/etc/make.conf]
  ...
  # To compile just the kernel with special optimizations, you should
  use # this instead of CFLAGS (which is not applicable to kernel
  builds anyway). # There is very little to gain by using higher
  optimization levels, and doing # so can cause problems.
  #
  COPTFLAGS= [whatever]
  ...
 
  just the kernel... sounds like COPTFLAGS setting should not effect
  world or port builds, but apparently it does.

 It shouldn't, CFLAGS is used for that.

 Kris


I'm just compiling koffice and it looks like COPTFLAGS= -O -pipe
overrides the koffice defaults (no CFLAGS defined in make.conf).

...
if /bin/sh ../../../libtool --silent --mode=compile --tag=CXX c++ 
-DHAVE_CONFIG_H -I. -I. -I../../.. -I. -I../../../lib/kofficeui 
-I../../../lib/kofficeui -I../../../lib/kofficecore 
-I../../../lib/kofficecore -I../../../lib/store -I../../../lib/store 
-I../../../lib/kwmf -I../../../lib/kwmf -I/usr/local/include 
-I/usr/X11R6/include  -I/usr/local/include -I/usr/local/include/libxml2 
-I/usr/local/include -I/usr/local/include -I/usr/local/include/libxml2 
-DSRCDIR=\/share/FreeBSD/ports/editors/koffice-kde3/work/koffice-1.3.1/filters/xsltfilter/export\
  
-DQT_THREAD_SUPPORT   -I/usr/local/include -I/usr/local/include  
-I/usr/X11R6/include -D_GETOPT_H -D_THREAD_SAFE   -Wnon-virtual-dtor 
-Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings 
-DNDEBUG -DNO_DEBUG -O2 -O -pipe -march=k6-3 -fno-exceptions

-fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST 
-DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT xsltexport.lo -MD 
-MP -MF .deps/xsltexport.Tpo \
...
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread Kris Kennaway
On Fri, May 14, 2004 at 01:12:41AM +0200, platanthera wrote:
 On Friday 14 May 2004 00:48, Kris Kennaway wrote:
  On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
   [/etc/make.conf]
   ...
   # To compile just the kernel with special optimizations, you should
   use # this instead of CFLAGS (which is not applicable to kernel
   builds anyway). # There is very little to gain by using higher
   optimization levels, and doing # so can cause problems.
   #
   COPTFLAGS= [whatever]
   ...
  
   just the kernel... sounds like COPTFLAGS setting should not effect
   world or port builds, but apparently it does.
 
  It shouldn't, CFLAGS is used for that.
 
  Kris
 
 
 I'm just compiling koffice and it looks like COPTFLAGS= -O -pipe
 overrides the koffice defaults (no CFLAGS defined in make.conf).

The default CFLAGS value *is* -O -pipe.

Kris


pgp0.pgp
Description: PGP signature


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread platanthera
On Friday 14 May 2004 01:09, Kris Kennaway wrote:
 On Fri, May 14, 2004 at 01:12:41AM +0200, platanthera wrote:
  On Friday 14 May 2004 00:48, Kris Kennaway wrote:
   On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
[/etc/make.conf]
...
# To compile just the kernel with special optimizations, you
should use # this instead of CFLAGS (which is not applicable to
kernel builds anyway). # There is very little to gain by using
higher optimization levels, and doing # so can cause problems.
#
COPTFLAGS= [whatever]
...
   
just the kernel... sounds like COPTFLAGS setting should not
effect world or port builds, but apparently it does.
  
   It shouldn't, CFLAGS is used for that.
  
   Kris
 
  I'm just compiling koffice and it looks like COPTFLAGS= -O -pipe
  overrides the koffice defaults (no CFLAGS defined in make.conf).

 The default CFLAGS value *is* -O -pipe.

 Kris

OK, but it looks like -O overrides -O2 here, right?
And if that's true, how can I make the port build use the ports default 
instead of the system default?
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread Kris Kennaway
On Fri, May 14, 2004 at 01:39:34AM +0200, platanthera wrote:
 On Friday 14 May 2004 01:09, Kris Kennaway wrote:
  On Fri, May 14, 2004 at 01:12:41AM +0200, platanthera wrote:
   On Friday 14 May 2004 00:48, Kris Kennaway wrote:
On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
 [/etc/make.conf]
 ...
 # To compile just the kernel with special optimizations, you
 should use # this instead of CFLAGS (which is not applicable to
 kernel builds anyway). # There is very little to gain by using
 higher optimization levels, and doing # so can cause problems.
 #
 COPTFLAGS= [whatever]
 ...

 just the kernel... sounds like COPTFLAGS setting should not
 effect world or port builds, but apparently it does.
   
It shouldn't, CFLAGS is used for that.
   
Kris
  
   I'm just compiling koffice and it looks like COPTFLAGS= -O -pipe
   overrides the koffice defaults (no CFLAGS defined in make.conf).
 
  The default CFLAGS value *is* -O -pipe.
 
  Kris
 
 OK, but it looks like -O overrides -O2 here, right?

It depends which comes later in the gcc arguments.

 And if that's true, how can I make the port build use the ports default 
 instead of the system default?

The policy of the ports collection is that all ports should use CFLAGS
instead of their own crazy defaults, which are often not appropriate.
If you want to compile your ports with -O2 -pipe (recommended against
because of compiler or system bugs it sometimes exposes), set
CFLAGS=-O2 -pipe.

Kris


pgp0.pgp
Description: PGP signature


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread platanthera
On Friday 14 May 2004 01:41, Kris Kennaway wrote:
 On Fri, May 14, 2004 at 01:39:34AM +0200, platanthera wrote:
  On Friday 14 May 2004 01:09, Kris Kennaway wrote:
   On Fri, May 14, 2004 at 01:12:41AM +0200, platanthera wrote:
On Friday 14 May 2004 00:48, Kris Kennaway wrote:
 On Thu, May 13, 2004 at 11:29:07PM +0200, platanthera wrote:
  [/etc/make.conf]
  ...
  # To compile just the kernel with special optimizations,
  you should use # this instead of CFLAGS (which is not
  applicable to kernel builds anyway). # There is very little
  to gain by using higher optimization levels, and doing # so
  can cause problems. #
  COPTFLAGS= [whatever]
  ...
 
  just the kernel... sounds like COPTFLAGS setting should not
  effect world or port builds, but apparently it does.

 It shouldn't, CFLAGS is used for that.

 Kris
   
I'm just compiling koffice and it looks like COPTFLAGS= -O
-pipe overrides the koffice defaults (no CFLAGS defined in
make.conf).
  
   The default CFLAGS value *is* -O -pipe.
  
   Kris
 
  OK, but it looks like -O overrides -O2 here, right?

 It depends which comes later in the gcc arguments.

  And if that's true, how can I make the port build use the ports
  default instead of the system default?

 The policy of the ports collection is that all ports should use
 CFLAGS instead of their own crazy defaults, which are often not
 appropriate. If you want to compile your ports with -O2 -pipe
 (recommended against because of compiler or system bugs it sometimes
 exposes), set CFLAGS=-O2 -pipe.

 Kris

Thank you very much for your help. 

Just one last question (slightly getting OT) - are CFLAGS settings on 
FreeBSD more critical than on Linux?
http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html recommends 
-O3 -pipe -fomit-frame-pointer 'for  those who don't want to experiment, 
want a stable system, but still optimized..'
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: COPTFLAGS (not?) only for compiling the kernel?

2004-05-13 Thread Kris Kennaway
On Fri, May 14, 2004 at 02:01:15AM +0200, platanthera wrote:

 Just one last question (slightly getting OT) - are CFLAGS settings on 
 FreeBSD more critical than on Linux?
 http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html recommends 
 -O3 -pipe -fomit-frame-pointer 'for  those who don't want to experiment, 
 want a stable system, but still optimized..'

Perhaps Linux users don't mind (or don't notice ;-) strange
instability in their systems :-)

Kris


pgp0.pgp
Description: PGP signature