| ... | ... | @@ -127,6 +127,7 @@ const Value = extern struct { |
| 127 | 127 | ) !void { |
| 128 | 128 | comptime assert(fmt.len == 0); |
| 129 | 129 | |
| 130 | // Work around x86_64 backend limitation. |
| 130 | 131 | if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) { |
| 131 | 132 | try writer.writeAll("(unknown)"); |
| 132 | 133 | return; |
| ... | ... | @@ -646,6 +647,7 @@ fn exportHandler( |
| 646 | 647 | handler: anytype, |
| 647 | 648 | comptime sym_name: []const u8, |
| 648 | 649 | ) void { |
| 650 | // Work around x86_64 backend limitation. |
| 649 | 651 | const linkage = if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) .internal else .weak; |
| 650 | 652 | const N = "__ubsan_handle_" ++ sym_name; |
| 651 | 653 | @export(handler, .{ .name = N, .linkage = linkage }); |
| ... | ... | @@ -656,6 +658,7 @@ fn exportHandlerWithAbort( |
| 656 | 658 | abort_handler: anytype, |
| 657 | 659 | comptime sym_name: []const u8, |
| 658 | 660 | ) void { |
| 661 | // Work around x86_64 backend limitation. |
| 659 | 662 | const linkage = if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) .internal else .weak; |
| 660 | 663 | { |
| 661 | 664 | const N = "__ubsan_handle_" ++ sym_name; |
| ... | ... | @@ -697,12 +700,12 @@ comptime { |
| 697 | 700 | exportHandler(&missingReturn, "missing_return"); |
| 698 | 701 | } |
| 699 | 702 | |
| 700 | | // these checks are nearly impossible to duplicate in zig, as they rely on nuances |
| 703 | // these checks are nearly impossible to replicate in zig, as they rely on nuances |
| 701 | 704 | // in the Itanium C++ ABI. |
| 702 | | // exportHelper("dynamic_type_cache_miss", "dynamic-type-cache-miss", true); |
| 703 | | // exportHelper("vptr_type_cache", "vptr-type-cache", true); |
| 705 | // exportHandlerWithAbort(&dynamicTypeCacheMiss, &dynamicTypeCacheMissAbort, "dynamic-type-cache-miss"); |
| 706 | // exportHandlerWithAbort(&vptrTypeCache, &vptrTypeCacheAbort, "vptr-type-cache"); |
| 704 | 707 | |
| 705 | 708 | // we disable -fsanitize=function for reasons explained in src/Compilation.zig |
| 706 | | // exportHelper("function-type-mismatch", "function_type_mismatch", true); |
| 707 | | // exportHelper("function-type-mismatch-v1", "function_type_mismatch_v1", true); |
| 709 | // exportHandlerWithAbort(&functionTypeMismatch, &functionTypeMismatchAbort, "function-type-mismatch"); |
| 710 | // exportHandlerWithAbort(&functionTypeMismatchV1, &functionTypeMismatchV1Abort, "function-type-mismatch-v1"); |
| 708 | 711 | } |