docs/144488: share/examples/etc/make.conf: contains dangerous example of CFLAGS override

Dmitry Marakasov amdmi3 at FreeBSD.org
Fri Mar 5 09:00:15 UTC 2010


>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 05 09:00:14 UTC 2010
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-doc mailing list