Bug 180365 - [bsd.cpu.mk] [patch] Not attach ${_CPUCFLAGS} to CXXFLAGS
Summary: [bsd.cpu.mk] [patch] Not attach ${_CPUCFLAGS} to CXXFLAGS
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-07 17:20 UTC by Norikatsu Shigemura
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norikatsu Shigemura freebsd_committer 2013-07-07 17:20:00 UTC
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
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:34 UTC
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