@@ -231,13 +231,7 @@ impl ConfigInfo {
231231 let tempfile = output_dir. join ( & tempfile_name) ;
232232 let is_in_ci = std:: env:: var ( "GITHUB_ACTIONS" ) . is_ok ( ) ;
233233
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) ?;
241235
242236 let libgccjit_so = output_dir. join ( libgccjit_so_name) ;
243237 // If we reach this point, it means the file was correctly downloaded, so let's
@@ -469,11 +463,27 @@ impl ConfigInfo {
469463}
470464
471465fn download_gccjit (
472- url : String ,
466+ commit : & str ,
473467 output_dir : & Path ,
474468 tempfile_name : String ,
475469 with_progress_bar : bool ,
476470) -> 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+
477487 // Try curl. If that fails and we are on windows, fallback to PowerShell.
478488 let mut ret = run_command_with_output (
479489 & [
0 commit comments