Bug 222415

Summary: [patch] Mk/Uses/compiler.mk: Add support for C++17
Product: Ports & Packages Reporter: Roger Leigh <rleigh>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me CC: cyberbotx, freebsd-2024, linimon, portmgr, ports-bugs
Priority: --- Keywords: patch
Version: LatestFlags: cyberbotx: maintainer-feedback? (portmgr)
Hardware: Any   
OS: Any   
Bug Depends on: 222542    
Bug Blocks:    
Attachments:
Description Flags
Add compiler:c++17-lang option and c++17 language standard to compiler.mk
none
Updated patch for Mk/Uses/compiler.mk cyberbotx: maintainer-approval? (portmgr)

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:

USES=compiler:c++17-lang
USE_CXXSTD=c++17

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


Regards,
Roger
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 freebsd_triage 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 freebsd_triage 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

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

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

Changes:
  head/Mk/Uses/compiler.mk
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2018-06-11 12:43:44 UTC
Patch committed, thanks!