From nobody Sat Dec 25 11:55:47 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 68F6618F338D; Sat, 25 Dec 2021 11:55:51 +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 4JLj792XSfz4lLV; Sat, 25 Dec 2021 11:55:49 +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 202FD16F04; Sat, 25 Dec 2021 11:55:47 +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 1BPBtl7j006778; Sat, 25 Dec 2021 11:55:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BPBtlH6006777; Sat, 25 Dec 2021 11:55:47 GMT (envelope-from git) Date: Sat, 25 Dec 2021 11:55:47 GMT Message-Id: <202112251155.1BPBtlH6006777@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: c8105d1652b2 - stable/12 - clang: Build with -fno-strict-aliasing when using GCC 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: c8105d1652b2def0ec05f96d39c5e3a4a6c56992 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640433349; 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=Xl66tPQKPuPtyBrgphbarm7abMKeFq0bY64fmGjMvHY=; b=U3qU1OS8X4KS19PghbM7+8F718Eql7eCkrGmfUrkHQll5FmvXzl5tau+Zsle6kY8+nIZcm FlhdcHwoMLtAdSE82+JmOpBT4/mJwdxdp/yY4F/9oTr7BEOA8qYWpGj4t9BGWb/SNUTUyG wAfX2V4Y+QsbbBdtfaTe9U0CuERazPt1i9PXvystcRgwBe9hvSOIksmc+N3bqZlH6bGjjB 1mks7OPuN3P/5XpNJ2Z3pSjn5Rl4J0TiD3L4Y6ZHrjkYVHXqCHFY+sfRG+dTLjLEp2et5q /ZunqkLhtJd2vcnvjus0QyJq3BKrVRn1JKje6ET+TKJHSBKrZ6Fa+g4kquahLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640433349; a=rsa-sha256; cv=none; b=iqZTQd4jLimrFZylcVUnArMgYwL53tCMhwKUqJj6VEpQKDqnPbG7FvpE/V5V987pVa3K4k UUHi57NC2PpYiKh07FdQ4tdNhhxl2A4gJsw4/ao9uQniLZt8FJ4WqTDVV3+YckKLYvfuGL Jzwuy3IpfCC7k/im34V2D5qKB+zd5e/nl9MBpNd8nbuoscnzxVIyG4HuKa3lzle9JrK9OP VgNgv3wsd+MWyZCzp8uM0itaQDANSxlTw3nHmo1YOLZjXHHrFRVMr6t4WcLPO0yN1noJVL xt2wNrmTBUDrRuJ+RwKD0/IryxkltjFSEpUEfinL8ka7AB0gPukCuEa+/f1p3Q== 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=c8105d1652b2def0ec05f96d39c5e3a4a6c56992 commit c8105d1652b2def0ec05f96d39c5e3a4a6c56992 Author: Jessica Clarke AuthorDate: 2021-08-24 13:59:36 +0000 Commit: Dimitry Andric CommitDate: 2021-12-25 11:51:19 +0000 clang: Build with -fno-strict-aliasing when using GCC Somewhat ironically, there are strict aliasing violations in Clang, which can result in the following assertion failure: Assertion `*(NamedDecl **)&Data == ND && "PointerUnion mangles the NamedDecl pointer!"' failed. Upstream's clang/CMakeLists.txt specifically (not LLVM as a whole) passes -fno-strict-aliasing if the compiler is not Clang, and this fixes the above issue. This was seen when cross-building from Linux using a bootstrap compiler, but likely also affects worlds built with a new enough external GCC toolchain. MFC after: 1 week Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D31533 (cherry picked from commit c1f7d8dd23db693106fcd66e0b1766a3f3194670) --- lib/clang/clang.build.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk index 0d3151178eb9..fb64b16935f2 100644 --- a/lib/clang/clang.build.mk +++ b/lib/clang/clang.build.mk @@ -13,4 +13,6 @@ CFLAGS+= -DCLANG_ENABLE_ARCMT CFLAGS+= -DCLANG_ENABLE_STATIC_ANALYZER .endif +CFLAGS.gcc+= -fno-strict-aliasing + .include "llvm.build.mk"