@@ -5,9 +5,13 @@ use rustc::session::Session;
5
5
use cranelift_module:: { FuncId , Module } ;
6
6
7
7
use faerie:: * ;
8
+ #[ cfg( feature = "backend_object" ) ]
8
9
use object:: { SectionKind , RelocationKind , RelocationEncoding } ;
10
+ #[ cfg( feature = "backend_object" ) ]
9
11
use object:: write:: * ;
10
12
use cranelift_faerie:: { FaerieBackend , FaerieBuilder , FaerieProduct , FaerieTrapCollection } ;
13
+
14
+ #[ cfg( feature = "backend_object" ) ]
11
15
use cranelift_object:: * ;
12
16
13
17
use gimli:: SectionId ;
@@ -41,6 +45,7 @@ impl WriteMetadata for faerie::Artifact {
41
45
}
42
46
}
43
47
48
+ #[ cfg( feature = "backend_object" ) ]
44
49
impl WriteMetadata for object:: write:: Object {
45
50
fn add_rustc_section ( & mut self , symbol_name : String , data : Vec < u8 > , _is_like_osx : bool ) {
46
51
let segment = self . segment_name ( object:: write:: StandardSegment :: Data ) . to_vec ( ) ;
@@ -108,6 +113,7 @@ impl WriteDebugInfo for FaerieProduct {
108
113
}
109
114
}
110
115
116
+ #[ cfg( feature = "backend_object" ) ]
111
117
impl WriteDebugInfo for ObjectProduct {
112
118
type SectionId = ( object:: write:: SectionId , object:: write:: SymbolId ) ;
113
119
@@ -158,6 +164,7 @@ impl Emit for FaerieProduct {
158
164
}
159
165
}
160
166
167
+ #[ cfg( feature = "backend_object" ) ]
161
168
impl Emit for ObjectProduct {
162
169
fn emit ( self ) -> Vec < u8 > {
163
170
self . object . write ( ) . unwrap ( )
0 commit comments