From nobody Sun Dec 12 20:12:18 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 DE88C18E1879; Sun, 12 Dec 2021 20:12:19 +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 4JBwm30z87z4VcC; Sun, 12 Dec 2021 20:12:19 +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 02AC0272D4; Sun, 12 Dec 2021 20:12:19 +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 1BCKCIaS025264; Sun, 12 Dec 2021 20:12:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BCKCInT025263; Sun, 12 Dec 2021 20:12:18 GMT (envelope-from git) Date: Sun, 12 Dec 2021 20:12:18 GMT Message-Id: <202112122012.1BCKCInT025263@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: da2012af42fb - main - 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/main X-Git-Reftype: branch X-Git-Commit: da2012af42fb704365cfaff7ae68fc7de59981da Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639339939; 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=OGPESi3zlkoayU2nN1eJ4o5tdbpWhTg/p4rFOsG7vDY=; b=QiKhkiKJK8u856z3x3AO6TrIojaSeS4E+AkQCYBE2M22E6tuLSzr7PVRPNqK6WK19Exkz0 yXqVz0UaGdhuvX6ygXwa6dYYbfrT7vt8v6b/HZuuaLxGFOgPn5VNSwAzDAjoddkXnhhZeI qiH3ztbcQYixGpiu3/PxtCMPrQV9NI62bRzvcYqR+4kHVcs+iRdjUrd5Vk4ddcM+T1iH1u jHWocbtMlgA8cZ7nb5m12qPrledrQ8YCmKDTg9jayJCcLYptGNNPbiglDhySzqC6HJOzpP YuehFZCXYxGv05pTBEqzTfGWI9VGzP5VvmpLVXyBtPHJSHNI0gk33O+mBZwq5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639339939; a=rsa-sha256; cv=none; b=Piq8CbbpWZbnFct7OrcPoQjeikrMHoXKJbO7uGor7+FWT+x7rgUPW0de0/6c+e+J6lPXb6 UCK7oBmmWsbdrGH3j5nfb4leXV9tU1uittDqlrhvRZsWLGbDtNd8ccq3zNeqsUcgRJgPnP QbvdQkD0BEufDeXAcibVZdaneJ3XyXVkT5BYbTxw9+QrGSLwsby1UZ/cGFGgqYgM1BY+y2 7N8+G6miLUfn6YLm2UcVuXqOkbKzuIWvkWnYIrh+Di1luh5Z0tcLwCNfv/QZ9Q9Yzmv5jF QmTjDfG82ODNmj7k4Tbqyo7vX63qhDYPfvSARKfX/JBbCG7Okk3hXhYildIAVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=da2012af42fb704365cfaff7ae68fc7de59981da commit da2012af42fb704365cfaff7ae68fc7de59981da Author: Dimitry Andric AuthorDate: 2021-12-12 20:11:40 +0000 Commit: Dimitry Andric CommitDate: 2021-12-12 20:11:40 +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 --- 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();