| ... | @@ -92,7 +92,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -92,7 +92,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 92 | | 92 | |
| 93 | try cflags.append("-nostdinc++"); | 93 | try cflags.append("-nostdinc++"); |
| 94 | try cflags.append("-fvisibility-inlines-hidden"); | 94 | try cflags.append("-fvisibility-inlines-hidden"); |
| 95 | try cflags.append("-std=c++14"); | 95 | try cflags.append("-std=c++17"); |
| 96 | try cflags.append("-fno-rtti"); | 96 | try cflags.append("-fno-rtti"); |
| 97 | | 97 | |
| 98 | c_source_files.appendAssumeCapacity(.{ | 98 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -102,10 +102,11 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -102,10 +102,11 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 102 | }); | 102 | }); |
| 103 | } | 103 | } |
| 104 | | 104 | |
| 105 | const platform_tsan_sources = if (target.isDarwin()) | 105 | const platform_tsan_sources = switch (target.os.tag) { |
| 106 | &darwin_tsan_sources | 106 | .ios, .macos, .watchos, .tvos => &darwin_tsan_sources, |
| 107 | else | 107 | .windows => &windows_tsan_sources, |
| 108 | &unix_tsan_sources; | 108 | else => &unix_tsan_sources, |
| | 109 | }; |
| 109 | try c_source_files.ensureUnusedCapacity(platform_tsan_sources.len); | 110 | try c_source_files.ensureUnusedCapacity(platform_tsan_sources.len); |
| 110 | for (platform_tsan_sources) |tsan_src| { | 111 | for (platform_tsan_sources) |tsan_src| { |
| 111 | var cflags = std.ArrayList([]const u8).init(arena); | 112 | var cflags = std.ArrayList([]const u8).init(arena); |
| ... | @@ -115,7 +116,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -115,7 +116,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 115 | | 116 | |
| 116 | try cflags.append("-nostdinc++"); | 117 | try cflags.append("-nostdinc++"); |
| 117 | try cflags.append("-fvisibility-inlines-hidden"); | 118 | try cflags.append("-fvisibility-inlines-hidden"); |
| 118 | try cflags.append("-std=c++14"); | 119 | try cflags.append("-std=c++17"); |
| 119 | try cflags.append("-fno-rtti"); | 120 | try cflags.append("-fno-rtti"); |
| 120 | | 121 | |
| 121 | c_source_files.appendAssumeCapacity(.{ | 122 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -155,10 +156,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -155,10 +156,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 155 | | 156 | |
| 156 | try cflags.append("-I"); | 157 | try cflags.append("-I"); |
| 157 | try cflags.append(sanitizer_common_include_path); | 158 | try cflags.append(sanitizer_common_include_path); |
| | 159 | try cflags.append("-I"); |
| | 160 | try cflags.append(tsan_include_path); |
| 158 | | 161 | |
| 159 | try cflags.append("-nostdinc++"); | 162 | try cflags.append("-nostdinc++"); |
| 160 | try cflags.append("-fvisibility-inlines-hidden"); | 163 | try cflags.append("-fvisibility-inlines-hidden"); |
| 161 | try cflags.append("-std=c++14"); | 164 | try cflags.append("-std=c++17"); |
| 162 | try cflags.append("-fno-rtti"); | 165 | try cflags.append("-fno-rtti"); |
| 163 | | 166 | |
| 164 | c_source_files.appendAssumeCapacity(.{ | 167 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -180,10 +183,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -180,10 +183,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 180 | | 183 | |
| 181 | try cflags.append("-I"); | 184 | try cflags.append("-I"); |
| 182 | try cflags.append(sanitizer_common_include_path); | 185 | try cflags.append(sanitizer_common_include_path); |
| | 186 | try cflags.append("-I"); |
| | 187 | try cflags.append(tsan_include_path); |
| 183 | | 188 | |
| 184 | try cflags.append("-nostdinc++"); | 189 | try cflags.append("-nostdinc++"); |
| 185 | try cflags.append("-fvisibility-inlines-hidden"); | 190 | try cflags.append("-fvisibility-inlines-hidden"); |
| 186 | try cflags.append("-std=c++14"); | 191 | try cflags.append("-std=c++17"); |
| 187 | try cflags.append("-fno-rtti"); | 192 | try cflags.append("-fno-rtti"); |
| 188 | | 193 | |
| 189 | c_source_files.appendAssumeCapacity(.{ | 194 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -204,7 +209,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -204,7 +209,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 204 | | 209 | |
| 205 | try cflags.append("-nostdinc++"); | 210 | try cflags.append("-nostdinc++"); |
| 206 | try cflags.append("-fvisibility-inlines-hidden"); | 211 | try cflags.append("-fvisibility-inlines-hidden"); |
| 207 | try cflags.append("-std=c++14"); | 212 | try cflags.append("-std=c++17"); |
| 208 | try cflags.append("-fno-rtti"); | 213 | try cflags.append("-fno-rtti"); |
| 209 | | 214 | |
| 210 | c_source_files.appendAssumeCapacity(.{ | 215 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -233,7 +238,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -233,7 +238,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 233 | | 238 | |
| 234 | try cflags.append("-nostdinc++"); | 239 | try cflags.append("-nostdinc++"); |
| 235 | try cflags.append("-fvisibility-inlines-hidden"); | 240 | try cflags.append("-fvisibility-inlines-hidden"); |
| 236 | try cflags.append("-std=c++14"); | 241 | try cflags.append("-std=c++17"); |
| 237 | try cflags.append("-fno-rtti"); | 242 | try cflags.append("-fno-rtti"); |
| 238 | | 243 | |
| 239 | c_source_files.appendAssumeCapacity(.{ | 244 | c_source_files.appendAssumeCapacity(.{ |
| ... | @@ -278,12 +283,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { | ... | @@ -278,12 +283,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 278 | } | 283 | } |
| 279 | | 284 | |
| 280 | const tsan_sources = [_][]const u8{ | 285 | const tsan_sources = [_][]const u8{ |
| 281 | "tsan_clock.cpp", | | |
| 282 | "tsan_debugging.cpp", | 286 | "tsan_debugging.cpp", |
| 283 | "tsan_external.cpp", | 287 | "tsan_external.cpp", |
| 284 | "tsan_fd.cpp", | 288 | "tsan_fd.cpp", |
| 285 | "tsan_flags.cpp", | 289 | "tsan_flags.cpp", |
| 286 | "tsan_ignoreset.cpp", | 290 | "tsan_ignoreset.cpp", |
| | 291 | "tsan_interceptors_memintrinsics.cpp", |
| 287 | "tsan_interceptors_posix.cpp", | 292 | "tsan_interceptors_posix.cpp", |
| 288 | "tsan_interface.cpp", | 293 | "tsan_interface.cpp", |
| 289 | "tsan_interface_ann.cpp", | 294 | "tsan_interface_ann.cpp", |
| ... | @@ -293,9 +298,12 @@ const tsan_sources = [_][]const u8{ | ... | @@ -293,9 +298,12 @@ const tsan_sources = [_][]const u8{ |
| 293 | "tsan_md5.cpp", | 298 | "tsan_md5.cpp", |
| 294 | "tsan_mman.cpp", | 299 | "tsan_mman.cpp", |
| 295 | "tsan_mutexset.cpp", | 300 | "tsan_mutexset.cpp", |
| | 301 | "tsan_new_delete.cpp", |
| | 302 | "tsan_platform_windows.cpp", |
| 296 | "tsan_preinit.cpp", | 303 | "tsan_preinit.cpp", |
| 297 | "tsan_report.cpp", | 304 | "tsan_report.cpp", |
| 298 | "tsan_rtl.cpp", | 305 | "tsan_rtl.cpp", |
| | 306 | "tsan_rtl_access.cpp", |
| 299 | "tsan_rtl_mutex.cpp", | 307 | "tsan_rtl_mutex.cpp", |
| 300 | "tsan_rtl_proc.cpp", | 308 | "tsan_rtl_proc.cpp", |
| 301 | "tsan_rtl_report.cpp", | 309 | "tsan_rtl_report.cpp", |
| ... | @@ -304,6 +312,7 @@ const tsan_sources = [_][]const u8{ | ... | @@ -304,6 +312,7 @@ const tsan_sources = [_][]const u8{ |
| 304 | "tsan_suppressions.cpp", | 312 | "tsan_suppressions.cpp", |
| 305 | "tsan_symbolize.cpp", | 313 | "tsan_symbolize.cpp", |
| 306 | "tsan_sync.cpp", | 314 | "tsan_sync.cpp", |
| | 315 | "tsan_vector_clock.cpp", |
| 307 | }; | 316 | }; |
| 308 | | 317 | |
| 309 | const darwin_tsan_sources = [_][]const u8{ | 318 | const darwin_tsan_sources = [_][]const u8{ |
| ... | @@ -318,9 +327,17 @@ const unix_tsan_sources = [_][]const u8{ | ... | @@ -318,9 +327,17 @@ const unix_tsan_sources = [_][]const u8{ |
| 318 | "tsan_platform_posix.cpp", | 327 | "tsan_platform_posix.cpp", |
| 319 | }; | 328 | }; |
| 320 | | 329 | |
| | 330 | const windows_tsan_sources = [_][]const u8{ |
| | 331 | "tsan_platform_windows.cpp", |
| | 332 | }; |
| | 333 | |
| 321 | const sanitizer_common_sources = [_][]const u8{ | 334 | const sanitizer_common_sources = [_][]const u8{ |
| 322 | "sanitizer_allocator.cpp", | 335 | "sanitizer_allocator.cpp", |
| | 336 | "sanitizer_chained_origin_depot.cpp", |
| 323 | "sanitizer_common.cpp", | 337 | "sanitizer_common.cpp", |
| | 338 | "sanitizer_coverage_win_dll_thunk.cpp", |
| | 339 | "sanitizer_coverage_win_dynamic_runtime_thunk.cpp", |
| | 340 | "sanitizer_coverage_win_weak_interception.cpp", |
| 324 | "sanitizer_deadlock_detector1.cpp", | 341 | "sanitizer_deadlock_detector1.cpp", |
| 325 | "sanitizer_deadlock_detector2.cpp", | 342 | "sanitizer_deadlock_detector2.cpp", |
| 326 | "sanitizer_errno.cpp", | 343 | "sanitizer_errno.cpp", |
| ... | @@ -335,8 +352,6 @@ const sanitizer_common_sources = [_][]const u8{ | ... | @@ -335,8 +352,6 @@ const sanitizer_common_sources = [_][]const u8{ |
| 335 | "sanitizer_mac.cpp", | 352 | "sanitizer_mac.cpp", |
| 336 | "sanitizer_mutex.cpp", | 353 | "sanitizer_mutex.cpp", |
| 337 | "sanitizer_netbsd.cpp", | 354 | "sanitizer_netbsd.cpp", |
| 338 | "sanitizer_openbsd.cpp", | | |
| 339 | "sanitizer_persistent_allocator.cpp", | | |
| 340 | "sanitizer_platform_limits_freebsd.cpp", | 355 | "sanitizer_platform_limits_freebsd.cpp", |
| 341 | "sanitizer_platform_limits_linux.cpp", | 356 | "sanitizer_platform_limits_linux.cpp", |
| 342 | "sanitizer_platform_limits_netbsd.cpp", | 357 | "sanitizer_platform_limits_netbsd.cpp", |
| ... | @@ -351,15 +366,22 @@ const sanitizer_common_sources = [_][]const u8{ | ... | @@ -351,15 +366,22 @@ const sanitizer_common_sources = [_][]const u8{ |
| 351 | "sanitizer_procmaps_linux.cpp", | 366 | "sanitizer_procmaps_linux.cpp", |
| 352 | "sanitizer_procmaps_mac.cpp", | 367 | "sanitizer_procmaps_mac.cpp", |
| 353 | "sanitizer_procmaps_solaris.cpp", | 368 | "sanitizer_procmaps_solaris.cpp", |
| | 369 | "sanitizer_range.cpp", |
| 354 | "sanitizer_solaris.cpp", | 370 | "sanitizer_solaris.cpp", |
| | 371 | "sanitizer_stack_store.cpp", |
| 355 | "sanitizer_stoptheworld_fuchsia.cpp", | 372 | "sanitizer_stoptheworld_fuchsia.cpp", |
| 356 | "sanitizer_stoptheworld_mac.cpp", | 373 | "sanitizer_stoptheworld_mac.cpp", |
| | 374 | "sanitizer_stoptheworld_win.cpp", |
| 357 | "sanitizer_suppressions.cpp", | 375 | "sanitizer_suppressions.cpp", |
| 358 | "sanitizer_termination.cpp", | 376 | "sanitizer_termination.cpp", |
| | 377 | "sanitizer_thread_arg_retval.cpp", |
| 359 | "sanitizer_thread_registry.cpp", | 378 | "sanitizer_thread_registry.cpp", |
| 360 | "sanitizer_tls_get_addr.cpp", | 379 | "sanitizer_tls_get_addr.cpp", |
| 361 | "sanitizer_type_traits.cpp", | 380 | "sanitizer_type_traits.cpp", |
| 362 | "sanitizer_win.cpp", | 381 | "sanitizer_win.cpp", |
| | 382 | "sanitizer_win_dll_thunk.cpp", |
| | 383 | "sanitizer_win_dynamic_runtime_thunk.cpp", |
| | 384 | "sanitizer_win_weak_interception.cpp", |
| 363 | }; | 385 | }; |
| 364 | | 386 | |
| 365 | const sanitizer_nolibc_sources = [_][]const u8{ | 387 | const sanitizer_nolibc_sources = [_][]const u8{ |