From nobody Tue Feb 21 13:38:59 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 4PLgP00SKyz3sfkk; Tue, 21 Feb 2023 13:39:00 +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 4PLgNz6xgvz4L0d; Tue, 21 Feb 2023 13:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676986740; 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=Uy24Vh0uz882O6ttRaTz42ABAi/ycupWoKCcVfyVNiM=; b=Pgy3w4zi39k549rWK4svWIjr8xsQb2KVQsAiKwNEYLbrBdf9R6Y5JfZtET5qyHdIgNGU9w x42fYiK00Jw0QqQxjq8xvTOOtlLf27OPPDlkbLZKpNHOi0phza5D2Xf1BDAurZ6DQulCmP +CSdt4De24mWUcxh1UoI5yh1K4OWH5USGpwIykJvu/5wRYcnmR+kTQjrkLfxKV788N8YBb pNc94jk+x7S+ArkVpoAIjPPzZLWIaXpKIR9Mz/fAjaef3wTEjxw4R9SLe7mjUpY/UNucg7 mp40wiwn8g9JhpvOf2eppRMThk2jbu9nXBKEIam43u3hGsj4BNtsBhhQzGkkCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676986740; 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=Uy24Vh0uz882O6ttRaTz42ABAi/ycupWoKCcVfyVNiM=; b=WXm+Pia2B8/HuWdytwRzFWv06TWhn2lE1MRAnTC1QCB42/xxzsfYEZTBFtSY7aV0Vb+/RV 3WwhS2Qg6qHfXav1H8UJXXxuWffjFIM378pbju574AjvRR5/zQCC67VJ8cwmfJpbJmZCmg 1L74Em1XzrCdT9NaK6uGLF/aICuG9R4niF1OIy5bAyaSIuLUQhz8b0l6fchU5exJBEj6a1 Slv4k4tpiLHJOQ7Gysyn8DdieCDMtio2MxAoB7FptDFFyQ8ESu9C0U5kMm8TdZtTVDsbIT N7N4l19doosiHhfyT1ge0e2Zkq6NtYIYd8CTjXyOm6GSOYeKrMcxbyAVY9v7OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676986740; a=rsa-sha256; cv=none; b=OAn/kVGMsKbEwAH15mgRySCoCnMG6fmYcdyCh4X1QndIk+cAq9Hg4j7XmiOudzBvAjf6C9 VBz/MLwcXC7ul9jGocubPipjWd25ffbOGHi/DAfiVxZ7y1/2KrSDGwrKUUwliK/6VlVBac HvSZ8h0RQYsvJK2GalAEOp5n4BKiM59sLBy+7cUZBr/AAbHU8uEeAA1VpiHpo/DAXL/1wc iIt6QleN/fs1PP7bsL4VGjAR6Kxpajq6NFsuWubzar/V0Zqz6W77wOKJKuvOqo/i0+9zDv 40YmIZ8qc1Cm3kEMQlQXH8cy7LPN7BSl8SGmS7jrt8wuBSy83/4N+8TTXXsPug== 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 4PLgNz5mpvzNGF; Tue, 21 Feb 2023 13:38:59 +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 31LDcxYU079499; Tue, 21 Feb 2023 13:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LDcxPF079498; Tue, 21 Feb 2023 13:38:59 GMT (envelope-from git) Date: Tue, 21 Feb 2023 13:38:59 GMT Message-Id: <202302211338.31LDcxPF079498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 50796dea719a - releng/13.2 - llvm: make sure to use ELFv2 ABI on powerpc64 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: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 50796dea719a4ca2e26376eaab67eafd94532fee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=50796dea719a4ca2e26376eaab67eafd94532fee commit 50796dea719a4ca2e26376eaab67eafd94532fee Author: Piotr Kubaj AuthorDate: 2023-02-16 23:49:43 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-21 13:38:43 +0000 llvm: make sure to use ELFv2 ABI on powerpc64 Currently LLVM is more or less set up to use ELFv2, but it still defaults to ELFv1 in some places. This causes lld to generate broken binaries when used with LTO. PR: 269455 Approved by: dim, re (cpercival) MFC after: 3 days (cherry picked from commit a1ffc2fe9ce54a498c410dcab86495569dbaa7cc) (cherry picked from commit 8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6) --- contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 3 +++ contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h index ac52eb219f54..cd9bf0d8e359 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h @@ -425,6 +425,9 @@ public: } else if ((Triple.getArch() == llvm::Triple::ppc64le)) { DataLayout = "e-m:e-i64:64-n32:64"; ABI = "elfv2"; + } else if (Triple.isOSFreeBSD() && (Triple.getOSMajorVersion() == 0 || Triple.getOSMajorVersion() >= 13)) { + DataLayout = "E-m:e-i64:64-n32:64"; + ABI = "elfv2"; } else { DataLayout = "E-m:e-i64:64-n32:64"; ABI = "elfv1"; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 3eff00fc3c05..9b7145aafead 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -221,8 +221,11 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, assert(Options.MCOptions.getABIName().empty() && "Unknown target-abi option!"); - if (TT.isMacOSX()) + if (TT.isMacOSX()) { return PPCTargetMachine::PPC_ABI_UNKNOWN; + } else if (TT.isOSFreeBSD() && TT.getArch() == Triple::ppc64 && (TT.getOSMajorVersion() == 0 || TT.getOSMajorVersion() >= 13)) { + return PPCTargetMachine::PPC_ABI_ELFv2; + } switch (TT.getArch()) { case Triple::ppc64le: