FreeBSD Bugzilla – Attachment 187613 Details for
Bug 223342
lang/rust: unbreak cfg_target_feature for PORT_LLVM=on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v0
rust.port_llvm.diff (text/plain), 6.66 KB, created by
Jan Beich
on 2017-10-31 15:03:57 UTC
(
hide
)
Description:
v0
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2017-10-31 15:03:57 UTC
Size:
6.66 KB
patch
obsolete
>From 2e9910153c037d4bd4c7641486af938de1af7131 Mon Sep 17 00:00:00 2001 >From: Jan Beich <jbeich@FreeBSD.org> >Date: Tue, 31 Oct 2017 14:10:27 +0000 >Subject: [PATCH] lang/rust: unbreak cfg_target_feature for PORT_LLVM=on > >PR: 223342 >Approved by: rust !!! NOT YET !!! >Approved by: brooks !!! NOT YET !!! >--- > devel/llvm-devel/Makefile | 1 + > .../files/patch-include_llvm_MC_MCSubtargetInfo.h | 22 ++++++++++++++++++++++ > devel/llvm40/Makefile | 2 +- > .../files/patch-include_llvm_MC_MCSubtargetInfo.h | 22 ++++++++++++++++++++++ > devel/llvm50/Makefile | 2 +- > .../files/patch-include_llvm_MC_MCSubtargetInfo.h | 22 ++++++++++++++++++++++ > lang/rust/Makefile | 2 +- > lang/rust/files/patch-src_rustllvm_PassWrapper.cpp | 22 ++++++++++++++++++++++ > 8 files changed, 92 insertions(+), 3 deletions(-) > create mode 100644 devel/llvm-devel/files/patch-include_llvm_MC_MCSubtargetInfo.h > create mode 100644 devel/llvm40/files/patch-include_llvm_MC_MCSubtargetInfo.h > create mode 100644 devel/llvm50/files/patch-include_llvm_MC_MCSubtargetInfo.h > create mode 100644 lang/rust/files/patch-src_rustllvm_PassWrapper.cpp > >diff --git a/devel/llvm-devel/Makefile b/devel/llvm-devel/Makefile >index 8d10ee1f8023..86530b8b5d84 100644 >--- a/devel/llvm-devel/Makefile >+++ b/devel/llvm-devel/Makefile >@@ -3,6 +3,7 @@ > > PORTNAME= llvm > PORTVERSION= ${LLVM_MAJOR}.d${SNAPDATE} >+PORTREVISION= 1 > CATEGORIES= devel lang > PKGNAMESUFFIX= -devel > >diff --git a/devel/llvm-devel/files/patch-include_llvm_MC_MCSubtargetInfo.h b/devel/llvm-devel/files/patch-include_llvm_MC_MCSubtargetInfo.h >new file mode 100644 >index 000000000000..13afab8456e2 >--- /dev/null >+++ b/devel/llvm-devel/files/patch-include_llvm_MC_MCSubtargetInfo.h >@@ -0,0 +1,22 @@ >+Add accessors for MCSubtargetInfo CPU and Feature tables >+https://github.com/rust-lang/llvm/commit/68e1e29618b >+ >+Required by lang/rust when built with PORT_LLVM=on >+ >+--- include/llvm/MC/MCSubtargetInfo.h.orig 2017-10-23 10:24:19 UTC >++++ include/llvm/MC/MCSubtargetInfo.h >+@@ -180,6 +180,14 @@ class MCSubtargetInfo { (public) >+ return Found != ProcDesc.end() && StringRef(Found->Key) == CPU; >+ } >+ >++ ArrayRef<SubtargetFeatureKV> getCPUTable() const { >++ return ProcDesc; >++ } >++ >++ ArrayRef<SubtargetFeatureKV> getFeatureTable() const { >++ return ProcFeatures; >++ } >++ >+ /// Returns string representation of scheduler comment >+ virtual std::string getSchedInfoStr(const MachineInstr &MI) const { >+ return {}; >diff --git a/devel/llvm40/Makefile b/devel/llvm40/Makefile >index ac6f0f81e78b..0b97d6c34445 100644 >--- a/devel/llvm40/Makefile >+++ b/devel/llvm40/Makefile >@@ -2,7 +2,7 @@ > > PORTNAME= llvm > DISTVERSION= 4.0.1 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= devel lang > MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR} > PKGNAMESUFFIX= ${LLVM_SUFFIX} >diff --git a/devel/llvm40/files/patch-include_llvm_MC_MCSubtargetInfo.h b/devel/llvm40/files/patch-include_llvm_MC_MCSubtargetInfo.h >new file mode 100644 >index 000000000000..3ad194b92e0e >--- /dev/null >+++ b/devel/llvm40/files/patch-include_llvm_MC_MCSubtargetInfo.h >@@ -0,0 +1,22 @@ >+Add accessors for MCSubtargetInfo CPU and Feature tables >+https://github.com/rust-lang/llvm/commit/68e1e29618b >+ >+Required by lang/rust when built with PORT_LLVM=on >+ >+--- include/llvm/MC/MCSubtargetInfo.h.orig 2016-04-18 09:17:29 UTC >++++ include/llvm/MC/MCSubtargetInfo.h >+@@ -164,6 +164,14 @@ class MCSubtargetInfo { (public) >+ auto Found = std::lower_bound(ProcDesc.begin(), ProcDesc.end(), CPU); >+ return Found != ProcDesc.end() && StringRef(Found->Key) == CPU; >+ } >++ >++ ArrayRef<SubtargetFeatureKV> getCPUTable() const { >++ return ProcDesc; >++ } >++ >++ ArrayRef<SubtargetFeatureKV> getFeatureTable() const { >++ return ProcFeatures; >++ } >+ }; >+ >+ } // End llvm namespace >diff --git a/devel/llvm50/Makefile b/devel/llvm50/Makefile >index 8871772a1c98..b8e7ba5c2784 100644 >--- a/devel/llvm50/Makefile >+++ b/devel/llvm50/Makefile >@@ -2,7 +2,7 @@ > > PORTNAME= llvm > DISTVERSION= 5.0.0 >-PORTREVISION= 4 >+PORTREVISION= 5 > CATEGORIES= devel lang > MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR} > PKGNAMESUFFIX= ${LLVM_SUFFIX} >diff --git a/devel/llvm50/files/patch-include_llvm_MC_MCSubtargetInfo.h b/devel/llvm50/files/patch-include_llvm_MC_MCSubtargetInfo.h >new file mode 100644 >index 000000000000..af5721b66303 >--- /dev/null >+++ b/devel/llvm50/files/patch-include_llvm_MC_MCSubtargetInfo.h >@@ -0,0 +1,22 @@ >+Add accessors for MCSubtargetInfo CPU and Feature tables >+https://github.com/rust-lang/llvm/commit/68e1e29618b >+ >+Required by lang/rust when built with PORT_LLVM=on >+ >+--- include/llvm/MC/MCSubtargetInfo.h.orig 2017-04-26 22:31:39 UTC >++++ include/llvm/MC/MCSubtargetInfo.h >+@@ -176,6 +176,14 @@ class MCSubtargetInfo { (public) >+ return Found != ProcDesc.end() && StringRef(Found->Key) == CPU; >+ } >+ >++ ArrayRef<SubtargetFeatureKV> getCPUTable() const { >++ return ProcDesc; >++ } >++ >++ ArrayRef<SubtargetFeatureKV> getFeatureTable() const { >++ return ProcFeatures; >++ } >++ >+ /// Returns string representation of scheduler comment >+ virtual std::string getSchedInfoStr(const MachineInstr &MI) const { >+ return {}; >diff --git a/lang/rust/Makefile b/lang/rust/Makefile >index 2bf85361a4e3..440bd8138076 100644 >--- a/lang/rust/Makefile >+++ b/lang/rust/Makefile >@@ -3,7 +3,7 @@ > > PORTNAME= rust > PORTVERSION?= 1.21.0 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= lang > MASTER_SITES= http://static.rust-lang.org/dist/:src \ > LOCAL/dumbbell/rust:rust_bootstrap \ >diff --git a/lang/rust/files/patch-src_rustllvm_PassWrapper.cpp b/lang/rust/files/patch-src_rustllvm_PassWrapper.cpp >new file mode 100644 >index 000000000000..12cef07beeb7 >--- /dev/null >+++ b/lang/rust/files/patch-src_rustllvm_PassWrapper.cpp >@@ -0,0 +1,22 @@ >+Assume devel/llvm* has rust-lang/llvm@68e1e29618b >+ >+--- src/rustllvm/PassWrapper.cpp.orig 2017-10-09 20:04:51 UTC >++++ src/rustllvm/PassWrapper.cpp >+@@ -178,7 +178,7 @@ GEN_SUBTARGETS >+ >+ extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM, >+ const char *Feature) { >+-#if LLVM_RUSTLLVM >++#if LLVM_RUSTLLVM || LLVM_VERSION_GE(4, 0) >+ TargetMachine *Target = unwrap(TM); >+ const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); >+ const FeatureBitset &Bits = MCInfo->getFeatureBits(); >+@@ -286,7 +286,7 @@ static Optional<Reloc::Model> fromRust(LLVMRustRelocMo >+ llvm_unreachable("Bad RelocModel."); >+ } >+ >+-#if LLVM_RUSTLLVM >++#if LLVM_RUSTLLVM || LLVM_VERSION_GE(4, 0) >+ /// getLongestEntryLength - Return the length of the longest entry in the table. >+ /// >+ static size_t getLongestEntryLength(ArrayRef<SubtargetFeatureKV> Table) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbeich
:
maintainer-approval?
(
rust
)
jbeich
:
maintainer-approval?
(
brooks
)
Actions:
View
|
Diff
Attachments on
bug 223342
: 187613