@@ -146,6 +146,21 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
146146 let target_triple =
147147 std:: env:: var ( "PGO_HOST" ) . expect ( "PGO_HOST environment variable missing" ) ;
148148
149+ let is_aarch64 = target_triple. starts_with ( "aarch64" ) ;
150+
151+ let mut skip_tests = vec ! [
152+ // Fails because of linker errors, as of June 2023.
153+ "tests/ui/process/nofile-limit.rs" . to_string( ) ,
154+ ] ;
155+
156+ if is_aarch64 {
157+ skip_tests. extend ( [
158+ // Those tests fail only inside of Docker on aarch64, as of December 2024
159+ "tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs" . to_string ( ) ,
160+ "tests/ui/consts/large_const_alloc.rs" . to_string ( ) ,
161+ ] ) ;
162+ }
163+
149164 let checkout_dir = Utf8PathBuf :: from ( "/checkout" ) ;
150165 let env = EnvironmentBuilder :: default ( )
151166 . host_tuple ( target_triple)
@@ -155,11 +170,9 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
155170 . artifact_dir ( Utf8PathBuf :: from ( "/tmp/tmp-multistage/opt-artifacts" ) )
156171 . build_dir ( checkout_dir. join ( "obj" ) )
157172 . shared_llvm ( true )
158- . use_bolt ( true )
159- . skipped_tests ( vec ! [
160- // Fails because of linker errors, as of June 2023.
161- "tests/ui/process/nofile-limit.rs" . to_string( ) ,
162- ] )
173+ // FIXME: Enable bolt for aarch64 once it's fixed upstream. Broken as of December 2024.
174+ . use_bolt ( !is_aarch64)
175+ . skipped_tests ( skip_tests)
163176 . build ( ) ?;
164177
165178 ( env, shared. build_args )
@@ -304,7 +317,8 @@ fn execute_pipeline(
304317 // the final dist build. However, when BOLT optimizes an artifact, it does so *in-place*,
305318 // therefore it will actually optimize all the hard links, which means that the final
306319 // packaged `libLLVM.so` file *will* be BOLT optimized.
307- bolt_optimize ( & llvm_lib, & llvm_profile) . context ( "Could not optimize LLVM with BOLT" ) ?;
320+ bolt_optimize ( & llvm_lib, & llvm_profile, env)
321+ . context ( "Could not optimize LLVM with BOLT" ) ?;
308322
309323 let rustc_lib = io:: find_file_in_dir ( & libdir, "librustc_driver" , ".so" ) ?;
310324
@@ -319,7 +333,7 @@ fn execute_pipeline(
319333 print_free_disk_space ( ) ?;
320334
321335 // Now optimize the library with BOLT.
322- bolt_optimize ( & rustc_lib, & rustc_profile)
336+ bolt_optimize ( & rustc_lib, & rustc_profile, env )
323337 . context ( "Could not optimize rustc with BOLT" ) ?;
324338
325339 // LLVM is not being cleared here, we want to use the BOLT-optimized LLVM
0 commit comments