From nobody Thu Jul 20 19:55:47 2023 X-Original-To: dev-commits-ports-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 4R6Nj012Y1z4ntyS; Thu, 20 Jul 2023 19:55:48 +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 4R6Nhz5vXbz4Q7S; Thu, 20 Jul 2023 19:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689882947; 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=Vl1ORAQGn6I867hPCFkbiUA/pe2InR9R+wnKFePRxPI=; b=KtgR0+0soujO24WOIp7bJ0E0pR20F1SRftGcLz2rZ+g7IAvKjExAPWfM2gmrU5QtGgiCu0 K3rtb0VW3u5a+G0uRu+RjmnxHkXEQHWPSYip8fMD00MQhfsmpsivk1W9KIyxWBkZu15Y3i FbbbJq+hfPawljxmg0CUSlVE5ApNzxuDfaPixOIBo8SbAUEcwMLAyBrlDRSCn4VfNtglLH wjG0qVAYU3zwP4Lna0T3f2k/V6+VXWO20oxBSbje9UbY8ienwWuH3XeEKf301CVoNO+xOX uwrsnI1FAQ53r2uxvmLqff89syd4nXxIX3bztEkj2OqFyg/SrRtgzf+Q3E4YRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689882947; 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=Vl1ORAQGn6I867hPCFkbiUA/pe2InR9R+wnKFePRxPI=; b=sZssDIjrvVs1NOhRdYjppu/NUVcvLjY2mP+vF3VfldKwZGku76Z+hxkhYcZZTPI13ZMODf ZcG8feRp9p+Avo1st1XD+iiKkKhEKmf2BknP0UGRZwRVXUkrWcaPN/JbFtAj6D9y2nhMe7 oNBn4+lA3M80QVqN8MAgE+Xcdu0qPQHMdAOQRjYJ4BkDamGzkPlLIY4+mv/gZaOzkfpA0j n5zhUeg+Qy/4L9aXGIT63qwjKP//1FfVbln89ld7mPMWb+HB5lcplkwFhKXFT5mezgtlZk C3W+farIQcnrBTr8EBDAXS/ok90h1SroUdNfPkAxqjm3V7hYFQCRdPdDLkADiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689882947; a=rsa-sha256; cv=none; b=p9MQ87hmLzU12mpZXjBejbTwuGKinNCtBb2LkeE0dYkYJQ1lszhtDckGCkfDlyihgBuLon 1TQBikqOx1e/RGwRQxe6B1Yil7rlIldjc3u4JkBM+ZYEVigbu4wEt5/EnFZ8gEwTR+LErP BCAFnoId8auXu3aF/rkyvqcgx/N08EF1n62plmL0pauiWV6osVHxsngyqjlLlskQ7h2ZK6 qzI8lt0siCWXyp9S6Uzs0syCLnHJuwMrnTGQIdSrrPVlNWuHgXIx2V50rrbZDBz00UsGXO phtpCkMP1CewCCVhC5xOCRZWo7DL/fvZD239FXZRRe9MBq/OprgoLaC66dL/DA== 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 4R6Nhz4ZcGzjjq; Thu, 20 Jul 2023 19:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KJtlBB053045; Thu, 20 Jul 2023 19:55:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KJtl22053044; Thu, 20 Jul 2023 19:55:47 GMT (envelope-from git) Date: Thu, 20 Jul 2023 19:55:47 GMT Message-Id: <202307201955.36KJtl22053044@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Brooks Davis Subject: git: e086c6a53f34 - 2023Q3 - devel/llvm13: arm and aarch64 improvements List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/2023Q3 X-Git-Reftype: branch X-Git-Commit: e086c6a53f3442fb5af0d308cdeca9cf4beac544 Auto-Submitted: auto-generated The branch 2023Q3 has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=e086c6a53f3442fb5af0d308cdeca9cf4beac544 commit e086c6a53f3442fb5af0d308cdeca9cf4beac544 Author: Brooks Davis AuthorDate: 2023-07-12 18:59:33 +0000 Commit: Brooks Davis CommitDate: 2023-07-20 18:33:45 +0000 devel/llvm13: arm and aarch64 improvements Change clang to allow -m32 on arm64. This is a backport from upstream and will be merged to FreeBSD head soon. See D40943 for more info. Remove an obsolete patch which breaks arm64. [0] When BE_NATIVE is specified on aarch64, include the ARM (32-bit) backend. PR: 271616 [0] Reported by: jfc@mit.edu [0] (cherry picked from commit 391873c7b9a02d9fdb5cce4dc79630ec3320702c) --- devel/llvm13/Makefile | 4 +- devel/llvm13/files/patch-backport-3450272fc2 | 32 ++++++++++ devel/llvm13/files/patch-freebsd-r352318 | 93 ---------------------------- 3 files changed, 34 insertions(+), 95 deletions(-) diff --git a/devel/llvm13/Makefile b/devel/llvm13/Makefile index 477202bde2db..5eea182e164e 100644 --- a/devel/llvm13/Makefile +++ b/devel/llvm13/Makefile @@ -1,6 +1,6 @@ PORTNAME= llvm DISTVERSION= 13.0.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= devel lang MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR} @@ -321,7 +321,7 @@ FREEBSD_BACKENDS= ${_FREEBSD_BACKENDS} .if ${ARCH} == amd64 _NATIVE_BACKENDS= X86 .elif ${ARCH} == aarch64 -_NATIVE_BACKENDS= AArch64 +_NATIVE_BACKENDS= AArch64 ARM .elif ${ARCH:Marmv*} _NATIVE_BACKENDS= ARM .elif ${ARCH} == i386 diff --git a/devel/llvm13/files/patch-backport-3450272fc2 b/devel/llvm13/files/patch-backport-3450272fc2 new file mode 100644 index 000000000000..3b5b5bb99a8f --- /dev/null +++ b/devel/llvm13/files/patch-backport-3450272fc2 @@ -0,0 +1,32 @@ +commit 3450272fc281979388bb845a9fffb59b42cc2e7e +Author: Jessica Clarke +Date: Mon Jul 10 01:40:58 2023 +0100 + + [Driver][FreeBSD] Generalise lib32 handling to support arm + + The current code maintains its own list of 32-bit architectures for + which there is a 64-bit FreeBSD architecture that supports it for lib32. + This is unnecessary (if it's not supported, the directory just won't + exist), and means that, when FreeBSD gains lib32 support for a new + architecture, you need an updated toolchain that knows about it. + Instead we can check for any 32-bit architecture and have forwards + compatibility. + + This is motivated by FreeBSD adding support for building arm lib32 + libraries on aarch64. + + Co-authored-by: Mike Karels + +diff --git clang/lib/Driver/ToolChains/FreeBSD.cpp clang/lib/Driver/ToolChains/FreeBSD.cpp +--- clang/lib/Driver/ToolChains/FreeBSD.cpp.orig 2022-06-22 17:46:24.000000000 +0100 ++++ clang/lib/Driver/ToolChains/FreeBSD.cpp 2023-07-12 18:38:47.053029000 +0100 +@@ -385,8 +385,7 @@ + + // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall + // back to '/usr/lib' if it doesn't exist. +- if ((Triple.getArch() == llvm::Triple::x86 || Triple.isMIPS32() || +- Triple.isPPC32()) && ++ if (Triple.isArch32Bit() && + D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o")) + getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32"); + else diff --git a/devel/llvm13/files/patch-freebsd-r352318 b/devel/llvm13/files/patch-freebsd-r352318 deleted file mode 100644 index 4fe5c836b6ea..000000000000 --- a/devel/llvm13/files/patch-freebsd-r352318 +++ /dev/null @@ -1,93 +0,0 @@ -commit 24b1a5b926832f68fa0a008b2484d4b44f58ee8e -Author: dim -Date: Sat Sep 14 10:55:33 2019 +0000 - - Revert commit from upstream llvm trunk (by Hans Wennborg): - - Re-commit r357452 (take 3): "SimplifyCFG - SinkCommonCodeFromPredecessors: Also sink function calls without used - results (PR41259)" - - Third time's the charm. - - This was reverted in r363220 due to being suspected of an internal - benchmark regression and a test failure, none of which turned out to - be caused by this. - - As reported in https://bugs.llvm.org/show_bug.cgi?id=43269, this causes - UNREACHABLE errors when compiling if_malo_pci.c for arm and aarch64. - -Notes: - svn path=/projects/clang900-import/; revision=352318 - -diff --git lib/Transforms/Utils/SimplifyCFG.cpp lib/Transforms/Utils/SimplifyCFG.cpp -index 11651d040dc0..6e2ef67408d9 100644 ---- llvm/lib/Transforms/Utils/SimplifyCFG.cpp -+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp -@@ -1428,10 +1428,9 @@ static bool HoistThenElseCodeToIf(BranchInst *BI, - static bool canSinkInstructions( - ArrayRef Insts, - DenseMap> &PHIOperands) { -- // Prune out obviously bad instructions to move. Each instruction must have -- // exactly zero or one use, and we check later that use is by a single, common -- // PHI instruction in the successor. -- bool HasUse = !Insts.front()->user_empty(); -+ // Prune out obviously bad instructions to move. Any non-store instruction -+ // must have exactly one use, and we check later that use is by a single, -+ // common PHI instruction in the successor. - for (auto *I : Insts) { - // These instructions may change or break semantics if moved. - if (isa(I) || I->isEHPad() || isa(I) || -@@ -1445,10 +1444,9 @@ static bool canSinkInstructions( - if (C->isInlineAsm()) - return false; - -- // Each instruction must have zero or one use. -- if (HasUse && !I->hasOneUse()) -- return false; -- if (!HasUse && !I->user_empty()) -+ // Everything must have only one use too, apart from stores which -+ // have no uses. -+ if (!isa(I) && !I->hasOneUse()) - return false; - } - -@@ -1457,11 +1455,11 @@ static bool canSinkInstructions( - if (!I->isSameOperationAs(I0)) - return false; - -- // All instructions in Insts are known to be the same opcode. If they have a -- // use, check that the only user is a PHI or in the same block as the -- // instruction, because if a user is in the same block as an instruction we're -- // contemplating sinking, it must already be determined to be sinkable. -- if (HasUse) { -+ // All instructions in Insts are known to be the same opcode. If they aren't -+ // stores, check the only user of each is a PHI or in the same block as the -+ // instruction, because if a user is in the same block as an instruction -+ // we're contemplating sinking, it must already be determined to be sinkable. -+ if (!isa(I0)) { - auto *PNUse = dyn_cast(*I0->user_begin()); - auto *Succ = I0->getParent()->getTerminator()->getSuccessor(0); - if (!all_of(Insts, [&PNUse,&Succ](const Instruction *I) -> bool { -@@ -1539,7 +1537,7 @@ static bool sinkLastInstruction(ArrayRef Blocks) { - // it is slightly over-aggressive - it gets confused by commutative instructions - // so double-check it here. - Instruction *I0 = Insts.front(); -- if (!I0->user_empty()) { -+ if (!isa(I0)) { - auto *PNUse = dyn_cast(*I0->user_begin()); - if (!all_of(Insts, [&PNUse](const Instruction *I) -> bool { - auto *U = cast(*I->user_begin()); -@@ -1597,10 +1595,11 @@ static bool sinkLastInstruction(ArrayRef Blocks) { - I0->andIRFlags(I); - } - -- if (!I0->user_empty()) { -+ if (!isa(I0)) { - // canSinkLastInstruction checked that all instructions were used by - // one and only one PHI node. Find that now, RAUW it to our common - // instruction and nuke it. -+ assert(I0->hasOneUse()); - auto *PN = cast(*I0->user_begin()); - PN->replaceAllUsesWith(I0); - PN->eraseFromParent();