From nobody Tue May 23 17:49:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQhdT1qMnz4CkV0; Tue, 23 May 2023 17:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQhdT1M2lz4b92; Tue, 23 May 2023 17:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNzMPguUVVr+5BnkNXuR/lveCpWxTTmSMgd60oQqhIY=; b=QmfRPO7sxF11AFO+NjsTvOBx1es9b3nEASmf/OKxZyePkHuVTxUBx1c5mRl7NVoG11cq+8 0p9GeA+j5ezflfBJEtu7lHNh1bgVnynAEJAuhEUpJP9acoc1mvpCWXiZX9i7XYNxLn66oC KJ4wZKc7KnTwwbc2XubS1VFqrUEZLW3s1Bl3rzztyxeUKrjXfE6Y3rZDQsIcyfaYKNSvRe uiNW/Bpop1OKFh3TXh5zqwxZBXPv5wRzGIpu8QfI2Xy/aK6wkrekcumFFSFW4ieeIA2izu iTiGt7Kwx6pM5vEBTgp/2ETStdjLE+Ko+I4r+rBEWt/SOWuG6ksAsGhydcxhTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNzMPguUVVr+5BnkNXuR/lveCpWxTTmSMgd60oQqhIY=; b=q0MYJSPxYdnvkXVBx1JqtPk0uKWzB95Mdbwg+dYHdrRmGU3+5MLBHYEcAAvrlBu/bGncEm us2WQzOX/6Jhejq03YWsjcKG6cz2yW0pu80ZOUQV/Pl1FVYZb4Rc0lfwTEdz79/IPsQGqs YEVeuHPmqS9HYFCaQ0WyyZOPHsQrxX5ZnS5GVHMMHsiDN4q8raYjazymBpKdiPc7xUIDUs pLAlUyBE21UFpSMQmhI4S4/3rnrzC2pKUSfVwwCu1S0cHpgvPsdKLcdzKe09bzUJMcqwKt qwp3+2+88QJ+acwTF9I8Of0anMKpMovWW4e2aACVMJtX80n64s2UHoU6KbWYbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684864141; a=rsa-sha256; cv=none; b=jj4s4LqHvSgZ3L1MMwoxSwY9lPRhUEE4UTxyOLnaWQI5viBkmL6WmvgMz46mNKFqLLGLQ0 yph97Et+XcTQDqCB2CY2FHSGLkJPkbIi/4gRi5kRdhDXXIuq3lPdkehlMw1STN70756T2j mDsERm4d1+NNPOj7U7TNjmbY/v+73UxJwSxN43F3dEBdKYt/DUDrRJ2PRigCPPpwZ0EDpg lbyT81p90EvcaWVTlLt6QARYQ3pr3GJa/fE/iOIJ4OxHsBVxl3edLBpfkOk4dYMdpGN1v6 vGSTxupvllNM58SQ5IQXstMkbgaFwrCsDNrWXUIDD+yRL3taAMGLsyEc5KSlvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQhdT0KTmz18XZ; Tue, 23 May 2023 17:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NHn0hv046211; Tue, 23 May 2023 17:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NHn0v6046210; Tue, 23 May 2023 17:49:00 GMT (envelope-from git) Date: Tue, 23 May 2023 17:49:00 GMT Message-Id: <202305231749.34NHn0v6046210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 3006f6df025f - main - Update -ftrivial-auto-var-init flags for clang >= 16 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 commit 3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 Author: Dimitry Andric AuthorDate: 2023-05-23 17:40:36 +0000 Commit: Dimitry Andric CommitDate: 2023-05-23 17:44:45 +0000 Update -ftrivial-auto-var-init flags for clang >= 16 As of clang 16, the -ftrivial-auto-var-init=zero option no longer needs -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang to enable the option. Only add it for older clang versions. PR: 271047 Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D40208 --- share/mk/bsd.lib.mk | 14 ++++++++------ share/mk/bsd.prog.mk | 14 ++++++++------ sys/conf/kern.mk | 6 ++++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 8e5035f6db41..9a947b85bfe2 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -99,19 +99,21 @@ LDFLAGS+= -Wl,-zretpolineplt # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -CXXFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +CXXFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else -.warning InitAll (zeros) requested but not support by compiler +.warning InitAll (zeros) requested but not supported by compiler .endif .elif ${MK_INIT_ALL_PATTERN} == "yes" .if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern CXXFLAGS+= -ftrivial-auto-var-init=pattern .else -.warning InitAll (pattern) requested but not support by compiler +.warning InitAll (pattern) requested but not supported by compiler .endif .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index de453564579d..6f1079944914 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -72,19 +72,21 @@ LDFLAGS+= -Wl,-zretpolineplt # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -CXXFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +CXXFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else -.warning InitAll (zeros) requested but not support by compiler +.warning InitAll (zeros) requested but not supported by compiler .endif .elif ${MK_INIT_ALL_PATTERN} == "yes" .if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern CXXFLAGS+= -ftrivial-auto-var-init=pattern .else -.warning InitAll (pattern) requested but not support by compiler +.warning InitAll (pattern) requested but not supported by compiler .endif .endif diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 245f81e6ed71..b6646f6c35ca 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -252,8 +252,10 @@ CFLAGS+= -mretpoline # .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else .warning InitAll (zeros) requested but not support by compiler .endif