Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 2015 12:59:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 83995] CFLAGS & COPTFLAGS ambiguous behaviour
Message-ID:  <bug-83995-8-uWb6OQAb7g@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-83995-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-83995-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=83995

NGie Cooper <ngie@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.freebsd.org/bu
                   |                            |gzilla/show_bug.cgi?id=1901
                   |                            |03,
                   |                            |https://bugs.freebsd.org/bu
                   |                            |gzilla/show_bug.cgi?id=1937
                   |                            |68
                 CC|                            |bdrewery@FreeBSD.org,
                   |                            |imp@FreeBSD.org,
                   |                            |ngie@FreeBSD.org

--- Comment #1 from NGie Cooper <ngie@FreeBSD.org> ---
Agreed. This logic is broken/confusing:

 38 .if defined(DEBUG)
 39 _MINUS_O=       -O
 40 CTFFLAGS+=      -g
 41 .else
 42 .if ${MACHINE_CPUARCH} == "powerpc"
 43 _MINUS_O=       -O      # gcc miscompiles some code at -O2
 44 .else
 45 _MINUS_O=       -O2
 46 .endif
 47 .endif
 48 .if ${MACHINE_CPUARCH} == "amd64"
 49 .if ${COMPILER_TYPE} == "clang"
 50 COPTFLAGS?=-O2 -pipe
 51 .else
 52 COPTFLAGS?=-O2 -frename-registers -pipe
 53 .endif
 54 .else
 55 COPTFLAGS?=${_MINUS_O} -pipe
 56 .endif
 57 .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
 58 COPTFLAGS+= -fno-strict-aliasing
 59 .endif
 60 .if !defined(NO_CPU_COPTFLAGS)
 61 COPTFLAGS+= ${_CPUCFLAGS}
 62 .endif

In particular, clang's version of COPTFLAGS always override the ${_MINUS_O}, -O
on clang is synonymous with -O2, etc. brewery was complaining about this as
well the other day/week.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-83995-8-uWb6OQAb7g>