Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 45b82cd

Browse files
bjorn3cjgillotmichaelwoeristerborsAmanieu
authoredDec 30, 2021
Rustup to "rustc 1.59.0-nightly (78fd0f633 2021-12-29)" (#112)
* Rebase fallout. * Move rustc_middle::middle::cstore to rustc_session. * Create more accurate debuginfo for vtables. Before this commit all vtables would have the same name "vtable" in debuginfo. Now they get a name that identifies the implementing type and the trait that is being implemented. * Remove alloc::prelude As per the libs team decision in #58935. Closes #58935 * Make hash_result an Option. * Add LLVM CFI support to the Rust compiler This commit adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by defining and using compatible type identifiers (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). * Properly check `target_features` not to trigger an assertion * Remove workaround for the forward progress handling in LLVM * Feat: make cg_ssa get_param borrow the builder mutable * fix sparc64 ABI for aggregates with floating point members * rustc_codegen_gcc: error on unwinding inline asm * rustc_codegen_gcc: proper check for may_unwind * Implement inline asm! for AVR platform * Use object crate for .rustc metadata generation We already use the object crate for generating uncompressed .rmeta metadata object files. This switches the generation of compressed .rustc object files to use the object crate as well. These have slightly different requirements in that .rmeta should be completely excluded from any final compilation artifacts, while .rustc should be part of shared objects, but not loaded into memory. The primary motivation for this change is #90326: In LLVM 14, the current way of setting section flags (and in particular, preventing the setting of SHF_ALLOC) will no longer work. There are other ways we could work around this, but switching to the object crate seems like the most elegant, as we already use it for .rmeta, and as it makes this independent of the codegen backend. In particular, we don't need separate handling in codegen_llvm and codegen_gcc. codegen_cranelift should be able to reuse the implementation as well, though I have omitted that here, as it is not based on codegen_ssa. This change mostly extracts the existing code for .rmeta handling to allow using it for .rustc as well, and adjust the codegen infrastructure to handle the metadata object file separately: We no longer create a backend-specific module for it, and directly produce the compiled module instead. This does not fix #90326 by itself yet, as .llvmbc will need to be handled separately. * Remove the reg_thumb register class for asm! on ARM Also restricts r8-r14 from being used on Thumb1 targets as per #90736. * Remove redundant [..]s * Stabilize asm! and global_asm! They are also removed from the prelude as per the decision in rust-lang/rust#87228. stdarch and compiler-builtins are updated to work with the new, stable asm! and global_asm! macros. * Use `OutputFilenames` to generate output file for `-Zllvm-time-trace` The resulting profile will include the crate name and will be stored in the `--out-dir` directory. This implementation makes it convenient to use LLVM time trace together with cargo, in the contrast to the previous implementation which would overwrite profiles or store them in `.cargo/registry/..`. * Remove unnecessary sigils around `Symbol::as_str()` calls. * Rustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29) * Import std::arch::asm * Add missing feature gate * Disable portable-simd test Support for portable-simd isn't implemented yet * Disable long running libcore tests These only finish in reasonable time with optimizations enabled. This patch file is copied from cg_clif. * Ignore new failing test_is_sorted test Co-authored-by: Camille GILLOT <[email protected]> Co-authored-by: Michael Woerister <michaelwoerister@posteo> Co-authored-by: bors <[email protected]> Co-authored-by: Amanieu d'Antras <[email protected]> Co-authored-by: Ramon de C Valle <[email protected]> Co-authored-by: Yuki Okushi <[email protected]> Co-authored-by: Andreas Jonson <[email protected]> Co-authored-by: rdambrosio <[email protected]> Co-authored-by: Petr Sumbera <[email protected]> Co-authored-by: cynecx <[email protected]> Co-authored-by: Andrew Dona-Couch <[email protected]> Co-authored-by: Nikita Popov <[email protected]> Co-authored-by: est31 <[email protected]> Co-authored-by: Matthias Krüger <[email protected]> Co-authored-by: Tomasz Miąsko <[email protected]> Co-authored-by: Nicholas Nethercote <[email protected]>
1 parent 2989a25 commit 45b82cd

14 files changed

+103
-68
lines changed
 

‎patches/0023-core-Ignore-failing-tests.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,24 @@ index 4bc44e9..8e3c7a4 100644
4646

4747
#[test]
4848
fn cell_allows_array_cycle() {
49+
diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
50+
index 3e00e0a..8e5663b 100644
51+
--- a/library/core/tests/slice.rs
52+
+++ b/library/core/tests/slice.rs
53+
@@ -2108,6 +2108,7 @@ fn test_copy_within_panics_src_out_of_bounds() {
54+
bytes.copy_within(usize::MAX..=usize::MAX, 0);
55+
}
56+
57+
+/*
58+
#[test]
59+
fn test_is_sorted() {
60+
let empty: [i32; 0] = [];
61+
@@ -2122,6 +2123,7 @@ fn test_is_sorted() {
62+
assert!(!["c", "bb", "aaa"].is_sorted());
63+
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
64+
}
65+
+*/
66+
67+
#[test]
68+
fn test_slice_run_destructors() {
4969
-- 2.21.0 (Apple Git-122)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From b1ae000f6da1abd3b8e9b80c40bc11c89b8ae93c Mon Sep 17 00:00:00 2001
2+
From: bjorn3 <bjorn3@users.noreply.github.com>
3+
Date: Thu, 30 Dec 2021 16:54:40 +0100
4+
Subject: [PATCH] [core] Disable portable-simd test
5+
6+
---
7+
library/core/tests/lib.rs | 1 -
8+
1 file changed, 1 deletion(-)
9+
10+
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
11+
index ec70034..7cd9e21 100644
12+
--- a/library/core/tests/lib.rs
13+
+++ b/library/core/tests/lib.rs
14+
@@ -121,7 +121,6 @@ mod pattern;
15+
mod pin;
16+
mod ptr;
17+
mod result;
18+
-mod simd;
19+
mod slice;
20+
mod str;
21+
mod str_lossy;
22+
--
23+
2.26.2.7.g19db9cfb68
24+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 0ffdd8eda8df364391c8ac6e1ce92c73ba9254d4 Mon Sep 17 00:00:00 2001
2+
From: bjorn3 <bjorn3@users.noreply.github.com>
3+
Date: Fri, 3 Dec 2021 12:16:30 +0100
4+
Subject: [PATCH] Disable long running tests
5+
6+
---
7+
library/core/tests/slice.rs | 3 +++
8+
1 file changed, 3 insertions(+)
9+
10+
diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
11+
index 2c8f00a..44847ee 100644
12+
--- a/library/core/tests/slice.rs
13+
+++ b/library/core/tests/slice.rs
14+
@@ -2332,7 +2332,8 @@ macro_rules! empty_max_mut {
15+
};
16+
}
17+
18+
+/*
19+
#[cfg(not(miri))] // Comparing usize::MAX many elements takes forever in Miri (and in rustc without optimizations)
20+
take_tests! {
21+
slice: &[(); usize::MAX], method: take,
22+
(take_in_bounds_max_range_to, (..usize::MAX), Some(EMPTY_MAX), &[(); 0]),
23+
@@ -2345,3 +2347,4 @@ take_tests! {
24+
(take_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()),
25+
(take_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()),
26+
}
27+
+*/
28+
--
29+
2.26.2.7.g19db9cfb68
30+

‎rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2021-10-30
1+
nightly-2021-12-30

‎src/abi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<'a, 'gcc, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
1414
// TODO(antoyo)
1515
}
1616

17-
fn get_param(&self, index: usize) -> Self::Value {
17+
fn get_param(&mut self, index: usize) -> Self::Value {
1818
self.cx.current_func.borrow().expect("current func")
1919
.get_param(index as i32)
2020
.to_rvalue()
@@ -48,8 +48,8 @@ impl GccType for CastTarget {
4848
let mut args: Vec<_> = self
4949
.prefix
5050
.iter()
51-
.flat_map(|option_kind| {
52-
option_kind.map(|kind| Reg { kind, size: self.prefix_chunk_size }.gcc_type(cx))
51+
.flat_map(|option_reg| {
52+
option_reg.map(|reg| reg.gcc_type(cx))
5353
})
5454
.chain((0..rest_count).map(|_| rest_gcc_unit))
5555
.collect();

‎src/asm.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
117117
true
118118
}
119119

120-
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, _span: &[Span], _instance: Instance<'_>) {
120+
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span], _instance: Instance<'_>, _dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>) {
121+
if options.contains(InlineAsmOptions::MAY_UNWIND) {
122+
self.sess()
123+
.struct_span_err(span[0], "GCC backend does not support unwinding from inline asm")
124+
.emit();
125+
return;
126+
}
127+
121128
let asm_arch = self.tcx.sess.asm_arch.unwrap();
122129
let is_x86 = matches!(asm_arch, InlineAsmArch::X86 | InlineAsmArch::X86_64);
123130
let att_dialect = is_x86 && options.contains(InlineAsmOptions::ATT_SYNTAX);
@@ -552,7 +559,6 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
552559
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg) => unimplemented!(),
553560
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => unimplemented!(),
554561
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg) => unimplemented!(),
555-
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg_thumb) => unimplemented!(),
556562
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::sreg)
557563
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::dreg_low16)
558564
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg_low8) => unimplemented!(),
@@ -561,6 +567,7 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
561567
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg_low4) => unimplemented!(),
562568
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::dreg)
563569
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg) => unimplemented!(),
570+
InlineAsmRegClass::Avr(_) => unimplemented!(),
564571
InlineAsmRegClass::Bpf(_) => unimplemented!(),
565572
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => unimplemented!(),
566573
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => unimplemented!(),
@@ -611,8 +618,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
611618
| InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => {
612619
unimplemented!()
613620
}
614-
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg)
615-
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg_thumb) => cx.type_i32(),
621+
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg)=> cx.type_i32(),
616622
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::sreg)
617623
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::sreg_low16) => cx.type_f32(),
618624
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::dreg)
@@ -623,6 +629,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
623629
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg_low4) => {
624630
unimplemented!()
625631
}
632+
InlineAsmRegClass::Avr(_) => unimplemented!(),
626633
InlineAsmRegClass::Bpf(_) => unimplemented!(),
627634
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => cx.type_i32(),
628635
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(),
@@ -719,8 +726,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option
719726
| InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => {
720727
unimplemented!()
721728
}
722-
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg)
723-
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg_thumb) => unimplemented!(),
729+
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::reg) => unimplemented!(),
724730
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::sreg)
725731
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::sreg_low16) => unimplemented!(),
726732
InlineAsmRegClass::Arm(ArmInlineAsmRegClass::dreg)
@@ -731,6 +737,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option
731737
| InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg_low4) => {
732738
unimplemented!()
733739
}
740+
InlineAsmRegClass::Avr(_) => unimplemented!(),
734741
InlineAsmRegClass::Bpf(_) => unimplemented!(),
735742
InlineAsmRegClass::Hexagon(_) => unimplemented!(),
736743
InlineAsmRegClass::Mips(_) => unimplemented!(),

