From owner-svn-src-head@freebsd.org Fri Dec 27 04:00:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 866421E1A35; Fri, 27 Dec 2019 04:00:05 +0000 (UTC) (envelope-from jhibbits@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47kY4j31Nvz4fVf; Fri, 27 Dec 2019 04:00:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B15B17B; Fri, 27 Dec 2019 04:00:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBR40552048756; Fri, 27 Dec 2019 04:00:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBR405Fx048755; Fri, 27 Dec 2019 04:00:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912270400.xBR405Fx048755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 27 Dec 2019 04:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356112 - in head/contrib/llvm-project: clang/lib/Basic/Targets llvm/lib/Target/PowerPC X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/contrib/llvm-project: clang/lib/Basic/Targets llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 356112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2019 04:00:05 -0000 Author: jhibbits Date: Fri Dec 27 04:00:04 2019 New Revision: 356112 URL: https://svnweb.freebsd.org/changeset/base/356112 Log: [PowerPC64] Starting from FreeBSD 13.0, default to ELFv2 ABI This changes the LLVM default powerpc64 ABI to ELFv2, if target OS is FreeBSD >= 13.0 This will also be sent upstream. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: dim, luporl Relnotes: YES Differential Revision: https://reviews.freebsd.org/D20383 Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Dec 27 03:54:27 2019 (r356111) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Dec 27 04:00:04 2019 (r356112) @@ -375,12 +375,29 @@ class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public IntMaxType = SignedLong; Int64Type = SignedLong; + if (Triple.getEnvironment() != llvm::Triple::UnknownEnvironment) { + switch (Triple.getEnvironment()){ + case llvm::Triple::ELFv1: + ABI = "elfv1"; + break; + default: + ABI = "elfv2"; + break; + } + } else { + if ((Triple.getOS() == llvm::Triple::FreeBSD) && + (Triple.getOSMajorVersion() < 13)) { + ABI = "elfv1"; + } else { + ABI = "elfv2"; + } + } + + if ((Triple.getArch() == llvm::Triple::ppc64le)) { resetDataLayout("e-m:e-i64:64-n32:64"); - ABI = "elfv2"; } else { resetDataLayout("E-m:e-i64:64-n32:64"); - ABI = Triple.getEnvironment() == llvm::Triple::ELFv2 ? "elfv2" : "elfv1"; } if (Triple.getOS() == llvm::Triple::AIX) Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Fri Dec 27 03:54:27 2019 (r356111) +++ head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Fri Dec 27 04:00:04 2019 (r356112) @@ -209,6 +209,20 @@ static PPCTargetMachine::PPCABI computeTargetABI(const if (TT.isMacOSX()) return PPCTargetMachine::PPC_ABI_UNKNOWN; + if (TT.isOSFreeBSD()) { + switch (TT.getArch()) { + case Triple::ppc64le: + case Triple::ppc64: + if (TT.getOSMajorVersion() >= 13) + return PPCTargetMachine::PPC_ABI_ELFv2; + else + return PPCTargetMachine::PPC_ABI_ELFv1; + case Triple::ppc: + default: + return PPCTargetMachine::PPC_ABI_UNKNOWN; + } + } + switch (TT.getArch()) { case Triple::ppc64le: return PPCTargetMachine::PPC_ABI_ELFv2;