From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ED5FDCC7C; Tue, 3 Sep 2019 14:06:36 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7zc0pmSz4Pjp; Tue, 3 Sep 2019 14:06:36 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9352B1A8DA; Tue, 3 Sep 2019 14:06:12 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DD1BACBA7; Wed, 10 Apr 2019 11:04:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB0D6BE83; Wed, 10 Apr 2019 11:04:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 120C5CB81; Wed, 10 Apr 2019 11:04:10 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C9527CB7E; Wed, 10 Apr 2019 11:04:07 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB026BE7E; Wed, 10 Apr 2019 11:04:07 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 5FED1CB7D; Wed, 10 Apr 2019 11:04:07 +0000 (UTC) From: Jan Beich To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345708 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc References: <201903291845.x2TIjRMb087865@repo.freebsd.org> In-Reply-To: <201903291845.x2TIjRMb087865@repo.freebsd.org> (Enji Cooper's message of "Fri, 29 Mar 2019 18:45:27 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3BB0D6BE83 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:41 -0000 X-Original-Date: Wed, 10 Apr 2019 13:04:03 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:41 -0000 Enji Cooper writes: > +.if ${COMPILER_FEATURES:Mc++11} > +CXXSTD?= c++11 POLA violation. Clang 6.0 or later defaults to gnu++14, not c++11. > +.elif ${COMPILER_TYPE} == "gcc" > +# Prior versions of g++ support C++98 with GNU extensions by default. > +CXXSTD?= gnu++98 POLA violation. GCC 6.0 or later defaults to gnu++14, not gnu++98. > +CXXFLAGS+= -std=${CXXSTD} POLA violation. Breaks consumers that pass different -std= e.g., http://www.ipv6proxy.net/go.php?u=http://beefy12.nyi.freebsd.org/data/head-amd64-default/p498440_s346039/logs/errors/android-tools-adb-9.0.0.r3_2.log Index: share/mk/bsd.sys.mk =================================================================== --- share/mk/bsd.sys.mk (revision 346076) +++ share/mk/bsd.sys.mk (working copy) @@ -25,16 +25,19 @@ CFLAGS+= -std=iso9899:1999 CFLAGS+= -std=${CSTD} .endif # CSTD -.if ${COMPILER_FEATURES:Mc++11} -CXXSTD?= c++11 -.elif ${COMPILER_TYPE} == "gcc" -# Prior versions of g++ support C++98 with GNU extensions by default. +.if (${COMPILER_TYPE} == "clang" || ${COMPILER_TYPE} == "gcc") && ${COMPILER_VERSION} >= 60000 +CXXSTD?= gnu++14 +.elif ${COMPILER_TYPE} == "clang" || ${COMPILER_TYPE} == "gcc" +# Prior versions of clang++ and g++ support C++98 with GNU extensions by default. CXXSTD?= gnu++98 .else # Assume that the compiler supports at least C++98. CXXSTD?= c++98 .endif +# Only pass -std= if missing to facilitate compatibility with previous FreeBSD versions +.if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=${CXXSTD} +.endif # CXXSTD # -pedantic is problematic because it also imposes namespace restrictions