@@ -483,7 +483,7 @@ impl Step for Llvm {
483483 cfg. define ( "LLVM_VERSION_SUFFIX" , suffix) ;
484484 }
485485
486- configure_cmake ( builder, target, & mut cfg, true , ldflags) ;
486+ configure_cmake ( builder, target, & mut cfg, true , ldflags, & [ ] ) ;
487487 configure_llvm ( builder, target, & mut cfg) ;
488488
489489 for ( key, val) in & builder. config . llvm_build_config {
@@ -574,6 +574,7 @@ fn configure_cmake(
574574 cfg : & mut cmake:: Config ,
575575 use_compiler_launcher : bool ,
576576 mut ldflags : LdFlags ,
577+ extra_compiler_flags : & [ & str ] ,
577578) {
578579 // Do not print installation messages for up-to-date files.
579580 // LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
@@ -714,6 +715,9 @@ fn configure_cmake(
714715 if builder. config . llvm_clang_cl . is_some ( ) {
715716 cflags. push ( & format ! ( " --target={}" , target) ) ;
716717 }
718+ for flag in extra_compiler_flags {
719+ cflags. push ( & format ! ( " {}" , flag) ) ;
720+ }
717721 cfg. define ( "CMAKE_C_FLAGS" , cflags) ;
718722 let mut cxxflags: OsString = builder. cflags ( target, GitRepo :: Llvm , CLang :: Cxx ) . join ( " " ) . into ( ) ;
719723 if let Some ( ref s) = builder. config . llvm_cxxflags {
@@ -723,6 +727,9 @@ fn configure_cmake(
723727 if builder. config . llvm_clang_cl . is_some ( ) {
724728 cxxflags. push ( & format ! ( " --target={}" , target) ) ;
725729 }
730+ for flag in extra_compiler_flags {
731+ cxxflags. push ( & format ! ( " {}" , flag) ) ;
732+ }
726733 cfg. define ( "CMAKE_CXX_FLAGS" , cxxflags) ;
727734 if let Some ( ar) = builder. ar ( target) {
728735 if ar. is_absolute ( ) {
@@ -864,7 +871,7 @@ impl Step for Lld {
864871 }
865872 }
866873
867- configure_cmake ( builder, target, & mut cfg, true , ldflags) ;
874+ configure_cmake ( builder, target, & mut cfg, true , ldflags, & [ ] ) ;
868875 configure_llvm ( builder, target, & mut cfg) ;
869876
870877 // Re-use the same flags as llvm to control the level of debug information
@@ -1028,7 +1035,16 @@ impl Step for Sanitizers {
10281035 // Unfortunately sccache currently lacks support to build them successfully.
10291036 // Disable compiler launcher on Darwin targets to avoid potential issues.
10301037 let use_compiler_launcher = !self . target . contains ( "apple-darwin" ) ;
1031- configure_cmake ( builder, self . target , & mut cfg, use_compiler_launcher, LdFlags :: default ( ) ) ;
1038+ let extra_compiler_flags: & [ & str ] =
1039+ if self . target . contains ( "apple" ) { & [ "-fembed-bitcode=off" ] } else { & [ ] } ;
1040+ configure_cmake (
1041+ builder,
1042+ self . target ,
1043+ & mut cfg,
1044+ use_compiler_launcher,
1045+ LdFlags :: default ( ) ,
1046+ extra_compiler_flags,
1047+ ) ;
10321048
10331049 t ! ( fs:: create_dir_all( & out_dir) ) ;
10341050 cfg. out_dir ( out_dir) ;
@@ -1084,12 +1100,15 @@ fn supported_sanitizers(
10841100
10851101 match & * target. triple {
10861102 "aarch64-apple-darwin" => darwin_libs ( "osx" , & [ "asan" , "lsan" , "tsan" ] ) ,
1103+ "aarch64-apple-ios" => darwin_libs ( "ios" , & [ "asan" , "tsan" ] ) ,
1104+ "aarch64-apple-ios-sim" => darwin_libs ( "iossim" , & [ "asan" , "tsan" ] ) ,
10871105 "aarch64-unknown-fuchsia" => common_libs ( "fuchsia" , "aarch64" , & [ "asan" ] ) ,
10881106 "aarch64-unknown-linux-gnu" => {
10891107 common_libs ( "linux" , "aarch64" , & [ "asan" , "lsan" , "msan" , "tsan" , "hwasan" ] )
10901108 }
10911109 "x86_64-apple-darwin" => darwin_libs ( "osx" , & [ "asan" , "lsan" , "tsan" ] ) ,
10921110 "x86_64-unknown-fuchsia" => common_libs ( "fuchsia" , "x86_64" , & [ "asan" ] ) ,
1111+ "x86_64-apple-ios" => darwin_libs ( "iossim" , & [ "asan" , "tsan" ] ) ,
10931112 "x86_64-unknown-freebsd" => common_libs ( "freebsd" , "x86_64" , & [ "asan" , "msan" , "tsan" ] ) ,
10941113 "x86_64-unknown-netbsd" => {
10951114 common_libs ( "netbsd" , "x86_64" , & [ "asan" , "lsan" , "msan" , "tsan" ] )
0 commit comments