‎src/back/write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, _diag_han
3232
if config.emit_asm {
3333
let _timer = cgcx
3434
.prof
35-
.generic_activity_with_arg("LLVM_module_codegen_emit_asm", &module.name[..]);
35+
.generic_activity_with_arg("LLVM_module_codegen_emit_asm", &*module.name);
3636
let path = cgcx.output_filenames.temp_path(OutputType::Assembly, module_name);
3737
context.compile_to_file(OutputKind::Assembler, path.to_str().expect("path to str"));
3838
}
@@ -41,7 +41,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, _diag_han
4141
EmitObj::ObjectCode(_) => {
4242
let _timer = cgcx
4343
.prof
44-
.generic_activity_with_arg("LLVM_module_codegen_emit_obj", &module.name[..]);
44+
.generic_activity_with_arg("LLVM_module_codegen_emit_obj", &*module.name);
4545
if env::var("CG_GCCJIT_DUMP_MODULE_NAMES").as_deref() == Ok("1") {
4646
println!("Module {}", module.name);
4747
}

‎src/base.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use gccjit::{
77
GlobalKind,
88
};
99
use rustc_middle::dep_graph;
10-
use rustc_middle::middle::exported_symbols;
1110
use rustc_middle::ty::TyCtxt;
1211
use rustc_middle::mir::mono::Linkage;
1312
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
1413
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
1514
use rustc_codegen_ssa::mono_item::MonoItemExt;
1615
use rustc_codegen_ssa::traits::DebugInfoMethods;
17-
use rustc_metadata::EncodedMetadata;
1816
use rustc_session::config::DebugInfo;
1917
use rustc_span::Symbol;
2018

@@ -135,40 +133,3 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol) -> (Modul
135133

136134
(module, cost)
137135
}
138-
139-
pub fn write_compressed_metadata<'tcx>(tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, gcc_module: &mut GccContext) {
140-
use snap::write::FrameEncoder;
141-
use std::io::Write;
142-
143-
// Historical note:
144-
//
145-
// When using link.exe it was seen that the section name `.note.rustc`
146-
// was getting shortened to `.note.ru`, and according to the PE and COFF
147-
// specification:
148-
//
149-
// > Executable images do not use a string table and do not support
150-
// > section names longer than 8 characters
151-
//
152-
// https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
153-
//
154-
// As a result, we choose a slightly shorter name! As to why
155-
// `.note.rustc` works on MinGW, see
156-
// https://github.com/llvm/llvm-project/blob/llvmorg-12.0.0/lld/COFF/Writer.cpp#L1190-L1197
157-
let section_name = if tcx.sess.target.is_like_osx { "__DATA,.rustc" } else { ".rustc" };
158-
159-
let context = &gcc_module.context;
160-
let mut compressed = rustc_metadata::METADATA_HEADER.to_vec();
161-
FrameEncoder::new(&mut compressed).write_all(&metadata.raw_data()).unwrap();
162-
163-
let name = exported_symbols::metadata_symbol_name(tcx);
164-
let typ = context.new_array_type(None, context.new_type::<u8>(), compressed.len() as i32);
165-
let global = context.new_global(None, GlobalKind::Exported, typ, name);
166-
global.global_set_initializer(&compressed);
167-
global.set_link_section(section_name);
168-
169-
// Also generate a .section directive to force no
170-
// flags, at least for ELF outputs, so that the
171-
// metadata doesn't get loaded into memory.
172-
let directive = format!(".section {}", section_name);
173-
context.add_top_level_asm(None, &directive);
174-
}

