Compare commits

...
Sign in to create a new pull request.

92 commits

Author SHA1 Message Date
Josh Stone
e6f129e101 beta test 2021-11-30 11:53:11 -08:00
Josh Stone
20adc43c37 Merge branch 'rawhide' into beta 2021-11-29 10:15:59 -08:00
Josh Stone
d9cbb77b8b beta test 2021-10-11 11:26:33 -07:00
Josh Stone
bf2cce9b72 Merge branch 'rawhide' into beta 2021-09-15 13:51:41 -07:00
Josh Stone
1b715fd222 beta test 2021-07-21 13:48:53 -07:00
Josh Stone
9a0675c97f Merge branch 'rawhide' into beta 2021-07-21 13:41:41 -07:00
Josh Stone
6ce0ca56b0 beta test 2021-06-04 16:11:18 -07:00
Josh Stone
befc2c0a5f Merge branch 'rawhide' into beta 2021-06-04 15:43:23 -07:00
Josh Stone
519c6a9852 beta test 2021-03-23 16:12:48 -07:00
Josh Stone
6732b6b7fb beta test 2021-03-09 10:54:54 -08:00
Josh Stone
86f616623c Merge branch 'rawhide' into beta 2021-03-09 10:18:22 -08:00
Josh Stone
44fe1090f9 beta test 2020-07-14 09:42:00 -07:00
Josh Stone
09f0f09852 beta test 2020-07-10 13:42:55 -07:00
Josh Stone
8429f906ad Merge branch 'master' into beta 2020-07-08 16:23:02 -07:00
Josh Stone
c60dd26567 beta test 2020-04-21 09:41:59 -07:00
Josh Stone
785d55c34d Merge branch 'master' into beta 2020-03-30 10:23:23 -07:00
Josh Stone
f3956f2ed3 beta test 2020-01-24 12:14:24 -08:00
Josh Stone
966da21ad0 Merge branch 'master' into beta 2020-01-17 16:29:42 -08:00
Josh Stone
1e2b9b2916 beta test 2019-12-12 15:56:21 -08:00
Josh Stone
8e99f8c4a4 Merge branch 'master' into beta 2019-12-06 12:02:35 -08:00
Josh Stone
475b171687 beta test 2019-11-06 13:51:31 -08:00
Josh Stone
a848b3b732 Merge branch 'master' into beta 2019-10-28 13:54:21 -07:00
Josh Stone
8ee38f7820 beta test 2019-09-20 09:59:17 -07:00
Josh Stone
332ef61ee2 Merge branch 'master' into beta 2019-08-26 16:52:57 -07:00
Josh Stone
c454924baf beta test 2019-08-12 16:34:40 -07:00
Josh Stone
c48bc712c8 Merge branch 'master' into beta 2019-07-23 10:37:13 -07:00
Josh Stone
1963761c96 beta test 2019-05-15 16:05:50 -07:00
Josh Stone
39814efda6 Merge branch 'master' into beta 2019-05-15 13:43:46 -07:00
Josh Stone
755e253f63 beta test 2019-03-29 14:33:55 -07:00
Josh Stone
f1d7be8f38 bundled LLVM is in src/llvm-project/ now 2019-03-26 14:49:35 -07:00
Josh Stone
dd5f50a59b Merge branch 'master' into beta 2019-03-26 14:02:54 -07:00
Josh Stone
595faa1874 beta test 2019-03-20 10:10:26 -07:00
Josh Stone
6ca00007e8 beta test 2019-03-18 22:14:43 -07:00
Josh Stone
a103b2abf4 beta test 2019-03-06 16:00:17 -08:00
Josh Stone
3e79b5e2c3 Merge branch 'master' into beta 2019-03-06 10:24:44 -08:00
Josh Stone
4d9af19061 beta test 2019-02-26 09:33:55 -08:00
Josh Stone
be69cb21f2 Merge branch 'master' into beta 2019-02-21 10:54:45 -08:00
Josh Stone
cab102f808 Drop the subpackage versions 2019-01-16 14:05:18 -08:00
Josh Stone
d201a25c94 beta test 2019-01-09 17:11:56 -08:00
Josh Stone
4f5c2bcd74 Merge branch 'master' into beta 2019-01-09 14:27:09 -08:00
Josh Stone
6af1fde79b beta test 2018-12-03 14:58:10 -08:00
Josh Stone
2f05e496e5 Merge branch 'master' into beta 2018-11-17 15:13:01 -08:00
Josh Stone
7472b1ea49 beta test 2018-09-20 13:36:37 -07:00
Josh Stone
381017845f Merge branch 'master' into beta 2018-09-19 12:21:05 -07:00
Josh Stone
aa84a97bfc beta test 2018-09-10 16:52:37 -07:00
Josh Stone
9d2418db76 beta test 2018-09-05 16:13:10 -07:00
Josh Stone
7826701957 beta test 2018-08-31 11:52:04 -07:00
Josh Stone
fe90904f28 beta test
Add a clippy-preview subpackage
2018-08-16 21:26:14 -07:00
Josh Stone
a55bbef495 Merge branch 'master' into beta 2018-08-13 15:24:19 -07:00
Josh Stone
8b950ace9c beta test 2018-07-26 14:33:38 -07:00
Josh Stone
e045a7bf20 Merge branch 'master' into beta 2018-07-24 18:21:24 -07:00
Josh Stone
5da6ebf9a5 beta test 2018-05-04 09:58:25 -07:00
Josh Stone
690bb66d7d Merge branch 'master' into beta 2018-05-04 09:42:01 -07:00
Josh Stone
c580c46578 beta test 2018-03-26 13:55:33 -07:00
Josh Stone
bf789ae20b Merge branch 'master' into beta 2018-03-02 12:18:38 -08:00
Josh Stone
01f9f4f8d7 use llvm5 for epel7 2018-02-06 23:21:45 -08:00
Josh Stone
7fe47101e0 beta test 2018-02-05 13:29:08 -08:00
Josh Stone
9731a9fcfa beta test, use LLVM 5 where available 2018-02-02 17:15:51 -08:00
Josh Stone
2581f83cc5 Merge branch 'master' into beta 2018-02-02 15:31:17 -08:00
Josh Stone
6006123daf beta test 2018-02-01 09:40:45 -08:00
Josh Stone
8a1b41eaf9 Merge branch 'master' into beta 2018-01-18 17:58:50 -08:00
Josh Stone
d64fb6367a beta test 2017-11-15 16:44:35 -08:00
Josh Stone
43b687ef4b Merge branch 'master' into beta 2017-10-26 15:13:40 -07:00
Josh Stone
68c6023eac beta test 2017-10-12 10:42:49 -07:00
Josh Stone
84c02283ad beta test 2017-09-15 13:06:46 -07:00
Josh Stone
688aed533e beta test 2017-09-12 11:35:47 -07:00
Josh Stone
44e5fa40db Merge branch 'master' into beta 2017-09-11 18:27:16 -07:00
Josh Stone
24b87e1c67 add rust-src 2017-08-30 16:35:31 -07:00
Josh Stone
bfac8ec0d4 specifically require /usr/bin/cc 2017-08-30 16:34:52 -07:00
Josh Stone
27cc11db97 bump the bundled llvm 2017-08-30 16:34:33 -07:00
Josh Stone
8c4c8be2a9 update bootstrap 2017-08-24 12:54:25 -07:00
Josh Stone
dba382a9de beta test 2017-08-24 11:29:19 -07:00
Josh Stone
0e0e5eedcd update patches 2017-08-22 10:18:55 -07:00
Josh Stone
9f8aa3b200 Merge branch 'master' into beta 2017-08-22 09:30:16 -07:00
Josh Stone
ef8535c580 beta test, now using llvm4 2017-07-20 10:31:40 -07:00
Josh Stone
5bedf01656 Merge branch 'master' into beta 2017-06-19 16:04:31 -07:00
Josh Stone
d40ed5c13c beta test 2017-06-01 18:06:54 -07:00
Josh Stone
95a5ba4a8e Minor macro cleanups 2017-05-26 15:32:17 -07:00
Josh Stone
3c6c44f0de Merge branch 'master' into beta 2017-05-26 13:15:36 -07:00
Josh Stone
17dc2f4612 beta test 2017-04-25 14:38:12 -07:00
Josh Stone
92998165ad Merge remote-tracking branch 'origin/jistone/beta' into beta 2017-03-31 16:16:57 -07:00
Josh Stone
4f37df8720 beta test 2017-03-06 17:27:42 -08:00
Josh Stone
ed2201a8a9 1.16.0-beta.3 2017-03-03 14:05:45 -08:00
Josh Stone
1dfccb7e3f beta: cargo version, add gdb, fix cmake3 2017-03-02 17:00:21 -08:00
Josh Stone
91ea22b352 beta test 2017-03-01 17:06:46 -08:00
Josh Stone
834370220b WIP 1.16-beta, rustbuild 2017-03-01 10:42:04 -08:00
Josh Stone
fc762c468c Merge branch 'jistone/beta' of ssh://pkgs.fedoraproject.org/rpms/rust into beta 2017-03-01 10:41:32 -08:00
Josh Stone
84f1424083 Merge branch 'jistone/beta' of ssh://pkgs.fedoraproject.org/rpms/rust into beta 2017-01-18 12:08:14 -08:00
Josh Stone
6f33322c7a Beta test 2017-01-18 11:21:44 -08:00
Josh Stone
71ab56b39b Test 1.14.0-beta.3 2016-12-13 22:18:27 -08:00
Josh Stone
ccef3d28be simplify the bootstrap base slightly 2016-11-17 23:48:29 -08:00
Josh Stone
d59c1edc2b Test 1.14.0-beta.2
- Rewrite bootstrap logic to target specific arches.
- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
2016-11-17 22:21:09 -08:00
5 changed files with 198 additions and 158 deletions

View file

@ -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
View 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
View file

@ -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)

View file

@ -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

View file

@ -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,