Bug 222415 - [patch] Mk/Uses/compiler.mk: Add support for C++17
Summary: [patch] Mk/Uses/compiler.mk: Add support for C++17
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
Keywords: patch
Depends on: 222542
  Show dependency treegraph
Reported: 2017-09-17 21:31 UTC by Roger Leigh
Modified: 2018-07-28 20:05 UTC (History)
5 users (show)

See Also:
cyberbotx: maintainer-feedback? (portmgr)

Add compiler:c++17-lang option and c++17 language standard to compiler.mk (2.85 KB, patch)
2017-09-17 21:31 UTC, Roger Leigh
no flags Details | Diff
Updated patch for Mk/Uses/compiler.mk (2.40 KB, patch)
2018-06-09 17:48 UTC, Naram Qashat
cyberbotx: maintainer-approval? (portmgr)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Leigh 2017-09-17 21:31:33 UTC
Created attachment 186489 [details]
Add compiler:c++17-lang option and c++17 language standard to compiler.mk

Now that clang 5.0 is out, it's possible to start using C++17 features.  The attached patch adds support for:


including building clang 5.0 from source if a new enough clang is not available (copying the existing C++14 support).

Comment 1 Mikhail T. 2017-12-15 14:54:32 UTC
I'd say, compiler.mk should allow using clang50 in other cases too -- such as via the DEFAULT_VERSIONS-mechanism or simply when clang50 is already installed (and 40 is not).

Currently, the compiler:c++14-lang flag will add clang40 dependency unconditionally -- even if clang50 is already present instead.
Comment 2 Naram Qashat 2018-06-09 17:48:44 UTC
Created attachment 194098 [details]
Updated patch for Mk/Uses/compiler.mk

I'm attaching an updated patch to Mk/Uses/compiler.mk for this, using the system compiler if it supports c++17 or llvm60 if it doesn't.

One other thing was adding gnu++14 and gnu++17 to CXXSTD, as those were missing for some reason. I'm not sure if they were actually needed, though.

It would be nice to get this into the tree sooner rather than later, as I'm wanting to update the x11-toolkits/scintilla port and it uses C++17 and refuses to compile with the FreeBSD 11.1 clang 4.0 compiler.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2018-06-10 23:49:15 UTC
Please remind me when this is committed, to update the Porter's Handbook.
Comment 4 Mathieu Arnold freebsd_committer 2018-06-11 10:46:53 UTC
(In reply to Mark Linimon from comment #3)
> Please remind me when this is committed, to update the Porter's Handbook.

Mmm, I usually run a git diff every once in a while on Mk/Uses to make sure I add changes I missed to the handbook. I have not done it in a while though.  There is a rev number at the top of the uses/chapter.xml saying when was the last time it was all believed to be sync'ed.
Comment 5 commit-hook freebsd_committer 2018-06-11 12:39:48 UTC
A commit references this bug:

Author: antoine
Date: Mon Jun 11 12:39:04 UTC 2018
New revision: 472188
URL: https://svnweb.freebsd.org/changeset/ports/472188

  Add support for USES=compiler:c++17-lang

  PR:		222415
  Submitted by:	Naram Qashat
  With hat:	portmgr

Comment 6 Antoine Brodin freebsd_committer 2018-06-11 12:43:44 UTC
Patch committed, thanks!