From amdmi3@amdmi3.ru  Fri Mar  5 08:58:18 2010
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2911F1065678
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Mar 2010 08:58:18 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15])
	by mx1.freebsd.org (Postfix) with ESMTP id DAA548FC1C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Mar 2010 08:58:17 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.71)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1NnTMN-0004BI-Rb
	for FreeBSD-gnats-submit@freebsd.org; Fri, 05 Mar 2010 11:58:16 +0300
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 367DFB860
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Mar 2010 11:58:15 +0300 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 2EFE6B829; Fri,  5 Mar 2010 11:58:15 +0300 (MSK)
Message-Id: <20100305085815.2EFE6B829@hades.panopticon>
Date: Fri,  5 Mar 2010 11:58:15 +0300 (MSK)
From: Dmitry Marakasov <amdmi3@FreeBSD.org>
Reply-To: Dmitry Marakasov <amdmi3@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: share/examples/etc/make.conf: contains dangerous example of CFLAGS override
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         144488
>Category:       docs
>Synopsis:       share/examples/etc/make.conf: contains dangerous example of CFLAGS override
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 05 09:00:14 UTC 2010
>Closed-Date:    Sat Feb 02 23:24:49 UTC 2013
>Last-Modified:  Sat Feb  2 23:30:02 UTC 2013
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Tue Nov 24 22:31:59 MSK 2009 root@hades.panopticon:/async/obj/usr/src/sys/HADES i386

We have make.conf example in share/examples, which contains evil lines which I've just witnessed impact of.

--
# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
# explicitly turn it off when using compiling with the -O2 optimization level.
#
#CFLAGS= -O2 -fno-strict-aliasing -pipe
#
--

If a user enables this, many ports (for example, x11-wm/lwm) will become broken, as with CFLAGS set in make.conf it will be impossible to pass CFLAGS via MAKE_ENV to child make, which ports do.

This line should likely be changed to

CFLAGS+= -fno-strict-aliasing

but I do not understand the need for that chunk in general - if strict-aliasing breaks some ports, why is it not set in these ports?

We [should] provide ports that build correctly with default settings, and we don't need to have users set something in make.conf to unbreak anything, so that confusing piece should likely be removed. Probably, changed to something more practical, like

# You can specify additional compiler flags that extend or override
# default ones. However, neither base systems nor ports are guaranteed
# to build and work without problems with non-default settings.
#
#CFLAGS+=	-msse3
#CXXFLAGS+=	-msse3