‎src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
3232
return value;
3333
}
3434

35-
let global = self.global_string(&*symbol.as_str());
35+
let global = self.global_string(symbol.as_str());
3636

3737
self.const_cstr_cache.borrow_mut().insert(symbol, global);
3838
global

‎src/declare.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
1717
global.set_tls_model(self.tls_model);
1818
}
1919
if let Some(link_section) = link_section {
20-
global.set_link_section(&link_section.as_str());
20+
global.set_link_section(link_section.as_str());
2121
}
2222
global
2323
}
@@ -53,7 +53,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
5353
global.set_tls_model(self.tls_model);
5454
}
5555
if let Some(link_section) = link_section {
56-
global.set_link_section(&link_section.as_str());
56+
global.set_link_section(link_section.as_str());
5757
}
5858
let global_address = global.get_address(None);
5959
self.globals.borrow_mut().insert(name.to_string(), global_address);

‎src/intrinsic/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
8888
let arg_tys = sig.inputs();
8989
let ret_ty = sig.output();
9090
let name = tcx.item_name(def_id);
91-
let name_str = &*name.as_str();
91+
let name_str = name.as_str();
9292

9393
let llret_ty = self.layout_of(ret_ty).gcc_type(self, true);
9494
let result = PlaceRef::new_sized(llresult, fn_abi.ret.layout);
@@ -316,7 +316,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
316316
extended_asm.add_input_operand(None, "r", result.llval);
317317
extended_asm.add_clobber("memory");
318318
extended_asm.set_volatile_flag(true);
319-
319+
320320
// We have copied the value to `result` already.
321321
return;
322322
}
@@ -363,10 +363,6 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
363363
cond
364364
}
365365

