| ... | ... | @@ -174,6 +174,12 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 174 | 174 | const target_ver = target.os.version_range.linux.glibc; |
| 175 | 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 | 183 | switch (crt_file) { |
| 178 | 184 | .crti_o => { |
| 179 | 185 | var args = std.ArrayList([]const u8).init(arena); |
| ... | ... | @@ -193,7 +199,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 193 | 199 | return comp.build_crt_file("crti", .Obj, &[1]Compilation.CSourceFile{ |
| 194 | 200 | .{ |
| 195 | 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 | 218 | return comp.build_crt_file("crtn", .Obj, &[1]Compilation.CSourceFile{ |
| 213 | 219 | .{ |
| 214 | 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 | 243 | const src_path = if (start_old_init_fini) "start-2.33.S" else "start.S"; |
| 238 | 244 | break :blk .{ |
| 239 | 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 | 249 | const abi_note_o: Compilation.CSourceFile = blk: { |
| ... | ... | @@ -256,7 +262,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 256 | 262 | }); |
| 257 | 263 | break :blk .{ |
| 258 | 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 | 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 | 361 | }); |
| 356 | 362 | files_buf[files_index] = .{ |
| 357 | 363 | .src_path = try lib_path(comp, arena, dep.path), |
| 358 | | .extra_flags = args.items, |
| 364 | .cache_exempt_flags = args.items, |
| 359 | 365 | }; |
| 360 | 366 | files_index += 1; |
| 361 | 367 | } |
| ... | ... | @@ -661,7 +667,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void { |
| 661 | 667 | var man = cache.obtain(); |
| 662 | 668 | defer man.deinit(); |
| 663 | 669 | man.hash.addBytes(build_options.version); |
| 664 | | man.hash.addBytes(comp.zig_lib_directory.path orelse "."); |
| 665 | 670 | man.hash.add(target.cpu.arch); |
| 666 | 671 | man.hash.add(target.abi); |
| 667 | 672 | man.hash.add(target_version); |