>Description:
>How-To-Repeat:
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Sat Feb 2 23:24:48 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144488 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144488: commit references a PR
Date: Sat,  2 Feb 2013 23:22:46 +0000 (UTC)

 Author: eadler
 Date: Sat Feb  2 23:22:27 2013
 New Revision: 246267
 URL: http://svnweb.freebsd.org/changeset/base/246267
 
 Log:
   MFC r244122:
   	Remove 'dangerous' instructions from the example make.conf.
   	Clarify when and why these might be used and that this isn't a supported
   	configuration.
   
   PR:		docs/144488
   Approved by:	cperciva (mentor, implicit)
 
 Modified:
   stable/9/share/examples/etc/make.conf
 Directory Properties:
   stable/9/share/examples/   (props changed)
   stable/9/share/examples/etc/   (props changed)
 
 Modified: stable/9/share/examples/etc/make.conf
 ==============================================================================
 --- stable/9/share/examples/etc/make.conf	Sat Feb  2 23:11:20 2013	(r246266)
 +++ stable/9/share/examples/etc/make.conf	Sat Feb  2 23:22:27 2013	(r246267)
 @@ -51,21 +51,20 @@
  # CFLAGS controls the compiler settings used when compiling C code.
  # Note that optimization settings other than -O and -O2 are not recommended
  # or supported for compiling the world or the kernel - please revert any
 -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing"
 +# nonstandard optimization settings
  # before submitting bug reports without patches to the developers.
  #
 -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
 -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
 -# explicitly turn it off when using compiling with the -O2 optimization level.
 -#
 -#CFLAGS= -O2 -fno-strict-aliasing -pipe
 -#
  # CXXFLAGS controls the compiler settings used when compiling C++ code.
  # Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
  # to add to CXXFLAGS value, "+=" must be used rather than "=".  Using "="
  # alone will remove the often needed contents of CFLAGS from CXXFLAGS.
  #
 -#CXXFLAGS+= -fconserve-space
 +# Additional compiler flags can be specified that extend or override
 +# default ones. However, neither the base system nor ports are guaranteed
 +# to build and function without problems with non-default settings.
 +#
 +# CFLAGS+=	-msse3
 +# CXXFLAGS+=	-msse3
  #
  # MAKE_SHELL controls the shell used internally by make(1) to process the
  # command scripts in makefiles.  Three shells are supported, sh, ksh, and
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144488: commit references a PR
Date: Sat,  2 Feb 2013 23:23:23 +0000 (UTC)

 Author: eadler
 Date: Sat Feb  2 23:22:39 2013
 New Revision: 246269
 URL: http://svnweb.freebsd.org/changeset/base/246269
 
 Log:
   MFC r244122:
   	Remove 'dangerous' instructions from the example make.conf.
   	Clarify when and why these might be used and that this isn't a supported
   	configuration.
   
   PR:		docs/144488
   Approved by:	cperciva (mentor, implicit)
 
 Modified:
   stable/8/share/examples/etc/make.conf
 Directory Properties:
   stable/8/share/examples/   (props changed)
 
 Modified: stable/8/share/examples/etc/make.conf
 ==============================================================================
 --- stable/8/share/examples/etc/make.conf	Sat Feb  2 23:22:31 2013	(r246268)
 +++ stable/8/share/examples/etc/make.conf	Sat Feb  2 23:22:39 2013	(r246269)
 @@ -52,21 +52,20 @@
  # CFLAGS controls the compiler settings used when compiling C code.
  # Note that optimization settings other than -O and -O2 are not recommended
  # or supported for compiling the world or the kernel - please revert any
 -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing"
 +# nonstandard optimization settings
  # before submitting bug reports without patches to the developers.
  #
 -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
 -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
 -# explicitly turn it off when using compiling with the -O2 optimization level.
 -#
 -#CFLAGS= -O2 -fno-strict-aliasing -pipe
 -#
  # CXXFLAGS controls the compiler settings used when compiling C++ code.
  # Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
  # to add to CXXFLAGS value, "+=" must be used rather than "=".  Using "="
  # alone will remove the often needed contents of CFLAGS from CXXFLAGS.
  #
 -#CXXFLAGS+= -fconserve-space
 +# Additional compiler flags can be specified that extend or override
 +# default ones. However, neither the base system nor ports are guaranteed
 +# to build and function without problems with non-default settings.
 +#
 +# CFLAGS+=	-msse3
 +# CXXFLAGS+=	-msse3
  #
  # MAKE_SHELL controls the shell used internally by make(1) to process the
  # command scripts in makefiles.  Three shells are supported, sh, ksh, and
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144488: commit references a PR
Date: Sat,  2 Feb 2013 23:23:01 +0000 (UTC)

 Author: eadler
 Date: Sat Feb  2 23:22:31 2013
 New Revision: 246268
 URL: http://svnweb.freebsd.org/changeset/base/246268
 
 Log:
   MFC r244122:
   	Remove 'dangerous' instructions from the example make.conf.
   	Clarify when and why these might be used and that this isn't a supported
   	configuration.
   
   PR:		docs/144488
   Approved by:	cperciva (mentor, implicit)
 
 Modified:
   stable/7/share/examples/etc/make.conf
 Directory Properties:
   stable/7/share/examples/   (props changed)
 
 Modified: stable/7/share/examples/etc/make.conf
 ==============================================================================
 --- stable/7/share/examples/etc/make.conf	Sat Feb  2 23:22:27 2013	(r246267)
 +++ stable/7/share/examples/etc/make.conf	Sat Feb  2 23:22:31 2013	(r246268)
 @@ -52,21 +52,20 @@
  # CFLAGS controls the compiler settings used when compiling C code.
  # Note that optimization settings other than -O and -O2 are not recommended
  # or supported for compiling the world or the kernel - please revert any
 -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing"
 +# nonstandard optimization settings
  # before submitting bug reports without patches to the developers.
  #
 -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
 -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
 -# explicitly turn it off when using compiling with the -O2 optimization level.
 -#
 -#CFLAGS= -O2 -fno-strict-aliasing -pipe
 -#
  # CXXFLAGS controls the compiler settings used when compiling C++ code.
  # Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
  # to add to CXXFLAGS value, "+=" must be used rather than "=".  Using "="
  # alone will remove the often needed contents of CFLAGS from CXXFLAGS.
  #
 -#CXXFLAGS+= -fconserve-space
 +# Additional compiler flags can be specified that extend or override
 +# default ones. However, neither the base system nor ports are guaranteed
 +# to build and function without problems with non-default settings.
 +#
 +# CFLAGS+=	-msse3
 +# CXXFLAGS+=	-msse3
  #
  # MAKE_SHELL controls the shell used internally by make(1) to process the
  # command scripts in makefiles.  Three shells are supported, sh, ksh, and
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
