| ... | @@ -174,6 +174,12 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -174,6 +174,12 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 174 | const target_ver = target.os.version_range.linux.glibc; | 174 | const target_ver = target.os.version_range.linux.glibc; |
| 175 | const start_old_init_fini = target_ver.order(.{ .major = 2, .minor = 33 }) != .gt; | 175 | const start_old_init_fini = target_ver.order(.{ .major = 2, .minor = 33 }) != .gt; |
| 176 | | 176 | |
| | 177 | // In all cases in this function, we add the C compiler flags to |
| | 178 | // cache_exempt_flags rather than extra_flags, because these arguments |
| | 179 | // depend on only properties that are already covered by the cache |
| | 180 | // manifest. Including these arguments in the cache could only possibly |
| | 181 | // waste computation and create false negatives. |
| | 182 | |
| 177 | switch (crt_file) { | 183 | switch (crt_file) { |
| 178 | .crti_o => { | 184 | .crti_o => { |
| 179 | var args = std.ArrayList([]const u8).init(arena); | 185 | var args = std.ArrayList([]const u8).init(arena); |
| ... | @@ -193,7 +199,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -193,7 +199,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 193 | return comp.build_crt_file("crti", .Obj, &[1]Compilation.CSourceFile{ | 199 | return comp.build_crt_file("crti", .Obj, &[1]Compilation.CSourceFile{ |
| 194 | .{ | 200 | .{ |
| 195 | .src_path = try start_asm_path(comp, arena, "crti.S"), | 201 | .src_path = try start_asm_path(comp, arena, "crti.S"), |
| 196 | .extra_flags = args.items, | 202 | .cache_exempt_flags = args.items, |
| 197 | }, | 203 | }, |
| 198 | }); | 204 | }); |
| 199 | }, | 205 | }, |
| ... | @@ -212,7 +218,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -212,7 +218,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 212 | return comp.build_crt_file("crtn", .Obj, &[1]Compilation.CSourceFile{ | 218 | return comp.build_crt_file("crtn", .Obj, &[1]Compilation.CSourceFile{ |
| 213 | .{ | 219 | .{ |
| 214 | .src_path = try start_asm_path(comp, arena, "crtn.S"), | 220 | .src_path = try start_asm_path(comp, arena, "crtn.S"), |
| 215 | .extra_flags = args.items, | 221 | .cache_exempt_flags = args.items, |
| 216 | }, | 222 | }, |
| 217 | }); | 223 | }); |
| 218 | }, | 224 | }, |
| ... | @@ -237,7 +243,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -237,7 +243,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 237 | const src_path = if (start_old_init_fini) "start-2.33.S" else "start.S"; | 243 | const src_path = if (start_old_init_fini) "start-2.33.S" else "start.S"; |
| 238 | break :blk .{ | 244 | break :blk .{ |
| 239 | .src_path = try start_asm_path(comp, arena, src_path), | 245 | .src_path = try start_asm_path(comp, arena, src_path), |
| 240 | .extra_flags = args.items, | 246 | .cache_exempt_flags = args.items, |
| 241 | }; | 247 | }; |
| 242 | }; | 248 | }; |
| 243 | const abi_note_o: Compilation.CSourceFile = blk: { | 249 | const abi_note_o: Compilation.CSourceFile = blk: { |
| ... | @@ -256,7 +262,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -256,7 +262,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 256 | }); | 262 | }); |
| 257 | break :blk .{ | 263 | break :blk .{ |
| 258 | .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "abi-note.S"), | 264 | .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "abi-note.S"), |
| 259 | .extra_flags = args.items, | 265 | .cache_exempt_flags = args.items, |
| 260 | }; | 266 | }; |
| 261 | }; | 267 | }; |
| 262 | return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_o, abi_note_o }); | 268 | return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_o, abi_note_o }); |
| ... | @@ -355,7 +361,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -355,7 +361,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 355 | }); | 361 | }); |
| 356 | files_buf[files_index] = .{ | 362 | files_buf[files_index] = .{ |
| 357 | .src_path = try lib_path(comp, arena, dep.path), | 363 | .src_path = try lib_path(comp, arena, dep.path), |
| 358 | .extra_flags = args.items, | 364 | .cache_exempt_flags = args.items, |
| 359 | }; | 365 | }; |
| 360 | files_index += 1; | 366 | files_index += 1; |
| 361 | } | 367 | } |
| ... | @@ -661,7 +667,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void { | ... | @@ -661,7 +667,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void { |
| 661 | var man = cache.obtain(); | 667 | var man = cache.obtain(); |
| 662 | defer man.deinit(); | 668 | defer man.deinit(); |
| 663 | man.hash.addBytes(build_options.version); | 669 | man.hash.addBytes(build_options.version); |
| 664 | man.hash.addBytes(comp.zig_lib_directory.path orelse "."); | | |
| 665 | man.hash.add(target.cpu.arch); | 670 | man.hash.add(target.cpu.arch); |
| 666 | man.hash.add(target.abi); | 671 | man.hash.add(target.abi); |
| 667 | man.hash.add(target_version); | 672 | man.hash.add(target_version); |