diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-01-03 00:57:25 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-03 00:57:25 -0500 |
| commit | 8bd734d60cd55d65ea52a051ccdc35939edeb99c (patch) | |
| tree | 673eae57056242a83d1971af16b926b942528b6c /src | |
| parent | c1f404ad537ded5a584525f7f89dcf5705a2c405 (diff) | |
| parent | 7798af74614af595390130b364817626603be21e (diff) | |
| download | zig-8bd734d60cd55d65ea52a051ccdc35939edeb99c.tar.gz zig-8bd734d60cd55d65ea52a051ccdc35939edeb99c.zip | |
Merge pull request #13699 from mikdusan/bsd
give BSDs some attention
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/Elf.zig | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 466442cd77..4910f4b599 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -3058,27 +3058,22 @@ const CsuObjects = struct { var result: CsuObjects = .{}; - // TODO: https://github.com/ziglang/zig/issues/4629 - // - use inline enum type - // - reduce to enum-literals for values - const Mode = enum { + // Flatten crt cases. + const mode: enum { dynamic_lib, dynamic_exe, dynamic_pie, static_exe, static_pie, - }; - - // Flatten crt case types. - const mode: Mode = switch (link_options.output_mode) { + } = switch (link_options.output_mode) { .Obj => return CsuObjects{}, .Lib => switch (link_options.link_mode) { - .Dynamic => Mode.dynamic_lib, + .Dynamic => .dynamic_lib, .Static => return CsuObjects{}, }, .Exe => switch (link_options.link_mode) { - .Dynamic => if (link_options.pie) Mode.dynamic_pie else Mode.dynamic_exe, - .Static => if (link_options.pie) Mode.static_pie else Mode.static_exe, + .Dynamic => if (link_options.pie) .dynamic_pie else .dynamic_exe, + .Static => if (link_options.pie) .static_pie else .static_exe, }, }; @@ -3108,7 +3103,6 @@ const CsuObjects = struct { // hosted-glibc provides crtbegin/end objects in platform/compiler-specific dirs // and they are not known at comptime. For now null-out crtbegin/end objects; // there is no feature loss, zig has never linked those objects in before. - // TODO: probe for paths, ie. `cc -print-file-name` result.crtbegin = null; result.crtend = null; } else { |
