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 {
1414 pub span : Span
1515}
1616
17+ #[ derive( SessionDiagnostic ) ]
18+ #[ diag( codegen_gcc:: lto_not_supported) ]
19+ pub ( crate ) struct LTONotSupported { }
20+
1721#[ derive( SessionDiagnostic ) ]
1822#[ diag( codegen_gcc:: unwinding_inline_asm) ]
1923pub ( crate ) struct UnwindingInlineAsm {
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ mod type_of;
6161use std:: any:: Any ;
6262use std:: sync:: { Arc , Mutex } ;
6363
64+ use crate :: errors:: LTONotSupported ;
6465use gccjit:: { Context , OptimizationLevel , CType } ;
6566use rustc_ast:: expand:: allocator:: AllocatorKind ;
6667use rustc_codegen_ssa:: { CodegenResults , CompiledModule , ModuleCodegen } ;
@@ -99,7 +100,7 @@ pub struct GccCodegenBackend {
99100impl CodegenBackend for GccCodegenBackend {
100101 fn init ( & self , sess : & Session ) {
101102 if sess. lto ( ) != Lto :: No {
102- sess. warn ( "LTO is not supported. You may get a linker error." ) ;
103+ sess. emit_warning ( LTONotSupported { } ) ;
103104 }
104105
105106 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 =
66
77codegen_gcc_unwinding_inline_asm =
88 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