Compare commits
92 commits
rawhide
...
jistone/be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6f129e101 | ||
|
|
20adc43c37 | ||
|
|
d9cbb77b8b | ||
|
|
bf2cce9b72 | ||
|
|
1b715fd222 | ||
|
|
9a0675c97f | ||
|
|
6ce0ca56b0 | ||
|
|
befc2c0a5f | ||
|
|
519c6a9852 | ||
|
|
6732b6b7fb | ||
|
|
86f616623c | ||
|
|
44fe1090f9 | ||
|
|
09f0f09852 | ||
|
|
8429f906ad | ||
|
|
c60dd26567 | ||
|
|
785d55c34d | ||
|
|
f3956f2ed3 | ||
|
|
966da21ad0 | ||
|
|
1e2b9b2916 | ||
|
|
8e99f8c4a4 | ||
|
|
475b171687 | ||
|
|
a848b3b732 | ||
|
|
8ee38f7820 | ||
|
|
332ef61ee2 | ||
|
|
c454924baf | ||
|
|
c48bc712c8 | ||
|
|
1963761c96 | ||
|
|
39814efda6 | ||
|
|
755e253f63 | ||
|
|
f1d7be8f38 | ||
|
|
dd5f50a59b | ||
|
|
595faa1874 | ||
|
|
6ca00007e8 | ||
|
|
a103b2abf4 | ||
|
|
3e79b5e2c3 | ||
|
|
4d9af19061 | ||
|
|
be69cb21f2 | ||
|
|
cab102f808 | ||
|
|
d201a25c94 | ||
|
|
4f5c2bcd74 | ||
|
|
6af1fde79b | ||
|
|
2f05e496e5 | ||
|
|
7472b1ea49 | ||
|
|
381017845f | ||
|
|
aa84a97bfc | ||
|
|
9d2418db76 | ||
|
|
7826701957 | ||
|
|
fe90904f28 | ||
|
|
a55bbef495 | ||
|
|
8b950ace9c | ||
|
|
e045a7bf20 | ||
|
|
5da6ebf9a5 | ||
|
|
690bb66d7d | ||
|
|
c580c46578 | ||
|
|
bf789ae20b | ||
|
|
01f9f4f8d7 | ||
|
|
7fe47101e0 | ||
|
|
9731a9fcfa | ||
|
|
2581f83cc5 | ||
|
|
6006123daf | ||
|
|
8a1b41eaf9 | ||
|
|
d64fb6367a | ||
|
|
43b687ef4b | ||
|
|
68c6023eac | ||
|
|
84c02283ad | ||
|
|
688aed533e | ||
|
|
44e5fa40db | ||
|
|
24b87e1c67 | ||
|
|
bfac8ec0d4 | ||
|
|
27cc11db97 | ||
|
|
8c4c8be2a9 | ||
|
|
dba382a9de | ||
|
|
0e0e5eedcd | ||
|
|
9f8aa3b200 | ||
|
|
ef8535c580 | ||
|
|
5bedf01656 | ||
|
|
d40ed5c13c | ||
|
|
95a5ba4a8e | ||
|
|
3c6c44f0de | ||
|
|
17dc2f4612 | ||
|
|
92998165ad | ||
|
|
4f37df8720 | ||
|
|
ed2201a8a9 | ||
|
|
1dfccb7e3f | ||
|
|
91ea22b352 | ||
|
|
834370220b | ||
|
|
fc762c468c | ||
|
|
84f1424083 | ||
|
|
6f33322c7a | ||
|
|
71ab56b39b | ||
|
|
ccef3d28be | ||
|
|
d59c1edc2b |
5 changed files with 198 additions and 158 deletions
|
|
@ -1,102 +0,0 @@
|
|||
From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 18 Feb 2021 19:14:58 -0800
|
||||
Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval,
|
||||
r=nagisa"
|
||||
|
||||
This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing
|
||||
changes made to d37afad0cc87bf709ad10c85319296ac53030f03.
|
||||
---
|
||||
compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------
|
||||
...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++--
|
||||
src/test/codegen/union-abi.rs | 11 +++--------
|
||||
3 files changed, 11 insertions(+), 16 deletions(-)
|
||||
rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%)
|
||||
|
||||
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
|
||||
index b545b92c9252..545f6aee1a21 100644
|
||||
--- a/compiler/rustc_middle/src/ty/layout.rs
|
||||
+++ b/compiler/rustc_middle/src/ty/layout.rs
|
||||
@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
|| abi == SpecAbi::RustIntrinsic
|
||||
|| abi == SpecAbi::PlatformIntrinsic
|
||||
{
|
||||
- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| {
|
||||
+ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| {
|
||||
if arg.is_ignore() {
|
||||
return;
|
||||
}
|
||||
@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
_ => return,
|
||||
}
|
||||
|
||||
- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`.
|
||||
- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref.
|
||||
- let max_by_val_size = Pointer.size(cx) * 2;
|
||||
+ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM
|
||||
+ // will usually return these in 2 registers, which is more efficient than by-ref.
|
||||
+ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) };
|
||||
let size = arg.layout.size;
|
||||
|
||||
if arg.layout.is_unsized() || size > max_by_val_size {
|
||||
@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
arg.cast_to(Reg { kind: RegKind::Integer, size });
|
||||
}
|
||||
};
|
||||
- fixup(&mut self.ret);
|
||||
+ fixup(&mut self.ret, true);
|
||||
for arg in &mut self.args {
|
||||
- fixup(arg);
|
||||
+ fixup(arg, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs
|
||||
similarity index 74%
|
||||
rename from src/test/codegen/arg-return-value-in-reg.rs
|
||||
rename to src/test/codegen/return-value-in-reg.rs
|
||||
index a69291d47821..4bc0136c5e32 100644
|
||||
--- a/src/test/codegen/arg-return-value-in-reg.rs
|
||||
+++ b/src/test/codegen/return-value-in-reg.rs
|
||||
@@ -1,4 +1,4 @@
|
||||
-//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer.
|
||||
+//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer.
|
||||
|
||||
// compile-flags: -C no-prepopulate-passes -O
|
||||
// only-x86_64
|
||||
@@ -11,7 +11,7 @@ pub struct S {
|
||||
c: u32,
|
||||
}
|
||||
|
||||
-// CHECK: define i128 @modify(i128{{( %0)?}})
|
||||
+// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s)
|
||||
#[no_mangle]
|
||||
pub fn modify(s: S) -> S {
|
||||
S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c }
|
||||
diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs
|
||||
index f282fd237054..afea01e9a2d0 100644
|
||||
--- a/src/test/codegen/union-abi.rs
|
||||
+++ b/src/test/codegen/union-abi.rs
|
||||
@@ -63,16 +63,11 @@ pub union UnionU128{a:u128}
|
||||
#[no_mangle]
|
||||
pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} }
|
||||
|
||||
-pub union UnionU128x2{a:(u128, u128)}
|
||||
-// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1)
|
||||
-#[no_mangle]
|
||||
-pub fn test_UnionU128x2(_: UnionU128x2) { loop {} }
|
||||
-
|
||||
#[repr(C)]
|
||||
-pub union CUnionU128x2{a:(u128, u128)}
|
||||
-// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1)
|
||||
+pub union CUnionU128{a:u128}
|
||||
+// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1)
|
||||
#[no_mangle]
|
||||
-pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} }
|
||||
+pub fn test_CUnionU128(_: CUnionU128) { loop {} }
|
||||
|
||||
pub union UnionBool { b:bool }
|
||||
// CHECK: define zeroext i1 @test_UnionBool(i8 %b)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
94
rust-pr91070.patch
Normal file
94
rust-pr91070.patch
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
index e77d29bed712..f3d8eb2602a3 100644
|
||||
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
@@ -124,8 +124,18 @@ extern "C" LLVMValueRef LLVMRustGetOrInsertFunction(LLVMModuleRef M,
|
||||
|
||||
extern "C" LLVMValueRef
|
||||
LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty) {
|
||||
+ Module *Mod = unwrap(M);
|
||||
StringRef NameRef(Name, NameLen);
|
||||
- return wrap(unwrap(M)->getOrInsertGlobal(NameRef, unwrap(Ty)));
|
||||
+
|
||||
+ // We don't use Module::getOrInsertGlobal because that returns a Constant*,
|
||||
+ // which may either be the real GlobalVariable*, or a constant bitcast of it
|
||||
+ // if our type doesn't match the original declaration. We always want the
|
||||
+ // GlobalVariable* so we can access linkage, visibility, etc.
|
||||
+ GlobalVariable *GV = Mod->getGlobalVariable(NameRef, true);
|
||||
+ if (!GV)
|
||||
+ GV = new GlobalVariable(*Mod, unwrap(Ty), false,
|
||||
+ GlobalValue::ExternalLinkage, nullptr, NameRef);
|
||||
+ return wrap(GV);
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef
|
||||
diff --git a/src/test/ui/statics/issue-91050-1.rs b/src/test/ui/statics/issue-91050-1.rs
|
||||
new file mode 100644
|
||||
index 000000000000..403a41462ef1
|
||||
--- /dev/null
|
||||
+++ b/src/test/ui/statics/issue-91050-1.rs
|
||||
@@ -0,0 +1,34 @@
|
||||
+// build-pass
|
||||
+// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes
|
||||
+
|
||||
+// This test declares globals by the same name with different types, which
|
||||
+// caused problems because Module::getOrInsertGlobal would return a Constant*
|
||||
+// bitcast instead of a GlobalVariable* that could access linkage/visibility.
|
||||
+// In alt builds with LLVM assertions this would fail:
|
||||
+//
|
||||
+// rustc: /checkout/src/llvm-project/llvm/include/llvm/Support/Casting.h:269:
|
||||
+// typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::GlobalValue, Y = llvm::Value]:
|
||||
+// Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
|
||||
+//
|
||||
+// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!"
|
||||
+
|
||||
+pub mod before {
|
||||
+ #[no_mangle]
|
||||
+ pub static GLOBAL1: [u8; 1] = [1];
|
||||
+}
|
||||
+
|
||||
+pub mod inner {
|
||||
+ extern "C" {
|
||||
+ pub static GLOBAL1: u8;
|
||||
+ pub static GLOBAL2: u8;
|
||||
+ }
|
||||
+
|
||||
+ pub fn call() {
|
||||
+ drop(unsafe { (GLOBAL1, GLOBAL2) });
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+pub mod after {
|
||||
+ #[no_mangle]
|
||||
+ pub static GLOBAL2: [u8; 1] = [2];
|
||||
+}
|
||||
diff --git a/src/test/ui/statics/issue-91050-2.rs b/src/test/ui/statics/issue-91050-2.rs
|
||||
new file mode 100644
|
||||
index 000000000000..2ff954d15cab
|
||||
--- /dev/null
|
||||
+++ b/src/test/ui/statics/issue-91050-2.rs
|
||||
@@ -0,0 +1,24 @@
|
||||
+// build-pass
|
||||
+// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes
|
||||
+
|
||||
+// This is a variant of issue-91050-1.rs -- see there for an explanation.
|
||||
+
|
||||
+pub mod before {
|
||||
+ extern "C" {
|
||||
+ pub static GLOBAL1: [u8; 1];
|
||||
+ }
|
||||
+
|
||||
+ pub unsafe fn do_something_with_array() -> u8 {
|
||||
+ GLOBAL1[0]
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+pub mod inner {
|
||||
+ extern "C" {
|
||||
+ pub static GLOBAL1: u8;
|
||||
+ }
|
||||
+
|
||||
+ pub unsafe fn call() -> u8 {
|
||||
+ GLOBAL1 + 42
|
||||
+ }
|
||||
+}
|
||||
123
rust.spec
123
rust.spec
|
|
@ -1,18 +1,18 @@
|
|||
# Only x86_64 and i686 are Tier 1 platforms at this time.
|
||||
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
|
||||
%global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
|
||||
%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x
|
||||
|
||||
# The channel can be stable, beta, or nightly
|
||||
%{!?channel: %global channel stable}
|
||||
%{!?channel: %global channel beta}
|
||||
|
||||
# To bootstrap from scratch, set the channel and date from src/stage0.txt
|
||||
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
|
||||
# or nightly wants some beta-YYYY-MM-DD
|
||||
# Note that cargo matches the program version here, not its crate version.
|
||||
%global bootstrap_rust 1.55.0
|
||||
%global bootstrap_cargo 1.55.0
|
||||
%global bootstrap_channel 1.55.0
|
||||
%global bootstrap_date 2021-09-09
|
||||
%global bootstrap_rust 1.56.1
|
||||
%global bootstrap_cargo 1.56.1
|
||||
%global bootstrap_channel 1.56.1
|
||||
%global bootstrap_date 2021-11-01
|
||||
|
||||
# Only the specified arches will use bootstrap binaries.
|
||||
#global bootstrap_arches %%{rust_arches}
|
||||
|
|
@ -22,10 +22,18 @@
|
|||
# reproducible between hosts, so only x86_64 actually builds it.
|
||||
%ifarch x86_64
|
||||
%if 0%{?fedora}
|
||||
%global cross_targets wasm32-unknown-unknown
|
||||
%global cross_targets wasm32-unknown-unknown wasm32-wasi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# We need CRT files for *-wasi targets
|
||||
%global forgeurl1 https://github.com/WebAssembly/wasi-libc
|
||||
%global commit1 ad5133410f66b93a2381db5b542aad5e0964db96
|
||||
%forgemeta -z 1
|
||||
%undefine distprefix1
|
||||
%global wasi_libc_source %{forgesource1}
|
||||
%global wasi_libc_dir %{_builddir}/%{extractdir1}
|
||||
|
||||
# Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases.
|
||||
%bcond_with llvm_static
|
||||
|
||||
|
|
@ -33,8 +41,8 @@
|
|||
# is insufficient. Rust currently requires LLVM 10.0+.
|
||||
%bcond_with bundled_llvm
|
||||
|
||||
# Requires stable libgit2 1.1
|
||||
%if 0%{?fedora} >= 34
|
||||
# Requires stable libgit2 1.3
|
||||
%if 0%{?fedora} >= 36
|
||||
%bcond_with bundled_libgit2
|
||||
%else
|
||||
%bcond_without bundled_libgit2
|
||||
|
|
@ -61,8 +69,8 @@
|
|||
%endif
|
||||
|
||||
Name: rust
|
||||
Version: 1.56.1
|
||||
Release: 3%{?dist}
|
||||
Version: 1.57.0~beta.8
|
||||
Release: 1%{?dist}
|
||||
Summary: The Rust Programming Language
|
||||
License: (ASL 2.0 or MIT) and (BSD and MIT)
|
||||
# ^ written as: (rust itself) and (bundled libraries)
|
||||
|
|
@ -75,11 +83,12 @@ ExclusiveArch: %{rust_arches}
|
|||
%global rustc_package rustc-%{channel}-src
|
||||
%endif
|
||||
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
|
||||
Source1: %{wasi_libc_source}
|
||||
# Sources for bootstrap_arches are inserted by lua below
|
||||
|
||||
# An internal rust-abi change broke s390x, but it's fixed in LLVM 12.0.1.
|
||||
# We'll revert the change on Fedora 33 that has an unpatched LLVM 11.
|
||||
# https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032
|
||||
Patch1: 0001-Revert-Auto-merge-of-79547.patch
|
||||
# Fix a bad typecast for LLVM globals, rhbz#1990657
|
||||
# https://github.com/rust-lang/rust/pull/91070
|
||||
Patch1: rust-pr91070.patch
|
||||
|
||||
# By default, rust tries to use "rust-lld" as a linker for WebAssembly.
|
||||
Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch
|
||||
|
|
@ -91,11 +100,11 @@ Patch100: rustc-1.56.0-disable-libssh2.patch
|
|||
|
||||
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys
|
||||
# will try to build it statically -- instead we turn off the feature.
|
||||
Patch101: rustc-1.56.0-disable-http2.patch
|
||||
Patch101: rustc-1.57.0-disable-http2.patch
|
||||
|
||||
# kernel rh1410097 causes too-small stacks for PIE.
|
||||
# (affects RHEL6 kernels when building for RHEL7)
|
||||
Patch102: rustc-1.51.0-no-default-pie.patch
|
||||
Patch102: rustc-1.57.0-no-default-pie.patch
|
||||
|
||||
|
||||
# Get the Rust triple for any arch.
|
||||
|
|
@ -128,6 +137,7 @@ end}
|
|||
.."/rust-%{bootstrap_channel}")
|
||||
local target_arch = rpm.expand("%{_target_cpu}")
|
||||
for i, arch in ipairs(bootstrap_arches) do
|
||||
i = 100 + i
|
||||
print(string.format("Source%d: %s-%s.tar.xz\n",
|
||||
i, base, rust_triple(arch)))
|
||||
if arch == target_arch then
|
||||
|
|
@ -165,7 +175,7 @@ BuildRequires: pkgconfig(openssl)
|
|||
BuildRequires: pkgconfig(zlib)
|
||||
|
||||
%if %{without bundled_libgit2}
|
||||
BuildRequires: pkgconfig(libgit2) >= 1.1.0
|
||||
BuildRequires: pkgconfig(libgit2) >= 1.3.0
|
||||
%endif
|
||||
|
||||
%if %{without disabled_libssh2}
|
||||
|
|
@ -185,10 +195,6 @@ BuildRequires: cmake >= 2.8.11
|
|||
%if 0%{?epel} == 7
|
||||
%global llvm llvm11
|
||||
%endif
|
||||
%if 0%{?fedora} == 35
|
||||
# f35 still only has 13.0.0~rc1
|
||||
%global llvm llvm12
|
||||
%endif
|
||||
%if %defined llvm
|
||||
%global llvm_root %{_libdir}/%{llvm}
|
||||
%else
|
||||
|
|
@ -262,6 +268,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++
|
|||
%global rustlibdir %{common_libdir}/rustlib
|
||||
|
||||
%if %defined cross_targets
|
||||
BuildRequires: clang
|
||||
# brp-strip-static-archive breaks the archive index for wasm
|
||||
%global __os_install_post \
|
||||
%__os_install_post \
|
||||
|
|
@ -286,23 +293,29 @@ written in Rust.
|
|||
%if %defined cross_targets
|
||||
%{lua: do
|
||||
for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do
|
||||
local requires = rpm.expand("Requires: rust = %{version}-%{release}")
|
||||
if string.sub(triple, 1, 4) == "wasm" then
|
||||
requires = requires .. "\nRequires: lld >= 8.0"
|
||||
end
|
||||
local subs = {
|
||||
triple = triple,
|
||||
requires = requires,
|
||||
verrel = rpm.expand("%{version}-%{release}"),
|
||||
wasm = string.sub(triple, 1, 4) == "wasm" and 1 or 0,
|
||||
wasi = string.find(triple, "-wasi") and 1 or 0,
|
||||
}
|
||||
local s = string.gsub([[
|
||||
|
||||
%package std-static-{{triple}}
|
||||
Summary: Standard library for Rust
|
||||
BuildArch: noarch
|
||||
{{requires}}
|
||||
Requires: rust = {{verrel}}
|
||||
%if {{wasm}}
|
||||
Requires: lld >= 8.0
|
||||
%endif
|
||||
%if {{wasi}}
|
||||
Provides: bundled(wasi-libc)
|
||||
%endif
|
||||
|
||||
%description std-static-{{triple}}
|
||||
This package includes the standard libraries for building applications
|
||||
written in Rust for the {{triple}} target.
|
||||
|
||||
]], "{{(%w+)}}", subs)
|
||||
print(s)
|
||||
end
|
||||
|
|
@ -360,7 +373,7 @@ its standard library.
|
|||
%package -n cargo
|
||||
Summary: Rust's package manager and build tool
|
||||
%if %with bundled_libgit2
|
||||
Provides: bundled(libgit2) = 1.1.0
|
||||
Provides: bundled(libgit2) = 1.3.0
|
||||
%endif
|
||||
# For tests:
|
||||
BuildRequires: git
|
||||
|
|
@ -403,7 +416,7 @@ A tool for formatting Rust code according to style guidelines.
|
|||
%package -n rls
|
||||
Summary: Rust Language Server for IDE integration
|
||||
%if %with bundled_libgit2
|
||||
Provides: bundled(libgit2) = 1.1.0
|
||||
Provides: bundled(libgit2) = 1.3.0
|
||||
%endif
|
||||
Requires: rust-analysis
|
||||
# /usr/bin/rls is dynamically linked against internal rustc libs
|
||||
|
|
@ -463,13 +476,13 @@ test -f '%{local_rust_root}/bin/cargo'
|
|||
test -f '%{local_rust_root}/bin/rustc'
|
||||
%endif
|
||||
|
||||
%setup -q -n %{rustc_package}
|
||||
|
||||
%if 0%{?fedora} == 33
|
||||
# revert only for LLVM 11
|
||||
%patch1 -p1
|
||||
%if %defined cross_targets
|
||||
%forgesetup -z 1
|
||||
%endif
|
||||
|
||||
%setup -q -n %{rustc_package}
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%if %with disabled_libssh2
|
||||
|
|
@ -543,10 +556,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
|
|||
%if 0%{?cmake_path:1}
|
||||
%global rust_env %{rust_env} PATH="%{cmake_path}:$PATH"
|
||||
%endif
|
||||
%if %without bundled_libgit2
|
||||
# convince libgit2-sys to use the distro libgit2
|
||||
%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1
|
||||
%endif
|
||||
%if %without disabled_libssh2
|
||||
# convince libssh2-sys to use the distro libssh2
|
||||
%global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||
|
|
@ -578,6 +587,22 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
|
|||
ncpus="$max_cpus"
|
||||
fi
|
||||
|
||||
%if %defined cross_targets
|
||||
%make_build -C %{wasi_libc_dir}
|
||||
%{lua: do
|
||||
local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot"
|
||||
local set_wasi_root = ""
|
||||
for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do
|
||||
if string.find(triple, "-wasi") then
|
||||
set_wasi_root = set_wasi_root .. " --set target." .. triple .. ".wasi-root=" .. wasi_root
|
||||
end
|
||||
end
|
||||
if wasi_root ~= "" then
|
||||
rpm.define("set_wasi_root "..set_wasi_root)
|
||||
end
|
||||
end}
|
||||
%endif
|
||||
|
||||
%configure --disable-option-checking \
|
||||
--libdir=%{common_libdir} \
|
||||
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
||||
|
|
@ -596,7 +621,7 @@ fi
|
|||
--tools=analysis,cargo,clippy,rls,rustfmt,src \
|
||||
--enable-vendor \
|
||||
--enable-verbose-tests \
|
||||
%{?codegen_units_std} \
|
||||
%{?set_wasi_root} \
|
||||
--dist-compression-formats=gz \
|
||||
--release-channel=%{channel} \
|
||||
--release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}"
|
||||
|
|
@ -694,6 +719,12 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
|
|||
%check
|
||||
export %{rust_env}
|
||||
|
||||
# Sanity-check the installed binaries, debuginfo-stripped and all.
|
||||
%{buildroot}%{_bindir}/cargo new build/hello-world
|
||||
env RUSTC=%{buildroot}%{_bindir}/rustc \
|
||||
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \
|
||||
%{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml
|
||||
|
||||
# The results are not stable on koji, so mask errors and just log it.
|
||||
# Some of the larger test artifacts are manually cleaned to save space.
|
||||
%{python} ./x.py test --no-fail-fast --stage 2 || :
|
||||
|
|
@ -740,13 +771,20 @@ env RLS_TEST_WAIT_FOR_AGES=1 \
|
|||
local subs = {
|
||||
triple = triple,
|
||||
rustlibdir = rpm.expand("%{rustlibdir}"),
|
||||
wasi = string.find(triple, "-wasi") and 1 or 0,
|
||||
}
|
||||
local s = string.gsub([[
|
||||
|
||||
%files std-static-{{triple}}
|
||||
%dir {{rustlibdir}}
|
||||
%dir {{rustlibdir}}/{{triple}}
|
||||
%dir {{rustlibdir}}/{{triple}}/lib
|
||||
{{rustlibdir}}/{{triple}}/lib/*.rlib
|
||||
%if {{wasi}}
|
||||
%dir {{rustlibdir}}/{{triple}}/lib/self-contained
|
||||
{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o
|
||||
%endif
|
||||
|
||||
]], "{{(%w+)}}", subs)
|
||||
print(s)
|
||||
end
|
||||
|
|
@ -837,6 +875,11 @@ end}
|
|||
|
||||
|
||||
%changelog
|
||||
* Mon Nov 29 2021 Josh Stone <jistone@redhat.com> - 1.57.0~beta.8-1
|
||||
- beta test
|
||||
- Backport rust#91070, fixes rhbz#1990657
|
||||
- Add rust-std-static-wasm32-wasi
|
||||
|
||||
* Sun Nov 28 2021 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.56.1-3
|
||||
- De-bootstrap (libgit2)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- rustc-1.56.0-src/Cargo.lock.orig 2021-10-19 18:03:53.928187581 -0700
|
||||
+++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:05:41.443522980 -0700
|
||||
@@ -877,7 +877,6 @@
|
||||
--- rustc-beta-src/Cargo.lock.orig 2021-11-29 10:37:40.665228216 -0800
|
||||
+++ rustc-beta-src/Cargo.lock 2021-11-29 10:37:40.667228175 -0800
|
||||
@@ -889,7 +889,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
|
|
@ -25,19 +25,19 @@
|
|||
name = "libz-sys"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- rustc-1.56.0-src/src/tools/cargo/Cargo.toml.orig 2021-10-19 18:03:53.930187532 -0700
|
||||
+++ rustc-1.56.0-src/src/tools/cargo/Cargo.toml 2021-10-19 18:05:13.663211469 -0700
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-11-29 10:37:40.667228175 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-11-29 10:38:41.291987733 -0800
|
||||
@@ -25,7 +25,7 @@
|
||||
cargo-util = { path = "crates/cargo-util", version = "0.1.1" }
|
||||
crates-io = { path = "crates/crates-io", version = "0.33.0" }
|
||||
crossbeam-utils = "0.8"
|
||||
-curl = { version = "0.4.38", features = ["http2"] }
|
||||
+curl = { version = "0.4.38", features = [] }
|
||||
curl-sys = "0.4.48"
|
||||
-curl = { version = "0.4.39", features = ["http2"] }
|
||||
+curl = { version = "0.4.39", features = [] }
|
||||
curl-sys = "0.4.49"
|
||||
env_logger = "0.9.0"
|
||||
pretty_env_logger = { version = "0.4", optional = true }
|
||||
--- rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-10-18 02:52:56.000000000 -0700
|
||||
+++ rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-10-19 18:03:53.931187507 -0700
|
||||
--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-11-27 09:38:17.000000000 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-11-29 10:37:40.667228175 -0800
|
||||
@@ -417,14 +417,8 @@
|
||||
// Also note that pipelining is disabled as curl authors have indicated
|
||||
// that it's buggy, and we've empirically seen that it's buggy with HTTP
|
||||
|
|
@ -1,18 +1,23 @@
|
|||
--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800
|
||||
+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800
|
||||
@@ -1279,11 +1279,13 @@
|
||||
--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-11-29 10:41:02.380100917 -0800
|
||||
+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-11-29 10:53:31.014783112 -0800
|
||||
@@ -1485,15 +1485,14 @@
|
||||
}
|
||||
|
||||
fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
|
||||
- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
|
||||
+ // Only use PIE if explicity specified.
|
||||
+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic));
|
||||
+ let explicit_pic =
|
||||
+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
|
||||
+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
|
||||
(CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
|
||||
- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe,
|
||||
- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
|
||||
- LinkOutputKind::DynamicPicExe
|
||||
- }
|
||||
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
|
||||
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
|
||||
- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe,
|
||||
- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
|
||||
- LinkOutputKind::StaticPicExe
|
||||
- }
|
||||
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
|
||||
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
|
||||
(_, true, _) => LinkOutputKind::StaticDylib,
|
||||
Loading…
Add table
Add a link
Reference in a new issue