| ... | ... | @@ -3058,27 +3058,22 @@ const CsuObjects = struct { |
| 3058 | 3058 | |
| 3059 | 3059 | var result: CsuObjects = .{}; |
| 3060 | 3060 | |
| 3061 | | // TODO: https://github.com/ziglang/zig/issues/4629 |
| 3062 | | // - use inline enum type |
| 3063 | | // - reduce to enum-literals for values |
| 3064 | | const Mode = enum { |
| 3061 | // Flatten crt cases. |
| 3062 | const mode: enum { |
| 3065 | 3063 | dynamic_lib, |
| 3066 | 3064 | dynamic_exe, |
| 3067 | 3065 | dynamic_pie, |
| 3068 | 3066 | static_exe, |
| 3069 | 3067 | static_pie, |
| 3070 | | }; |
| 3071 | | |
| 3072 | | // Flatten crt case types. |
| 3073 | | const mode: Mode = switch (link_options.output_mode) { |
| 3068 | } = switch (link_options.output_mode) { |
| 3074 | 3069 | .Obj => return CsuObjects{}, |
| 3075 | 3070 | .Lib => switch (link_options.link_mode) { |
| 3076 | | .Dynamic => Mode.dynamic_lib, |
| 3071 | .Dynamic => .dynamic_lib, |
| 3077 | 3072 | .Static => return CsuObjects{}, |
| 3078 | 3073 | }, |
| 3079 | 3074 | .Exe => switch (link_options.link_mode) { |
| 3080 | | .Dynamic => if (link_options.pie) Mode.dynamic_pie else Mode.dynamic_exe, |
| 3081 | | .Static => if (link_options.pie) Mode.static_pie else Mode.static_exe, |
| 3075 | .Dynamic => if (link_options.pie) .dynamic_pie else .dynamic_exe, |
| 3076 | .Static => if (link_options.pie) .static_pie else .static_exe, |
| 3082 | 3077 | }, |
| 3083 | 3078 | }; |
| 3084 | 3079 | |
| ... | ... | @@ -3108,7 +3103,6 @@ const CsuObjects = struct { |
| 3108 | 3103 | // hosted-glibc provides crtbegin/end objects in platform/compiler-specific dirs |
| 3109 | 3104 | // and they are not known at comptime. For now null-out crtbegin/end objects; |
| 3110 | 3105 | // there is no feature loss, zig has never linked those objects in before. |
| 3111 | | // TODO: probe for paths, ie. `cc -print-file-name` |
| 3112 | 3106 | result.crtbegin = null; |
| 3113 | 3107 | result.crtend = null; |
| 3114 | 3108 | } else { |