File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ pub(crate) struct LinkageConstOrMutType {
14
14
pub span : Span
15
15
}
16
16
17
+ #[ derive( SessionDiagnostic ) ]
18
+ #[ diag( codegen_gcc:: lto_not_supported) ]
19
+ pub ( crate ) struct LTONotSupported { }
20
+
17
21
#[ derive( SessionDiagnostic ) ]
18
22
#[ diag( codegen_gcc:: unwinding_inline_asm) ]
19
23
pub ( crate ) struct UnwindingInlineAsm {
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ mod type_of;
61
61
use std:: any:: Any ;
62
62
use std:: sync:: { Arc , Mutex } ;
63
63
64
+ use crate :: errors:: LTONotSupported ;
64
65
use gccjit:: { Context , OptimizationLevel , CType } ;
65
66
use rustc_ast:: expand:: allocator:: AllocatorKind ;
66
67
use rustc_codegen_ssa:: { CodegenResults , CompiledModule , ModuleCodegen } ;
@@ -99,7 +100,7 @@ pub struct GccCodegenBackend {
99
100
impl CodegenBackend for GccCodegenBackend {
100
101
fn init ( & self , sess : & Session ) {
101
102
if sess. lto ( ) != Lto :: No {
102
- sess. warn ( "LTO is not supported. You may get a linker error." ) ;
103
+ sess. emit_warning ( LTONotSupported { } ) ;
103
104
}
104
105
105
106
let temp_dir = TempDir :: new ( ) . expect ( "cannot create temporary directory" ) ;
Original file line number Diff line number Diff line change @@ -6,3 +6,6 @@ codegen_gcc_linkage_const_or_mut_type =
6
6
7
7
codegen_gcc_unwinding_inline_asm =
8
8
GCC backend does not support unwinding from inline asm
9
+
10
+ codegen_gcc_lto_not_supported =
11
+ LTO is not supported. You may get a linker error.
You can’t perform that action at this time.
0 commit comments