In share/mk/bsd.cpu.mk, ${_CPUCFLAGS} is added to CFLAGS. But CXXFLAGS doesn't. If CXXFLAGS doesn't set, CXXFLAGS=${CFLAGS}. So we don't almost notice thus issue. BTW, ${_CPUCFLAGS} should be added to CXXFLAGS, because C binaries and C++ binaries are combined multiple -mcpu=XXXX. Even if thus thing almost no problem, but it's wrong for optimization. Fix: .if !defined(NO_CPU_CFLAGS) CFLAGS += ${_CPUCFLAGS} +CXXFLAGS += ${_CPUCFLAGS} .endif--0FWefJ7gmV6krGXrq5Uw3GRZCJViUTRkyvuSt4UWHQ0CBqZG Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" Index: share/mk/bsd.cpu.mk =================================================================== --- share/mk/bsd.cpu.mk (revision 252953) +++ share/mk/bsd.cpu.mk (working copy) @@ -259,4 +259,5 @@ How-To-Repeat: $ cd /usr/src $ make -VCFLAGS -VCXXFLAGS -O2 -pipe -march=corei7 -O2 -pipe -march=corei7 $ env CFLAGS="-O2" CXXFLAGS="-O2" make -VCFLAGS -VCXXFLAGS -O2 -march=corei7 -O2 $ env CFLAGS="-O2" make -VCFLAGS -VCXXFLAGS -O2 -march=corei7 -O2 -march=corei7 $ cd /usr/ports/lang/perl5.16 $ make -VCFLAGS -VCXXFLAGS -O2 -pipe -march=corei7 -fno-strict-aliasing -O2 -pipe -march=corei7 -fno-strict-aliasing $ CFLAGS="-O2" CXXFLAGS="-O2" make -VCFLAGS -VCXXFLAGS -O2 -march=corei7 -fno-strict-aliasing -O2
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Nice catch... too bad we ignored this for approximately forever. I noticed it last night looking for something else, and committed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0fb33e049ac01ebe85a0bc2af670d4ac82df59c8 commit 0fb33e049ac01ebe85a0bc2af670d4ac82df59c8 Author: Norikatsu Shigemura <nork@FreeBSD.org> AuthorDate: 2025-01-20 20:53:19 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-01-21 21:24:10 +0000 bsd.cpu.mk: Add _CPUFLAGS to CXXFLAGS as well PR: 180365 Reviewed by: imp Sponsored by: Netflix share/mk/bsd.cpu.mk | 1 + 1 file changed, 1 insertion(+)