mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
tsan: update build logic for tsan from llvm 17.0.6
This commit is contained in:
parent
854b88fda0
commit
798c68d5a5
@ -92,7 +92,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -102,10 +102,11 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
});
|
||||
}
|
||||
|
||||
const platform_tsan_sources = if (target.isDarwin())
|
||||
&darwin_tsan_sources
|
||||
else
|
||||
&unix_tsan_sources;
|
||||
const platform_tsan_sources = switch (target.os.tag) {
|
||||
.ios, .macos, .watchos, .tvos => &darwin_tsan_sources,
|
||||
.windows => &windows_tsan_sources,
|
||||
else => &unix_tsan_sources,
|
||||
};
|
||||
try c_source_files.ensureUnusedCapacity(platform_tsan_sources.len);
|
||||
for (platform_tsan_sources) |tsan_src| {
|
||||
var cflags = std.ArrayList([]const u8).init(arena);
|
||||
@ -115,7 +116,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -155,10 +156,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-I");
|
||||
try cflags.append(sanitizer_common_include_path);
|
||||
try cflags.append("-I");
|
||||
try cflags.append(tsan_include_path);
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -180,10 +183,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-I");
|
||||
try cflags.append(sanitizer_common_include_path);
|
||||
try cflags.append("-I");
|
||||
try cflags.append(tsan_include_path);
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -204,7 +209,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -233,7 +238,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
try cflags.append("-nostdinc++");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
try cflags.append("-std=c++14");
|
||||
try cflags.append("-std=c++17");
|
||||
try cflags.append("-fno-rtti");
|
||||
|
||||
c_source_files.appendAssumeCapacity(.{
|
||||
@ -278,12 +283,12 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) !void {
|
||||
}
|
||||
|
||||
const tsan_sources = [_][]const u8{
|
||||
"tsan_clock.cpp",
|
||||
"tsan_debugging.cpp",
|
||||
"tsan_external.cpp",
|
||||
"tsan_fd.cpp",
|
||||
"tsan_flags.cpp",
|
||||
"tsan_ignoreset.cpp",
|
||||
"tsan_interceptors_memintrinsics.cpp",
|
||||
"tsan_interceptors_posix.cpp",
|
||||
"tsan_interface.cpp",
|
||||
"tsan_interface_ann.cpp",
|
||||
@ -293,9 +298,12 @@ const tsan_sources = [_][]const u8{
|
||||
"tsan_md5.cpp",
|
||||
"tsan_mman.cpp",
|
||||
"tsan_mutexset.cpp",
|
||||
"tsan_new_delete.cpp",
|
||||
"tsan_platform_windows.cpp",
|
||||
"tsan_preinit.cpp",
|
||||
"tsan_report.cpp",
|
||||
"tsan_rtl.cpp",
|
||||
"tsan_rtl_access.cpp",
|
||||
"tsan_rtl_mutex.cpp",
|
||||
"tsan_rtl_proc.cpp",
|
||||
"tsan_rtl_report.cpp",
|
||||
@ -304,6 +312,7 @@ const tsan_sources = [_][]const u8{
|
||||
"tsan_suppressions.cpp",
|
||||
"tsan_symbolize.cpp",
|
||||
"tsan_sync.cpp",
|
||||
"tsan_vector_clock.cpp",
|
||||
};
|
||||
|
||||
const darwin_tsan_sources = [_][]const u8{
|
||||
@ -318,9 +327,17 @@ const unix_tsan_sources = [_][]const u8{
|
||||
"tsan_platform_posix.cpp",
|
||||
};
|
||||
|
||||
const windows_tsan_sources = [_][]const u8{
|
||||
"tsan_platform_windows.cpp",
|
||||
};
|
||||
|
||||
const sanitizer_common_sources = [_][]const u8{
|
||||
"sanitizer_allocator.cpp",
|
||||
"sanitizer_chained_origin_depot.cpp",
|
||||
"sanitizer_common.cpp",
|
||||
"sanitizer_coverage_win_dll_thunk.cpp",
|
||||
"sanitizer_coverage_win_dynamic_runtime_thunk.cpp",
|
||||
"sanitizer_coverage_win_weak_interception.cpp",
|
||||
"sanitizer_deadlock_detector1.cpp",
|
||||
"sanitizer_deadlock_detector2.cpp",
|
||||
"sanitizer_errno.cpp",
|
||||
@ -335,8 +352,6 @@ const sanitizer_common_sources = [_][]const u8{
|
||||
"sanitizer_mac.cpp",
|
||||
"sanitizer_mutex.cpp",
|
||||
"sanitizer_netbsd.cpp",
|
||||
"sanitizer_openbsd.cpp",
|
||||
"sanitizer_persistent_allocator.cpp",
|
||||
"sanitizer_platform_limits_freebsd.cpp",
|
||||
"sanitizer_platform_limits_linux.cpp",
|
||||
"sanitizer_platform_limits_netbsd.cpp",
|
||||
@ -351,15 +366,22 @@ const sanitizer_common_sources = [_][]const u8{
|
||||
"sanitizer_procmaps_linux.cpp",
|
||||
"sanitizer_procmaps_mac.cpp",
|
||||
"sanitizer_procmaps_solaris.cpp",
|
||||
"sanitizer_range.cpp",
|
||||
"sanitizer_solaris.cpp",
|
||||
"sanitizer_stack_store.cpp",
|
||||
"sanitizer_stoptheworld_fuchsia.cpp",
|
||||
"sanitizer_stoptheworld_mac.cpp",
|
||||
"sanitizer_stoptheworld_win.cpp",
|
||||
"sanitizer_suppressions.cpp",
|
||||
"sanitizer_termination.cpp",
|
||||
"sanitizer_thread_arg_retval.cpp",
|
||||
"sanitizer_thread_registry.cpp",
|
||||
"sanitizer_tls_get_addr.cpp",
|
||||
"sanitizer_type_traits.cpp",
|
||||
"sanitizer_win.cpp",
|
||||
"sanitizer_win_dll_thunk.cpp",
|
||||
"sanitizer_win_dynamic_runtime_thunk.cpp",
|
||||
"sanitizer_win_weak_interception.cpp",
|
||||
};
|
||||
|
||||
const sanitizer_nolibc_sources = [_][]const u8{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user