From nobody Sat Dec 25 11:56:30 2021 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 4D31718F4315; Sat, 25 Dec 2021 11:56:35 +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 4JLj8045gvz4lqF; Sat, 25 Dec 2021 11:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C854116B5B; Sat, 25 Dec 2021 11:56:30 +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 1BPBuUK9007605; Sat, 25 Dec 2021 11:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BPBuUEs007604; Sat, 25 Dec 2021 11:56:30 GMT (envelope-from git) Date: Sat, 25 Dec 2021 11:56:30 GMT Message-Id: <202112251156.1BPBuUEs007604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 9a24e9e07e67 - stable/12 - Revert clang change that breaks CTF on aarch64 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 9a24e9e07e67c25d15aa1dc2b080a876c641056b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640433393; 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=c9AKwGcprRMBT+6o1a2QGq/OXh0NzUDOcbP2Xa/lwEU=; b=liv/Xs4mUGsoB+LlUjKWMfLnmuxDwFBPPyRs/XDaHgAL9eW9l0Ax5dH5rZrZcQDfHgwF4S iiADz+/RK+s82UdUzCVOWZoMmIGEOfIriJ/3eEl9ciQYYtm02+KbUU4tNDvBfvOZeb680e /a0DJzmGC4zXns1PygJ0xf6BWZ1zPWuLBySPSkA5kpM+gNPFTC8Zu1hVYMKn3WsRoiqhbY OAL4voxR/N42MnYseGedjbBFA10w5ZRej27VB0ElP4NOvVvYyBAx324iXElkkiXAJUQuQz H97YoE20Q7YU9xBWxY5aljTX5jlaOeW854vkP2+2leWvBafgQWotjUUAnc9zrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640433393; a=rsa-sha256; cv=none; b=d3qHRvTBx+JYnMA3Wa5WNG3u/38hd4XY4u5Fj/ePgtfP3Hq8MZnP5IoVNP06vu+k0BWn4z knPBYhMK+Y3o/wLPYTVUim8UvSGjCl8wpR/nxBYA4lAcg61pcMIh49ZELi2F0Km+GpXyiz RTT2A83VSIcKjnHpCb/IWTA5pup15CSlVe9oj2kNFktiFQGdvmReafQ0AA/Q3M/CC9v2Tn fLFJFKqlPGxU+EtBKknGn8OuhsNXXFAedVp6IJRuvidR8trq1WPYP1RBIyaCekDMYFO3KW 6q4JekrZCxXhJbhrAGLLpwS2n6HNZP7xgYEt7OEFOUVfcwwlZHcKm5xuFCkpLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9a24e9e07e67c25d15aa1dc2b080a876c641056b commit 9a24e9e07e67c25d15aa1dc2b080a876c641056b Author: Dimitry Andric AuthorDate: 2021-12-12 20:11:40 +0000 Commit: Dimitry Andric CommitDate: 2021-12-25 11:51:43 +0000 Revert clang change that breaks CTF on aarch64 Revert commit e655e74a318e from llvm git (by Peter Collingbourne): AST: Create __va_list in the std namespace even in C. This ensures that the mangled type names match between C and C++, which is significant when using -fsanitize=cfi-icall. Ideally we wouldn't have created this namespace at all, but it's now part of the ABI (e.g. in mangled names), so we can't change it. Differential Revision: https://reviews.llvm.org/D104830 As reported by Jessica in https://reviews.llvm.org/D104830#3129527, this upstream change is implemented in such a way that it breaks DTrace's CTF. Since a proper fix has not yet been forthcoming, and we are unaffected by the (CFI-related) problem upstream was trying to address, revert the change for now. Requested by: jrtc27 MFC after: 3 days (cherry picked from commit da2012af42fb704365cfaff7ae68fc7de59981da) --- contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp index 0e163f3161a3..9a51cace3c14 100644 --- a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp +++ b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp @@ -8002,21 +8002,19 @@ static TypedefDecl *CreateVoidPtrBuiltinVaListDecl(const ASTContext *Context) { static TypedefDecl * CreateAArch64ABIBuiltinVaListDecl(const ASTContext *Context) { + // struct __va_list RecordDecl *VaListTagDecl = Context->buildImplicitRecord("__va_list"); - // namespace std { struct __va_list { - // Note that we create the namespace even in C. This is intentional so that - // the type is consistent between C and C++, which is important in cases where - // the types need to match between translation units (e.g. with - // -fsanitize=cfi-icall). Ideally we wouldn't have created this namespace at - // all, but it's now part of the ABI (e.g. in mangled names), so we can't - // change it. - auto *NS = NamespaceDecl::Create( - const_cast(*Context), Context->getTranslationUnitDecl(), - /*Inline*/ false, SourceLocation(), SourceLocation(), - &Context->Idents.get("std"), - /*PrevDecl*/ nullptr); - NS->setImplicit(); - VaListTagDecl->setDeclContext(NS); + if (Context->getLangOpts().CPlusPlus) { + // namespace std { struct __va_list { + NamespaceDecl *NS; + NS = NamespaceDecl::Create(const_cast(*Context), + Context->getTranslationUnitDecl(), + /*Inline*/ false, SourceLocation(), + SourceLocation(), &Context->Idents.get("std"), + /*PrevDecl*/ nullptr); + NS->setImplicit(); + VaListTagDecl->setDeclContext(NS); + } VaListTagDecl->startDefinition();