authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 15:58:42-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 15:58:42-07:00
log7d4bc54277ca89d80af05e76809ab3d041f494ac
treea4acd569d4dcf19be281c411f746ebed88d7020c
parent8583e88db522f0f94f2110f1d255406e5e7e99fd

work around stage1 limitations


1 files changed, 7 insertions(+), 5 deletions(-)

src/link/Elf.zig+7-5
......@@ -3074,22 +3074,24 @@ const CsuObjects = struct {
30743074
30753075 var result: CsuObjects = .{};
30763076
3077 // Flatten crt cases.
3078 const mode: enum {
3077 const Mode = enum {
30793078 dynamic_lib,
30803079 dynamic_exe,
30813080 dynamic_pie,
30823081 static_exe,
30833082 static_pie,
3084 } = switch (link_options.output_mode) {
3083 };
3084
3085 // Flatten crt cases.
3086 const mode: Mode = switch (link_options.output_mode) {
30853087 .Obj => return CsuObjects{},
30863088 .Lib => switch (link_options.link_mode) {
30873089 .Dynamic => .dynamic_lib,
30883090 .Static => return CsuObjects{},
30893091 },
30903092 .Exe => switch (link_options.link_mode) {
3091 .Dynamic => if (link_options.pie) .dynamic_pie else .dynamic_exe,
3092 .Static => if (link_options.pie) .static_pie else .static_exe,
3093 .Dynamic => if (link_options.pie) Mode.dynamic_pie else Mode.dynamic_exe,
3094 .Static => if (link_options.pie) Mode.static_pie else Mode.static_exe,
30933095 },
30943096 };
30953097