| ... | @@ -2053,7 +2053,14 @@ pub fn create(gpa: Allocator, arena: Allocator, diag: *CreateDiagnostic, options | ... | @@ -2053,7 +2053,14 @@ pub fn create(gpa: Allocator, arena: Allocator, diag: *CreateDiagnostic, options |
| 2053 | break :s .none; // only LLD can handle ubsan-rt for this target | 2053 | break :s .none; // only LLD can handle ubsan-rt for this target |
| 2054 | } else true, | 2054 | } else true, |
| 2055 | }; | 2055 | }; |
| 2056 | if (have_zcu and (!need_llvm or use_llvm)) break :s .zcu; | 2056 | if (have_zcu and (!need_llvm or use_llvm)) { |
| | 2057 | // ubsan-rt's exports use hidden visibility. If we're building a Windows DLL and |
| | 2058 | // exported functions are going to be dllexported, LLVM will complain that |
| | 2059 | // dllexported functions must use default or protected visibility. So we can't use |
| | 2060 | // the ZCU strategy in this case. |
| | 2061 | if (options.config.dll_export_fns) break :s .lib; |
| | 2062 | break :s .zcu; |
| | 2063 | } |
| 2057 | if (need_llvm and !build_options.have_llvm) break :s .none; // impossible to build without llvm | 2064 | if (need_llvm and !build_options.have_llvm) break :s .none; // impossible to build without llvm |
| 2058 | if (is_exe_or_dyn_lib) break :s .lib; | 2065 | if (is_exe_or_dyn_lib) break :s .lib; |
| 2059 | break :s .obj; | 2066 | break :s .obj; |