@@ -123,6 +123,11 @@ pub fn build(b: *std.Build) !void {
123123 "llvm-has-xtensa" ,
124124 "Whether LLVM has the experimental target xtensa enabled" ,
125125 ) orelse false ;
126+ const llvm_has_polly = b .option (
127+ bool ,
128+ "llvm-has-polly" ,
129+ "Whether LLVM was built with Polly and requires linking it" ,
130+ ) orelse false ;
126131 const enable_ios_sdk = b .option (bool , "enable-ios-sdk" , "Run tests requiring presence of iOS SDK and frameworks" ) orelse false ;
127132 const enable_macos_sdk = b .option (bool , "enable-macos-sdk" , "Run tests requiring presence of macOS SDK and frameworks" ) orelse enable_ios_sdk ;
128133 const enable_symlinks_windows = b .option (bool , "enable-symlinks-windows" , "Run tests requiring presence of symlinks on Windows" ) orelse false ;
@@ -332,6 +337,7 @@ pub fn build(b: *std.Build) !void {
332337 .llvm_has_csky = llvm_has_csky ,
333338 .llvm_has_arc = llvm_has_arc ,
334339 .llvm_has_xtensa = llvm_has_xtensa ,
340+ .llvm_has_polly = llvm_has_polly ,
335341 });
336342 }
337343 if (target .result .os .tag == .windows ) {
@@ -739,7 +745,7 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu
739745fn addCompilerStep (b : * std.Build , options : AddCompilerModOptions ) * std.Build.Step.Compile {
740746 const exe = b .addExecutable (.{
741747 .name = "zig" ,
742- .max_rss = 10_000_000_000 ,
748+ .max_rss = 11_000_000_000 ,
743749 .root_module = addCompilerMod (b , options ),
744750 });
745751 exe .stack_size = stack_size ;
@@ -858,6 +864,7 @@ fn addStaticLlvmOptionsToModule(mod: *std.Build.Module, options: struct {
858864 llvm_has_csky : bool ,
859865 llvm_has_arc : bool ,
860866 llvm_has_xtensa : bool ,
867+ llvm_has_polly : bool ,
861868}) ! void {
862869 // Adds the Zig C++ sources which both stage1 and stage2 need.
863870 //
@@ -898,6 +905,10 @@ fn addStaticLlvmOptionsToModule(mod: *std.Build.Module, options: struct {
898905 mod .linkSystemLibrary (lib_name , .{});
899906 };
900907
908+ if (options .llvm_has_polly ) for (llvm_libs_polly ) | lib_name | {
909+ mod .linkSystemLibrary (lib_name , .{});
910+ };
911+
901912 mod .linkSystemLibrary ("z" , .{});
902913 mod .linkSystemLibrary ("zstd" , .{});
903914
@@ -1419,6 +1430,10 @@ const llvm_libs_xtensa = [_][]const u8{
14191430 "LLVMXtensaDesc" ,
14201431 "LLVMXtensaInfo" ,
14211432};
1433+ const llvm_libs_polly = [_ ][]const u8 {
1434+ "Polly" ,
1435+ "PollyISL" ,
1436+ };
14221437
14231438fn generateLangRef (b : * std.Build ) std.Build.LazyPath {
14241439 const doctest_exe = b .addExecutable (.{
0 commit comments