frontend: make dll_export_fns=false on non-windows

Fixes a regression introduced in this branch.
This commit is contained in:
Andrew Kelley 2023-12-27 13:20:13 -07:00
parent 476484f09c
commit 791e83c223
2 changed files with 9 additions and 2 deletions

View File

@ -138,6 +138,7 @@ pub const ResolveError = error{
LlvmLibraryUnavailable,
LldUnavailable,
ClangUnavailable,
DllExportFnsRequiresWindows,
};
pub fn resolve(options: Options) ResolveError!Config {
@ -459,6 +460,11 @@ pub fn resolve(options: Options) ResolveError!Config {
const rdynamic = options.rdynamic orelse false;
const dll_export_fns = b: {
if (target.os.tag != .windows) {
if (options.dll_export_fns == true)
return error.DllExportFnsRequiresWindows;
break :b false;
}
if (options.dll_export_fns) |x| break :b x;
if (rdynamic) break :b true;
break :b switch (options.output_mode) {

View File

@ -3842,8 +3842,8 @@ fn createModule(
create_module.opts.any_dyn_libs = true;
create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) {
error.WasiExecModelRequiresWasi => fatal("execution model only allowed for WASI OS targets", .{}),
error.SharedMemoryIsWasmOnly => fatal("shared memory only allowed for WebAssembly CPU targets", .{}),
error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}),
error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}),
error.ObjectFilesCannotShareMemory => fatal("object files cannot share memory", .{}),
error.SharedMemoryRequiresAtomicsAndBulkMemory => fatal("shared memory requires atomics and bulk_memory CPU features", .{}),
error.ThreadsRequireSharedMemory => fatal("threads require shared memory", .{}),
@ -3869,6 +3869,7 @@ fn createModule(
error.LlvmLibraryUnavailable => fatal("zig was compiled without LLVM libraries", .{}),
error.LldUnavailable => fatal("zig was compiled without LLD libraries", .{}),
error.ClangUnavailable => fatal("zig was compiled without Clang libraries", .{}),
error.DllExportFnsRequiresWindows => fatal("only Windows OS targets support DLLs", .{}),
};
}