!3 Update the rust to 1.30.0-1
Merge pull request !3 from yaokai13/master
This commit is contained in:
commit
2d4dca0404
@ -1,186 +0,0 @@
|
||||
From 4b95b1a4fd035a73998dc21b265ce4594e35f8ae Mon Sep 17 00:00:00 2001
|
||||
From: Alex Crichton <alex@alexcrichton.com>
|
||||
Date: Thu, 16 Aug 2018 13:19:04 -0700
|
||||
Subject: [PATCH] Set more llvm function attributes for __rust_try
|
||||
|
||||
This shim is generated elsewhere in the compiler so this commit adds support to
|
||||
ensure it goes through similar paths as the rest of the compiler to set llvm
|
||||
function attributes like target features.
|
||||
|
||||
cc #53372
|
||||
---
|
||||
src/librustc_codegen_llvm/attributes.rs | 52 +++++++++++++++++++------
|
||||
src/librustc_codegen_llvm/base.rs | 21 ----------
|
||||
src/librustc_codegen_llvm/callee.rs | 2 +-
|
||||
src/librustc_codegen_llvm/intrinsic.rs | 2 +
|
||||
src/librustc_codegen_llvm/mono_item.rs | 2 +-
|
||||
5 files changed, 44 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs
|
||||
index 3b5f927d52f0..2a79ce2f2285 100644
|
||||
--- a/src/librustc_codegen_llvm/attributes.rs
|
||||
+++ b/src/librustc_codegen_llvm/attributes.rs
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
use std::ffi::{CStr, CString};
|
||||
|
||||
-use rustc::hir::CodegenFnAttrFlags;
|
||||
+use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs};
|
||||
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc::session::Session;
|
||||
use rustc::session::config::Sanitizer;
|
||||
@@ -123,11 +123,37 @@ pub fn llvm_target_features(sess: &Session) -> impl Iterator<Item = &str> {
|
||||
|
||||
/// Composite function which sets LLVM attributes for function depending on its AST (#[attribute])
|
||||
/// attributes.
|
||||
-pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
|
||||
- let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(id);
|
||||
+pub fn from_fn_attrs(
|
||||
+ cx: &CodegenCx,
|
||||
+ llfn: ValueRef,
|
||||
+ id: Option<DefId>,
|
||||
+) {
|
||||
+ let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id))
|
||||
+ .unwrap_or(CodegenFnAttrs::new());
|
||||
|
||||
inline(llfn, codegen_fn_attrs.inline);
|
||||
|
||||
+ // The `uwtable` attribute according to LLVM is:
|
||||
+ //
|
||||
+ // This attribute indicates that the ABI being targeted requires that an
|
||||
+ // unwind table entry be produced for this function even if we can show
|
||||
+ // that no exceptions passes by it. This is normally the case for the
|
||||
+ // ELF x86-64 abi, but it can be disabled for some compilation units.
|
||||
+ //
|
||||
+ // Typically when we're compiling with `-C panic=abort` (which implies this
|
||||
+ // `no_landing_pads` check) we don't need `uwtable` because we can't
|
||||
+ // generate any exceptions! On Windows, however, exceptions include other
|
||||
+ // events such as illegal instructions, segfaults, etc. This means that on
|
||||
+ // Windows we end up still needing the `uwtable` attribute even if the `-C
|
||||
+ // panic=abort` flag is passed.
|
||||
+ //
|
||||
+ // You can also find more info on why Windows is whitelisted here in:
|
||||
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
|
||||
+ if !cx.sess().no_landing_pads() ||
|
||||
+ cx.sess().target.target.options.requires_uwtable {
|
||||
+ attributes::emit_uwtable(llfn, true);
|
||||
+ }
|
||||
+
|
||||
set_frame_pointer_elimination(cx, llfn);
|
||||
set_probestack(cx, llfn);
|
||||
|
||||
@@ -151,7 +177,7 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
|
||||
// *in Rust code* may unwind. Foreign items like `extern "C" {
|
||||
// fn foo(); }` are assumed not to unwind **unless** they have
|
||||
// a `#[unwind]` attribute.
|
||||
- } else if !cx.tcx.is_foreign_item(id) {
|
||||
+ } else if id.map(|id| !cx.tcx.is_foreign_item(id)).unwrap_or(false) {
|
||||
Some(true)
|
||||
} else {
|
||||
None
|
||||
@@ -188,14 +214,16 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
|
||||
// Note that currently the `wasm-import-module` doesn't do anything, but
|
||||
// eventually LLVM 7 should read this and ferry the appropriate import
|
||||
// module to the output file.
|
||||
- if cx.tcx.sess.target.target.arch == "wasm32" {
|
||||
- if let Some(module) = wasm_import_module(cx.tcx, id) {
|
||||
- llvm::AddFunctionAttrStringValue(
|
||||
- llfn,
|
||||
- llvm::AttributePlace::Function,
|
||||
- cstr("wasm-import-module\0"),
|
||||
- &module,
|
||||
- );
|
||||
+ if let Some(id) = id {
|
||||
+ if cx.tcx.sess.target.target.arch == "wasm32" {
|
||||
+ if let Some(module) = wasm_import_module(cx.tcx, id) {
|
||||
+ llvm::AddFunctionAttrStringValue(
|
||||
+ llfn,
|
||||
+ llvm::AttributePlace::Function,
|
||||
+ cstr("wasm-import-module\0"),
|
||||
+ &module,
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs
|
||||
index 223c04f420f3..b0461582ddcb 100644
|
||||
--- a/src/librustc_codegen_llvm/base.rs
|
||||
+++ b/src/librustc_codegen_llvm/base.rs
|
||||
@@ -486,27 +486,6 @@ pub fn codegen_instance<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, instance: Instance<'
|
||||
|
||||
cx.stats.borrow_mut().n_closures += 1;
|
||||
|
||||
- // The `uwtable` attribute according to LLVM is:
|
||||
- //
|
||||
- // This attribute indicates that the ABI being targeted requires that an
|
||||
- // unwind table entry be produced for this function even if we can show
|
||||
- // that no exceptions passes by it. This is normally the case for the
|
||||
- // ELF x86-64 abi, but it can be disabled for some compilation units.
|
||||
- //
|
||||
- // Typically when we're compiling with `-C panic=abort` (which implies this
|
||||
- // `no_landing_pads` check) we don't need `uwtable` because we can't
|
||||
- // generate any exceptions! On Windows, however, exceptions include other
|
||||
- // events such as illegal instructions, segfaults, etc. This means that on
|
||||
- // Windows we end up still needing the `uwtable` attribute even if the `-C
|
||||
- // panic=abort` flag is passed.
|
||||
- //
|
||||
- // You can also find more info on why Windows is whitelisted here in:
|
||||
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
|
||||
- if !cx.sess().no_landing_pads() ||
|
||||
- cx.sess().target.target.options.requires_uwtable {
|
||||
- attributes::emit_uwtable(lldecl, true);
|
||||
- }
|
||||
-
|
||||
let mir = cx.tcx.instance_mir(instance.def);
|
||||
mir::codegen_mir(cx, lldecl, &mir, instance, sig);
|
||||
}
|
||||
diff --git a/src/librustc_codegen_llvm/callee.rs b/src/librustc_codegen_llvm/callee.rs
|
||||
index 2c01bd42cc77..97f07792ede8 100644
|
||||
--- a/src/librustc_codegen_llvm/callee.rs
|
||||
+++ b/src/librustc_codegen_llvm/callee.rs
|
||||
@@ -97,7 +97,7 @@ pub fn get_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
|
||||
if instance.def.is_inline(tcx) {
|
||||
attributes::inline(llfn, attributes::InlineAttr::Hint);
|
||||
}
|
||||
- attributes::from_fn_attrs(cx, llfn, instance.def.def_id());
|
||||
+ attributes::from_fn_attrs(cx, llfn, Some(instance.def.def_id()));
|
||||
|
||||
let instance_def_id = instance.def_id();
|
||||
|
||||
diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs
|
||||
index 9c5c0f730c16..f69fce15dc55 100644
|
||||
--- a/src/librustc_codegen_llvm/intrinsic.rs
|
||||
+++ b/src/librustc_codegen_llvm/intrinsic.rs
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
+use attributes;
|
||||
use intrinsics::{self, Intrinsic};
|
||||
use llvm;
|
||||
use llvm::{ValueRef};
|
||||
@@ -936,6 +937,7 @@ fn gen_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
|
||||
Abi::Rust
|
||||
)));
|
||||
let llfn = declare::define_internal_fn(cx, name, rust_fn_ty);
|
||||
+ attributes::from_fn_attrs(cx, llfn, None);
|
||||
let bx = Builder::new_block(cx, llfn, "entry-block");
|
||||
codegen(bx);
|
||||
llfn
|
||||
diff --git a/src/librustc_codegen_llvm/mono_item.rs b/src/librustc_codegen_llvm/mono_item.rs
|
||||
index a528008e3b4b..32d8b24e3c15 100644
|
||||
--- a/src/librustc_codegen_llvm/mono_item.rs
|
||||
+++ b/src/librustc_codegen_llvm/mono_item.rs
|
||||
@@ -183,7 +183,7 @@ fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
|
||||
if instance.def.is_inline(cx.tcx) {
|
||||
attributes::inline(lldecl, attributes::InlineAttr::Hint);
|
||||
}
|
||||
- attributes::from_fn_attrs(cx, lldecl, instance.def.def_id());
|
||||
+ attributes::from_fn_attrs(cx, lldecl, Some(instance.def.def_id()));
|
||||
|
||||
cx.instances.borrow_mut().insert(instance, lldecl);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@ -1,122 +0,0 @@
|
||||
From f4e8d57b6ad6f599de54c020ba185db83cb011a3 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 16 Aug 2018 11:26:27 -0700
|
||||
Subject: [PATCH] std: stop backtracing when the frames are full
|
||||
|
||||
---
|
||||
src/libstd/sys/cloudabi/backtrace.rs | 18 ++++++++++--------
|
||||
src/libstd/sys/redox/backtrace/tracing.rs | 18 ++++++++++--------
|
||||
src/libstd/sys/unix/backtrace/tracing/gcc_s.rs | 18 ++++++++++--------
|
||||
3 files changed, 30 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/libstd/sys/cloudabi/backtrace.rs b/src/libstd/sys/cloudabi/backtrace.rs
|
||||
index 1b970187558c..2c43b5937ce5 100644
|
||||
--- a/src/libstd/sys/cloudabi/backtrace.rs
|
||||
+++ b/src/libstd/sys/cloudabi/backtrace.rs
|
||||
@@ -64,6 +64,10 @@ extern "C" fn trace_fn(
|
||||
arg: *mut libc::c_void,
|
||||
) -> uw::_Unwind_Reason_Code {
|
||||
let cx = unsafe { &mut *(arg as *mut Context) };
|
||||
+ if cx.idx >= cx.frames.len() {
|
||||
+ return uw::_URC_NORMAL_STOP;
|
||||
+ }
|
||||
+
|
||||
let mut ip_before_insn = 0;
|
||||
let mut ip = unsafe { uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void };
|
||||
if !ip.is_null() && ip_before_insn == 0 {
|
||||
@@ -73,14 +77,12 @@ extern "C" fn trace_fn(
|
||||
}
|
||||
|
||||
let symaddr = unsafe { uw::_Unwind_FindEnclosingFunction(ip) };
|
||||
- if cx.idx < cx.frames.len() {
|
||||
- cx.frames[cx.idx] = Frame {
|
||||
- symbol_addr: symaddr as *mut u8,
|
||||
- exact_position: ip as *mut u8,
|
||||
- inline_context: 0,
|
||||
- };
|
||||
- cx.idx += 1;
|
||||
- }
|
||||
+ cx.frames[cx.idx] = Frame {
|
||||
+ symbol_addr: symaddr as *mut u8,
|
||||
+ exact_position: ip as *mut u8,
|
||||
+ inline_context: 0,
|
||||
+ };
|
||||
+ cx.idx += 1;
|
||||
|
||||
uw::_URC_NO_REASON
|
||||
}
|
||||
diff --git a/src/libstd/sys/redox/backtrace/tracing.rs b/src/libstd/sys/redox/backtrace/tracing.rs
|
||||
index bb70ca360370..c0414b78f8d6 100644
|
||||
--- a/src/libstd/sys/redox/backtrace/tracing.rs
|
||||
+++ b/src/libstd/sys/redox/backtrace/tracing.rs
|
||||
@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame])
|
||||
extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
|
||||
arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code {
|
||||
let cx = unsafe { &mut *(arg as *mut Context) };
|
||||
+ if cx.idx >= cx.frames.len() {
|
||||
+ return uw::_URC_NORMAL_STOP;
|
||||
+ }
|
||||
+
|
||||
let mut ip_before_insn = 0;
|
||||
let mut ip = unsafe {
|
||||
uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void
|
||||
@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
|
||||
unsafe { uw::_Unwind_FindEnclosingFunction(ip) }
|
||||
};
|
||||
|
||||
- if cx.idx < cx.frames.len() {
|
||||
- cx.frames[cx.idx] = Frame {
|
||||
- symbol_addr: symaddr as *mut u8,
|
||||
- exact_position: ip as *mut u8,
|
||||
- inline_context: 0,
|
||||
- };
|
||||
- cx.idx += 1;
|
||||
- }
|
||||
+ cx.frames[cx.idx] = Frame {
|
||||
+ symbol_addr: symaddr as *mut u8,
|
||||
+ exact_position: ip as *mut u8,
|
||||
+ inline_context: 0,
|
||||
+ };
|
||||
+ cx.idx += 1;
|
||||
|
||||
uw::_URC_NO_REASON
|
||||
}
|
||||
diff --git a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
|
||||
index 1b92fc0e6ad0..6e8415686792 100644
|
||||
--- a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
|
||||
+++ b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
|
||||
@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame])
|
||||
extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
|
||||
arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code {
|
||||
let cx = unsafe { &mut *(arg as *mut Context) };
|
||||
+ if cx.idx >= cx.frames.len() {
|
||||
+ return uw::_URC_NORMAL_STOP;
|
||||
+ }
|
||||
+
|
||||
let mut ip_before_insn = 0;
|
||||
let mut ip = unsafe {
|
||||
uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void
|
||||
@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
|
||||
unsafe { uw::_Unwind_FindEnclosingFunction(ip) }
|
||||
};
|
||||
|
||||
- if cx.idx < cx.frames.len() {
|
||||
- cx.frames[cx.idx] = Frame {
|
||||
- symbol_addr: symaddr as *mut u8,
|
||||
- exact_position: ip as *mut u8,
|
||||
- inline_context: 0,
|
||||
- };
|
||||
- cx.idx += 1;
|
||||
- }
|
||||
+ cx.frames[cx.idx] = Frame {
|
||||
+ symbol_addr: symaddr as *mut u8,
|
||||
+ exact_position: ip as *mut u8,
|
||||
+ inline_context: 0,
|
||||
+ };
|
||||
+ cx.idx += 1;
|
||||
|
||||
uw::_URC_NO_REASON
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
36
README.en.md
36
README.en.md
@ -1,36 +0,0 @@
|
||||
# rust
|
||||
|
||||
#### Description
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
39
README.md
39
README.md
@ -1,39 +0,0 @@
|
||||
# rust
|
||||
|
||||
#### 介绍
|
||||
{**以下是码云平台说明,您可以替换此简介**
|
||||
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
||||
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 码云特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
|
||||
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
@ -1,26 +0,0 @@
|
||||
From 1ea2765918d1212a07e1359537470c477d82a681 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Mon, 30 Jul 2018 13:08:56 -0700
|
||||
Subject: [PATCH] run-pass/const-endianness: negate before to_le()
|
||||
|
||||
`const LE_I128` needs parentheses to negate the value *before* calling
|
||||
`to_le()`, otherwise it doesn't match the operations performed in the
|
||||
black-boxed part of the test. This only makes a tangible difference on
|
||||
big-endian targets.
|
||||
---
|
||||
src/test/run-pass/const-endianess.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/test/run-pass/const-endianess.rs b/src/test/run-pass/const-endianess.rs
|
||||
index fa34b49210a6..95c738d3ec49 100644
|
||||
--- a/src/test/run-pass/const-endianess.rs
|
||||
+++ b/src/test/run-pass/const-endianess.rs
|
||||
@@ -25,7 +25,7 @@ fn main() {
|
||||
#[cfg(not(target_arch = "asmjs"))]
|
||||
{
|
||||
const BE_U128: u128 = 999999u128.to_be();
|
||||
- const LE_I128: i128 = -999999i128.to_le();
|
||||
+ const LE_I128: i128 = (-999999i128).to_le();
|
||||
assert_eq!(BE_U128, b(999999u128).to_be());
|
||||
assert_eq!(LE_I128, b(-999999i128).to_le());
|
||||
}
|
||||
304
rust.spec
304
rust.spec
@ -1,32 +1,48 @@
|
||||
%global rustlibdir %{_prefix}/lib/rustlib
|
||||
%global rust_triple %{_target_cpu}-unknown-linux-gnu
|
||||
%global rust_arches x86_64 aarch64
|
||||
%global bootstrap_rust 1.29.1
|
||||
%global bootstrap_cargo 1.29.0
|
||||
%global bootstrap_channel %{bootstrap_rust}
|
||||
%global bootstrap_date 2018-10-12
|
||||
|
||||
Name: rust
|
||||
Version: 1.30.0
|
||||
Release: 1
|
||||
Summary: The Rust Programming Language
|
||||
License: (ASL 2.0 or MIT) and (BSD and MIT)
|
||||
URL: https://www.rust-lang.org
|
||||
ExclusiveArch: aarch64 x86_64
|
||||
Source0: https://static.rust-lang.org/dist/rustc-1.30.0-src.tar.xz
|
||||
|
||||
%{lua: function rust_triple(arch)
|
||||
local abi = "gnu"
|
||||
return arch.."-unknown-linux-"..abi
|
||||
end}
|
||||
%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
|
||||
|
||||
BuildRequires: cargo >= %{bootstrap_cargo}
|
||||
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= 1.30.0)
|
||||
BuildRequires: make gdb gcc gcc-c++ ncurses-devel curl
|
||||
BuildRequires: pkgconfig(libcurl) pkgconfig(liblzma)
|
||||
BuildRequires: pkgconfig(openssl) pkgconfig(zlib)
|
||||
BuildRequires: pkgconfig(libgit2) >= 0.27 pkgconfig(libssh2) >= 1.6.0
|
||||
BuildRequires: python3 cmake >= 2.8.11 llvm-devel >= 5.0
|
||||
BuildRequires: llvm-static libffi-devel procps-ng
|
||||
Provides: bundled(libbacktrace) = 8.1.0 bundled(miniz) = 1.16~beta+r1
|
||||
Provides: rustc = 1.30.0-%{release}
|
||||
Requires: %{name}-std-static = 1.30.0-%{release} /usr/bin/cc
|
||||
|
||||
%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
|
||||
%global __provides_exclude ^(%{_privatelibs})$
|
||||
%global __requires_exclude ^(%{_privatelibs})$
|
||||
%global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
|
||||
%global __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
|
||||
%global _find_debuginfo_opts --keep-section .rustc
|
||||
|
||||
Name: rust
|
||||
Version: 1.29.1
|
||||
Release: 3
|
||||
Summary: A systems programming language
|
||||
License: (ASL 2.0 or MIT) and (BSD and MIT)
|
||||
URL: https://www.rust-lang.org
|
||||
Source0: https://static.rust-lang.org/dist/rustc-1.29.1-src.tar.xz
|
||||
Patch0000: rust-52876-const-endianess.patch
|
||||
Patch0001: 0001-std-stop-backtracing-when-the-frames-are-full.patch
|
||||
Patch0002: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch
|
||||
BuildRequires: cargo >= 1.28.0 (%{name} >= 1.28.0 with %{name} <= 1.29.1)
|
||||
BuildRequires: make gcc-c++ ncurses-devel curl python3 cmake3 >= 3.4.3 procps-ng
|
||||
BuildRequires: pkgconfig(libcurl) pkgconfig(liblzma) pkgconfig(openssl) pkgconfig(zlib) gdb
|
||||
Requires: %{name}-devel = 1.29.1-%{release}
|
||||
Provides: bundled(llvm) = 7.0 bundled(libbacktrace) = 8.1.0 bundled(miniz) = 1.16~beta+r1
|
||||
Provides: rustc = 1.29.1-%{release}
|
||||
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
||||
|
||||
%description
|
||||
Rust is a systems programming language focused on three goals:safety,
|
||||
speed,and concurrency.It maintains these goals without having a garbage
|
||||
speed,and concurrency.It maintains these goals without having
|
||||
a garbage
|
||||
collector, making it a useful language for a number of use cases other
|
||||
languages are not good at: embedding in other languages, programs with
|
||||
specific space and time requirements,and writing low-level code, like
|
||||
@ -35,57 +51,66 @@ targeting this space by having a number of compile-time safety checks
|
||||
that produce no runtime overhead,while eliminating all data races.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries and header files for developing applications that use appstream-glib
|
||||
Provides: %{name}-std-static = %{version}-%{release}
|
||||
Obsoletes: %{name}-std-static < %{version}-%{release}
|
||||
|
||||
Summary: Libraries and header files for developing applications that use appstream-glib
|
||||
Provides: rust-std-static = %{version}-%{release}
|
||||
Obsoletes: rust-std-static < %{version}-%{release}
|
||||
%description devel
|
||||
Libraries and header files for developing applications that use appstream-glib.
|
||||
|
||||
%package debugger-common
|
||||
Summary: Common debugger pretty printers for Rust
|
||||
BuildArch: noarch
|
||||
|
||||
Summary: Common debugger pretty printers for Rust
|
||||
BuildArch: noarch
|
||||
%description debugger-common
|
||||
This package includes the common functionality for %{name}-gdb and %{name}-lldb.
|
||||
This package includes the common functionality for rust-gdb and rust-lldb.
|
||||
|
||||
%package gdb
|
||||
Summary: GDB pretty printers for Rust
|
||||
BuildArch: noarch
|
||||
Requires: gdb
|
||||
Requires: %{name}-debugger-common = 1.29.1-%{release}
|
||||
|
||||
Summary: GDB pretty printers for Rust
|
||||
BuildArch: noarch
|
||||
Requires: gdb rust-debugger-common = 1.30.0-%{release}
|
||||
%description gdb
|
||||
This package includes the rust-gdb script, which allows easier debugging of Rust
|
||||
programs.
|
||||
|
||||
%package -n cargo
|
||||
Summary: Rust's package manager and build tool
|
||||
Version: 1.29.0
|
||||
BuildRequires: git
|
||||
Requires: rust
|
||||
Provides: bundled(libgit2) = 0.27 bundled(libssh2) = 1.8.1
|
||||
%package lldb
|
||||
Summary: LLDB pretty printers for Rust
|
||||
Requires: lldb python2-lldb rust-debugger-common = 1.30.0-%{release}
|
||||
%description lldb
|
||||
This package includes the rust-lldb script, which allows easier debugging of Rust
|
||||
programs.
|
||||
|
||||
%package help
|
||||
Summary: Help documentation for Rust
|
||||
Provides: rust-doc = %{version}-%{release} cargo-doc = %{version}-%{release}
|
||||
Obsoletes: rust-doc < %{version}-%{release} cargo-doc < %{version}-%{release}
|
||||
%description help
|
||||
Man pages and other related help documents for rust.
|
||||
|
||||
%package -n cargo
|
||||
Summary: Rust's package manager and build tool
|
||||
Version: 1.30.0
|
||||
BuildRequires: git
|
||||
Provides: bundled(libgit2)= 0.27
|
||||
Requires: rust
|
||||
%description -n cargo
|
||||
Cargo is a tool that allows Rust projects to declare their various dependencies
|
||||
and ensure that you'll always get a repeatable build.
|
||||
|
||||
%package -n rustfmt-preview
|
||||
Summary: Tool to find and fix Rust formatting issues
|
||||
Version: 0.99.1
|
||||
Requires: cargo
|
||||
Provides: rustfmt = 0.99.1
|
||||
Obsoletes: rustfmt <= 0.9.0
|
||||
|
||||
%package -n rustfmt-preview
|
||||
Summary: Tool to find and fix Rust formatting issues
|
||||
Version: 0.99.4
|
||||
Requires: cargo
|
||||
Obsoletes: rustfmt <= 0.9.0
|
||||
Provides: rustfmt = 0.99.4
|
||||
%description -n rustfmt-preview
|
||||
A tool for formatting Rust code according to style guidelines.
|
||||
|
||||
%package -n rls-preview
|
||||
Summary: Rust Language Server for IDE integration
|
||||
Version: 0.130.0
|
||||
Provides: rls = 0.130.0 bundled(libgit2) = 0.27 bundled(libssh2) = 1.8.1
|
||||
Requires: rust-analysis %{name} = 1.29.1-%{release}
|
||||
|
||||
Summary: Rust Language Server for IDE integration
|
||||
Version: 0.130.5
|
||||
Provides: rls = 0.130.5
|
||||
Provides: bundled(libgit2) = 0.27
|
||||
Requires: rust-analysis rust = 1.30.0-%{release}
|
||||
%description -n rls-preview
|
||||
The Rust Language Server provides a server that runs in the background,
|
||||
providing IDEs, editors, and other tools with information about Rust programs.
|
||||
@ -93,138 +118,105 @@ It supports functionality such as 'goto definition', symbol search,
|
||||
reformatting, and code completion, and enables renaming and refactorings.
|
||||
|
||||
%package -n clippy-preview
|
||||
Summary: Lints to catch common mistakes and improve your Rust code
|
||||
Version: 0.0.212
|
||||
License: MPLv2.0
|
||||
Provides: clippy = 0.0.212
|
||||
Requires: cargo %{name} = 1.29.1-%{release}
|
||||
|
||||
Summary: Lints to catch common mistakes and improve your Rust code
|
||||
Version: 0.0.212
|
||||
License: MPLv2.0
|
||||
Provides: clippy = 0.0.212
|
||||
Requires: cargo rust = 1.30.0-%{release}
|
||||
%description -n clippy-preview
|
||||
A collection of lints to catch common mistakes and improve your Rust code.
|
||||
|
||||
%package src
|
||||
Summary: Sources for the Rust standard library
|
||||
BuildArch: noarch
|
||||
|
||||
Summary: Sources for the Rust standard library
|
||||
BuildArch: noarch
|
||||
%description src
|
||||
This package includes source files for the Rust standard library.It may be
|
||||
This package includes source files for the Rust standard library. It may be
|
||||
useful as a reference for code completion tools in various editors.
|
||||
|
||||
%package analysis
|
||||
Summary: Compiler analysis data for the Rust standard library
|
||||
Requires: rust-std-static = 1.29.1-%{release}
|
||||
|
||||
Summary: Compiler analysis data for the Rust standard library
|
||||
Requires: devel = 1.30.0-%{release}
|
||||
%description analysis
|
||||
This package contains analysis data files produced with rustc's -Zsave-analysis
|
||||
feature for the Rust standard library. The RLS (Rust Language Server) uses this
|
||||
data to provide information about the Rust standard library.
|
||||
|
||||
%package help
|
||||
Summary: Help documents for rust
|
||||
|
||||
Provides: %{name}-doc = %{version}-%{release} %{name}-cargo-doc = %{version}-%{release}
|
||||
Obsoletes: %{name}-doc < %{version}-%{release} %{name}-cargo-doc < %{version}-%{release}
|
||||
|
||||
%description help
|
||||
Man pages and other related help documents for rust.
|
||||
|
||||
%prep
|
||||
%autosetup -n rustc-1.29.1-src -p1
|
||||
|
||||
%autosetup -n rustc-1.30.0-src -p1
|
||||
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
|
||||
|
||||
rm -rf src/llvm-emscripten/
|
||||
sed -e '/*\//q' src/libbacktrace/backtrace.h >src/libbacktrace/LICENSE-libbacktrace
|
||||
|
||||
sed -i.ignore -e '1i // ignore-test may still be exponential...' src/test/run-pass/issue-41696.rs
|
||||
|
||||
find src/vendor -name .cargo-checksum.json -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
|
||||
rm -rf src/llvm src/llvm-emscripten/ src/tools/clang src/tools/lld src/tools/lldb
|
||||
sed -e '/*\//q' src/libbacktrace/backtrace.h \
|
||||
>src/libbacktrace/LICENSE-libbacktrace
|
||||
find src/vendor -name .cargo-checksum.json \
|
||||
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
|
||||
|
||||
%build
|
||||
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
||||
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
||||
%{?rustflags:export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"}
|
||||
|
||||
%configure --disable-option-checking --libdir=%{_prefix}/lib \
|
||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||
export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
|
||||
%global common_libdir %{_prefix}/lib
|
||||
%global rustlibdir %{common_libdir}/rustlib
|
||||
%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
|
||||
%configure --disable-option-checking \
|
||||
--libdir=%{common_libdir} --release-channel=stable \
|
||||
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
||||
--local-rust-root=%{_prefix} --disable-jemalloc --disable-rpath \
|
||||
--enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines \
|
||||
--enable-extended --enable-vendor --enable-verbose-tests --release-channel=stable
|
||||
|
||||
--local-rust-root=%{_prefix} --enable-verbose-tests \
|
||||
--llvm-root=%{_prefix} --disable-codegen-tests \
|
||||
--enable-llvm-link-shared --enable-vendor \
|
||||
--disable-jemalloc -disable-rpath \
|
||||
%{enable_debuginfo} --enable-extended
|
||||
python3 ./x.py build
|
||||
python3 ./x.py doc
|
||||
|
||||
%install
|
||||
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
||||
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
||||
%{?rustflags:export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"}
|
||||
|
||||
export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
|
||||
DESTDIR=%{buildroot} python3 ./x.py install
|
||||
|
||||
install -d %{buildroot}%{_libdir}
|
||||
find %{buildroot}%{_prefix}/lib -maxdepth 1 -type f -name '*.so' -exec mv -v -t %{buildroot}%{_libdir} '{}' '+'
|
||||
|
||||
find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' -exec chmod -v +x '{}' '+'
|
||||
|
||||
mkdir -p %{buildroot}%{_libdir}
|
||||
find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
|
||||
-exec mv -v -t %{buildroot}%{_libdir} '{}' '+'
|
||||
find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
|
||||
-exec chmod -v +x '{}' '+'
|
||||
(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
|
||||
find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
|
||||
while read lib; do
|
||||
cmp "$lib" "${lib##*/}"
|
||||
ln -v -f -s -t . "$lib"
|
||||
done)
|
||||
|
||||
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
|
||||
find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
|
||||
find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
|
||||
find %{buildroot}%{_docdir}/%{name}/html -empty -delete
|
||||
find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
|
||||
|
||||
rm -f %{buildroot}%{_docdir}/rust/{README.md,COPYRIGHT,LICENSE,LICENSE-APACHE}
|
||||
rm -f %{buildroot}%{_docdir}/rust/{LICENSE-MIT,LICENSE-THIRD-PARTY,*.old}
|
||||
find %{buildroot}%{_docdir}/rust/html -empty -delete
|
||||
find %{buildroot}%{_docdir}/rust/html -type f -exec chmod -x '{}' '+'
|
||||
install -d %{buildroot}%{_datadir}/cargo/registry
|
||||
install -d %{buildroot}%{_docdir}/cargo
|
||||
ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
|
||||
|
||||
%check
|
||||
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
||||
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
||||
%{?rustflags:export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"}
|
||||
|
||||
export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
|
||||
python3 ./x.py test --no-fail-fast || :
|
||||
python3 ./x.py test --no-fail-fast cargo || :
|
||||
python3 ./x.py test --no-fail-fast clippy || :
|
||||
python3 ./x.py test --no-fail-fast rls || :
|
||||
python3 ./x.py test --no-fail-fast rustfmt || :
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%doc README.md
|
||||
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT
|
||||
%license src/libbacktrace/LICENSE-libbacktrace
|
||||
%license %{_docdir}/%{name}/html/*.txt
|
||||
%dir %{rustlibdir}
|
||||
%dir %{rustlibdir}/%{rust_triple}
|
||||
%dir %{rustlibdir}/%{rust_triple}/lib
|
||||
%{_bindir}/rustc
|
||||
%{_bindir}/rustdoc
|
||||
%{_bindir}/{rustc,rustdoc}
|
||||
%{_libdir}/*.so
|
||||
%{_mandir}/man1/{rustc.1*,rustdoc.1*}
|
||||
%dir %{rustlibdir}/%{rust_triple}/lib
|
||||
%{rustlibdir}/%{rust_triple}/lib/*.so
|
||||
%{rustlibdir}/%{rust_triple}/codegen-backends/
|
||||
%exclude %{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE,*.old}
|
||||
%exclude %{_docdir}/%{name}/LICENSE-{APACHE,MIT,THIRD-PARTY}
|
||||
%exclude %{rustlibdir}/etc/lldb_*.py*
|
||||
%exclude %{_bindir}/rust-lldb
|
||||
|
||||
%files devel
|
||||
%dir %{rustlibdir}
|
||||
%dir %{rustlibdir}/%{rust_triple}
|
||||
%dir %{rustlibdir}/%{rust_triple}/lib
|
||||
%{rustlibdir}/%{rust_triple}/lib/*.rlib
|
||||
|
||||
%files debugger-common
|
||||
%dir %{rustlibdir}
|
||||
%dir %{rustlibdir}/etc
|
||||
%{rustlibdir}/etc/debugger_*.py*
|
||||
|
||||
@ -232,56 +224,50 @@ python3 ./x.py test --no-fail-fast rustfmt || :
|
||||
%{_bindir}/rust-gdb
|
||||
%{rustlibdir}/etc/gdb_*.py*
|
||||
|
||||
%files lldb
|
||||
%{_bindir}/rust-lldb
|
||||
%{rustlibdir}/etc/lldb_*.py*
|
||||
|
||||
%files help
|
||||
%doc README.md
|
||||
%{_docdir}/cargo/html
|
||||
%{_mandir}/man1/cargo*.1*
|
||||
%doc %{_docdir}/rust/html/*.txt
|
||||
%docdir %{_docdir}/{rust,cargo}
|
||||
%dir %{_docdir}/{rust/html,cargo}
|
||||
%{_docdir}/rust/html/{*/,*.html,*.css,*.js,*.svg,*.woff}
|
||||
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
|
||||
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
|
||||
%doc src/tools/clippy/{README.md,CHANGELOG.md}
|
||||
|
||||
%files -n cargo
|
||||
%doc src/tools/cargo/README.md
|
||||
%license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
|
||||
%dir %{_datadir}/cargo
|
||||
%dir %{_datadir}/cargo/registry
|
||||
%doc src/tools/cargo/README.md src/tools/cargo/LICENSE-THIRD-PARTY
|
||||
%doc src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT
|
||||
%{_bindir}/cargo
|
||||
%dir %{_datadir}/cargo/registry
|
||||
%{_sysconfdir}/bash_completion.d/cargo
|
||||
%{_datadir}/zsh/site-functions/_cargo
|
||||
|
||||
%files -n rustfmt-preview
|
||||
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
|
||||
%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
|
||||
%{_bindir}/rustfmt
|
||||
%{_bindir}/cargo-fmt
|
||||
%{_bindir}/{rustfmt,cargo-fmt}
|
||||
%doc src/tools/rustfmt/LICENSE-{APACHE,MIT}
|
||||
|
||||
%files -n rls-preview
|
||||
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
|
||||
%license src/tools/rls/LICENSE-{APACHE,MIT}
|
||||
%{_bindir}/rls
|
||||
%doc src/tools/rls/LICENSE-{APACHE,MIT}
|
||||
|
||||
%files -n clippy-preview
|
||||
%doc src/tools/clippy/{README.md,CHANGELOG.md}
|
||||
%license src/tools/clippy/LICENSE
|
||||
%{_bindir}/cargo-clippy
|
||||
%{_bindir}/clippy-driver
|
||||
%{_bindir}/{cargo-clippy,clippy-driver}
|
||||
%doc src/tools/clippy/LICENSE
|
||||
|
||||
%files src
|
||||
%dir %{rustlibdir}
|
||||
%{rustlibdir}/src
|
||||
|
||||
%files analysis
|
||||
%{rustlibdir}/%{rust_triple}/analysis/
|
||||
|
||||
%files help
|
||||
%dir %{_docdir}/%{name}
|
||||
%dir %{_docdir}/cargo
|
||||
%dir %{_docdir}/%{name}/html
|
||||
%docdir %{_docdir}/%{name}
|
||||
%docdir %{_docdir}/cargo
|
||||
%{_docdir}/%{name}/html/*/
|
||||
%{_docdir}/%{name}/html/*.html
|
||||
%{_docdir}/%{name}/html/*.css
|
||||
%{_docdir}/%{name}/html/*.js
|
||||
%{_docdir}/%{name}/html/*.svg
|
||||
%{_docdir}/%{name}/html/*.woff
|
||||
%{_docdir}/cargo/html
|
||||
%{_mandir}/man1/rustc.1*
|
||||
%{_mandir}/man1/rustdoc.1*
|
||||
%{_mandir}/man1/cargo*.1*
|
||||
|
||||
%changelog
|
||||
* Fri Jun 5 2020 yaokai <yaoaki13@huawei.com> - 1.30.0-1
|
||||
- Update to 1.30.0-1
|
||||
* Thu Dec 5 2019 wutao <wutao61@huawei.com> - 1.29.1-3
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user