diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-26 21:39:39 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-01 17:51:21 -0700 |
| commit | 57562c8d507667b6fefcb7fbc7a305fbd610b5dd (patch) | |
| tree | f0e494bdace7302f7cce8ad8c9c7d3227bd81d64 /src/Compilation | |
| parent | c9fe43679f8d8f0db6250cc881b59cc68daaf128 (diff) | |
| download | zig-57562c8d507667b6fefcb7fbc7a305fbd610b5dd.tar.gz zig-57562c8d507667b6fefcb7fbc7a305fbd610b5dd.zip | |
compiler: push entry symbol name resolution into the linker
This is necessary because on COFF, the entry symbol name is not known
until the linker has looked at the set of global symbol names to
determine which of the four possible main entry points is present.
Diffstat (limited to 'src/Compilation')
| -rw-r--r-- | src/Compilation/Config.zig | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig index d5f3b2ef95..4abf3e88d4 100644 --- a/src/Compilation/Config.zig +++ b/src/Compilation/Config.zig @@ -55,7 +55,6 @@ export_memory: bool, shared_memory: bool, is_test: bool, test_evented_io: bool, -entry: ?[]const u8, debug_format: DebugFormat, root_strip: bool, root_error_tracing: bool, @@ -100,12 +99,6 @@ pub const Options = struct { use_lld: ?bool = null, use_clang: ?bool = null, lto: ?bool = null, - entry: union(enum) { - default, - disabled, - enabled, - named: []const u8, - } = .default, /// WASI-only. Type of WASI execution model ("command" or "reactor"). wasi_exec_model: ?std.builtin.WasiExecModel = null, import_memory: ?bool = null, @@ -123,8 +116,6 @@ pub const ResolveError = error{ ObjectFilesCannotShareMemory, SharedMemoryRequiresAtomicsAndBulkMemory, ThreadsRequireSharedMemory, - UnknownTargetEntryPoint, - NonExecutableEntryPoint, EmittingLlvmModuleRequiresLlvmBackend, LlvmLacksTargetSupport, ZigLacksTargetSupport, @@ -352,25 +343,6 @@ pub fn resolve(options: Options) ResolveError!Config { break :b false; }; - const entry: ?[]const u8 = switch (options.entry) { - .disabled => null, - .default => b: { - if (options.output_mode != .Exe) break :b null; - - // When producing C source code, the decision of entry point is made - // when compiling the C code, not when producing the C code. - if (target.ofmt == .c) break :b null; - - break :b target_util.defaultEntrySymbolName(target, wasi_exec_model) orelse - return error.UnknownTargetEntryPoint; - }, - .enabled => target_util.defaultEntrySymbolName(target, wasi_exec_model) orelse - return error.UnknownTargetEntryPoint, - .named => |name| name, - }; - if (entry != null and options.output_mode != .Exe) - return error.NonExecutableEntryPoint; - const any_unwind_tables = options.any_unwind_tables or link_libunwind or target_util.needUnwindTables(target); @@ -519,7 +491,6 @@ pub fn resolve(options: Options) ResolveError!Config { .use_llvm = use_llvm, .use_lib_llvm = use_lib_llvm, .use_lld = use_lld, - .entry = entry, .wasi_exec_model = wasi_exec_model, .debug_format = debug_format, .root_strip = root_strip, |
