File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -202,8 +202,15 @@ impl CodegenBackend for GccCodegenBackend {
202202 * * self . target_info . info . lock ( ) . expect ( "lock" ) = context. get_target_info ( ) ;
203203 }
204204
205- // NOTE: try the LTO frontend and check if it errors out. If so, do not embed the bitcode.
205+ // While not required by the API, we gate this code on the master feature to make sure we
206+ // don't abort the process while checking if LTO is supported.
207+ // The following could will emit a fatal error if LTO is not supported and older versions
208+ // of libgccjit (the ones without this commit:
209+ // https://github.com/rust-lang/gcc/commit/a073b06800f064b3917a6113d4cc2a0c19a10fda) will
210+ // abort on fatal errors.
211+ #[ cfg( feature = "master" ) ]
206212 {
213+ // NOTE: try the LTO frontend and check if it errors out. If so, do not embed the bitcode.
207214 let temp_dir = TempDir :: new ( ) . expect ( "cannot create temporary directory" ) ;
208215 let temp_file = temp_dir. keep ( ) . join ( "result.asm" ) ;
209216 let context = Context :: default ( ) ;
You can’t perform that action at this time.
0 commit comments