!1 package rust init

Merge pull request !1 from jackie_wu123/master
This commit is contained in:
openeuler-ci-bot 2019-12-14 16:31:52 +08:00 committed by Gitee
commit 0179ee0970
4 changed files with 621 additions and 0 deletions

View File

@ -0,0 +1,186 @@
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

View File

@ -0,0 +1,122 @@
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

View File

@ -0,0 +1,26 @@
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());
}

287
rust.spec Normal file
View File

@ -0,0 +1,287 @@
%global rustlibdir %{_prefix}/lib/rustlib
%global rust_triple %{_target_cpu}-unknown-linux-gnu
%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}
%description
Rust is a systems programming language focused on three goals:safety,
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
device drivers and operating systems. It improves on current languages
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}
%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
%description debugger-common
This package includes the common functionality for %{name}-gdb and %{name}-lldb.
%package gdb
Summary: GDB pretty printers for Rust
BuildArch: noarch
Requires: gdb
Requires: %{name}-debugger-common = 1.29.1-%{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
%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
%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}
%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.
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}
%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
%description src
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}
%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
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":{ }/' '{}' '+'
%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 \
--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
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"}
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 '{}' '+'
(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 '{}' '+'
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"}
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
%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
%{_libdir}/*.so
%{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*
%files gdb
%{_bindir}/rust-gdb
%{rustlibdir}/etc/gdb_*.py*
%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
%{_bindir}/cargo
%{_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
%files -n rls-preview
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
%license src/tools/rls/LICENSE-{APACHE,MIT}
%{_bindir}/rls
%files -n clippy-preview
%doc src/tools/clippy/{README.md,CHANGELOG.md}
%license src/tools/clippy/LICENSE
%{_bindir}/cargo-clippy
%{_bindir}/clippy-driver
%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
* Thu Dec 5 2019 wutao <wutao61@huawei.com> - 1.29.1-3
- Package init