@@ -231,13 +231,7 @@ impl ConfigInfo {
231
231
let tempfile = output_dir. join ( & tempfile_name) ;
232
232
let is_in_ci = std:: env:: var ( "GITHUB_ACTIONS" ) . is_ok ( ) ;
233
233
234
- let url = format ! (
235
- "https://github.com/antoyo/gcc/releases/download/master-{}/libgccjit.so" ,
236
- commit,
237
- ) ;
238
-
239
- println ! ( "Downloading `{}`..." , url) ;
240
- download_gccjit ( url, & output_dir, tempfile_name, !is_in_ci) ?;
234
+ download_gccjit ( & commit, & output_dir, tempfile_name, !is_in_ci) ?;
241
235
242
236
let libgccjit_so = output_dir. join ( libgccjit_so_name) ;
243
237
// If we reach this point, it means the file was correctly downloaded, so let's
@@ -469,11 +463,27 @@ impl ConfigInfo {
469
463
}
470
464
471
465
fn download_gccjit (
472
- url : String ,
466
+ commit : & str ,
473
467
output_dir : & Path ,
474
468
tempfile_name : String ,
475
469
with_progress_bar : bool ,
476
470
) -> Result < ( ) , String > {
471
+ let url = if std:: env:: consts:: OS == "linux" && std:: env:: consts:: ARCH == "x86_64" {
472
+ format ! ( "https://github.com/rust-lang/gcc/releases/download/master-{}/libgccjit.so" , commit)
473
+ } else {
474
+ eprintln ! (
475
+ "\
476
+ Pre-compiled libgccjit.so not available for this os or architecture.
477
+ Please compile it yourself and update the `config.toml` file
478
+ to `download-gccjit = false` and set `gcc-path` to the appropriate directory."
479
+ ) ;
480
+ return Err ( String :: from (
481
+ "no appropriate pre-compiled libgccjit.so available for download" ,
482
+ ) ) ;
483
+ } ;
484
+
485
+ println ! ( "Downloading `{}`..." , url) ;
486
+
477
487
// Try curl. If that fails and we are on windows, fallback to PowerShell.
478
488
let mut ret = run_command_with_output (
479
489
& [
0 commit comments