366-
fn sideeffect(&mut self) {
367-
// TODO(antoyo)
368-
}
369-
370366
fn type_test(&mut self, _pointer: Self::Value, _typeid: Self::Value) -> Self::Value {
371367
// Unsupported.
372368
self.context.new_rvalue_from_int(self.int_type, 0)

‎src/intrinsic/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>,
5252
let sig =
5353
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
5454
let arg_tys = sig.inputs();
55-
let name_str = &*name.as_str();
55+
let name_str = name.as_str();
5656

5757
// every intrinsic below takes a SIMD vector as its first argument
5858
require_simd!(arg_tys[0], "input");

‎src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ extern crate rustc_session;
2222
extern crate rustc_span;
2323
extern crate rustc_symbol_mangling;
2424
extern crate rustc_target;
25-
extern crate snap;
2625

2726
// This prevents duplicating functions and statics that are already part of the host rustc process.
2827
#[allow(unused_extern_crates)]
@@ -97,7 +96,7 @@ impl CodegenBackend for GccCodegenBackend {
9796
Box::new(res)
9897
}
9998

100-
fn join_codegen(&self, ongoing_codegen: Box<dyn Any>, sess: &Session) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
99+
fn join_codegen(&self, ongoing_codegen: Box<dyn Any>, sess: &Session, _outputs: &OutputFilenames) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
101100
let (codegen_results, work_products) = ongoing_codegen
102101
.downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>()
103102
.expect("Expected GccCodegenBackend's OngoingCodegen, found Box<Any>")
@@ -128,10 +127,6 @@ impl ExtraBackendMethods for GccCodegenBackend {
128127
}
129128
}
130129

131-
fn write_compressed_metadata<'tcx>(&self, tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, gcc_module: &mut Self::Module) {
132-
base::write_compressed_metadata(tcx, metadata, gcc_module)
133-
}
134-
135130
fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, mods: &mut Self::Module, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) {
136131
unsafe { allocator::codegen(tcx, mods, module_name, kind, has_alloc_error_handler) }
137132
}

‎tests/run/asm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(asm, global_asm)]
6+
#![feature(asm_const, asm_sym)]
7+
8+
use std::arch::{asm, global_asm};
79

810
global_asm!("
911
.global add_asm

0 commit comments

Comments
 (0)
Please sign in to comment.