@@ -684,6 +684,9 @@ pub struct Config {
684684
685685    /// Current codegen backend used. 
686686pub  codegen_backend :  CodegenBackend , 
687+ 
688+     /// Only used by GCC codegen backend for now. It is used to pass `libgccjit.so`'s path. 
689+ pub  extra_library_path :  Option < Utf8PathBuf > , 
687690} 
688691
689692impl  Config  { 
@@ -787,6 +790,7 @@ impl Config {
787790            diff_command :  Default :: default ( ) , 
788791            minicore_path :  Default :: default ( ) , 
789792            codegen_backend :  CodegenBackend :: Llvm , 
793+             extra_library_path :  None , 
790794        } 
791795    } 
792796
@@ -1151,7 +1155,11 @@ fn supported_crate_types(config: &Config) -> HashSet<String> {
11511155
11521156fn  rustc_output ( config :  & Config ,  args :  & [ & str ] ,  envs :  HashMap < String ,  String > )  -> String  { 
11531157    let  mut  command = Command :: new ( & config. rustc_path ) ; 
1154-     add_dylib_path ( & mut  command,  iter:: once ( & config. compile_lib_path ) ) ; 
1158+     if  let  Some ( ref  extra_lib)  = config. extra_library_path  { 
1159+         add_dylib_path ( & mut  command,  [ & config. compile_lib_path ,  & extra_lib] . iter ( ) ) ; 
1160+     }  else  { 
1161+         add_dylib_path ( & mut  command,  iter:: once ( & config. compile_lib_path ) ) ; 
1162+     } 
11551163    command. args ( & config. target_rustcflags ) . args ( args) ; 
11561164    command. env ( "RUSTC_BOOTSTRAP" ,  "1" ) ; 
11571165    command. envs ( envs) ; 
0 commit comments