@@ -684,6 +684,9 @@ pub struct Config {
684
684
685
685
/// Current codegen backend used.
686
686
pub 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 > ,
687
690
}
688
691
689
692
impl Config {
@@ -787,6 +790,7 @@ impl Config {
787
790
diff_command : Default :: default ( ) ,
788
791
minicore_path : Default :: default ( ) ,
789
792
codegen_backend : CodegenBackend :: Llvm ,
793
+ extra_library_path : None ,
790
794
}
791
795
}
792
796
@@ -1151,7 +1155,11 @@ fn supported_crate_types(config: &Config) -> HashSet<String> {
1151
1155
1152
1156
fn rustc_output ( config : & Config , args : & [ & str ] , envs : HashMap < String , String > ) -> String {
1153
1157
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
+ }
1155
1163
command. args ( & config. target_rustcflags ) . args ( args) ;
1156
1164
command. env ( "RUSTC_BOOTSTRAP" , "1" ) ;
1157
1165
command. envs ( envs) ;
0 commit comments