| author | |
| committer | |
| log | 41ab64c3eb7a104e78ca96cfe861a03f3a150d47 |
| tree | 357286a9f8e5b282497595d4082e388169256928 |
| parent | 8cf2cfc52c23fec8de2fa8ca54c2589daed2135b |
Some logic has comptime-known conditions, causing the inferred error set
to be different on different compiler build configurations.2 files changed, 36 insertions(+), 1 deletions(-)
src/Compilation/Config.zig+33-1| ... | @@ -99,7 +99,39 @@ pub const Options = struct { | ... | @@ -99,7 +99,39 @@ pub const Options = struct { |
| 99 | rdynamic: ?bool = null, | 99 | rdynamic: ?bool = null, |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | pub fn resolve(options: Options) !Config { | 102 | pub const ResolveError = error{ |
| 103 | WasiExecModelRequiresWasi, | ||
| 104 | SharedMemoryIsWasmOnly, | ||
| 105 | ObjectFilesCannotShareMemory, | ||
| 106 | SharedMemoryRequiresAtomicsAndBulkMemory, | ||
| 107 | ThreadsRequireSharedMemory, | ||
| 108 | UnknownTargetEntryPoint, | ||
| 109 | NonExecutableEntryPoint, | ||
| 110 | EmittingLlvmModuleRequiresLlvmBackend, | ||
| 111 | LlvmLacksTargetSupport, | ||
| 112 | ZigLacksTargetSupport, | ||
| 113 | EmittingBinaryRequiresLlvmLibrary, | ||
| 114 | LldIncompatibleObjectFormat, | ||
| 115 | LtoRequiresLld, | ||
| 116 | SanitizeThreadRequiresLibCpp, | ||
| 117 | LibCppRequiresLibUnwind, | ||
| 118 | OsRequiresLibC, | ||
| 119 | LibCppRequiresLibC, | ||
| 120 | LibUnwindRequiresLibC, | ||
| 121 | TargetCannotDynamicLink, | ||
| 122 | LibCRequiresDynamicLinking, | ||
| 123 | SharedLibrariesRequireDynamicLinking, | ||
| 124 | ExportMemoryAndDynamicIncompatible, | ||
| 125 | DynamicLibraryPrecludesPie, | ||
| 126 | TargetRequiresPie, | ||
| 127 | SanitizeThreadRequiresPie, | ||
| 128 | BackendLacksErrorTracing, | ||
| 129 | LlvmLibraryUnavailable, | ||
| 130 | LldUnavailable, | ||
| 131 | ClangUnavailable, | ||
| 132 | }; | ||
| 133 | |||
| 134 | pub fn resolve(options: Options) ResolveError!Config { | ||
| 103 | const target = options.resolved_target.result; | 135 | const target = options.resolved_target.result; |
| 104 | 136 | ||
| 105 | // WASI-only. Resolve the optional exec-model option, defaults to command. | 137 | // WASI-only. Resolve the optional exec-model option, defaults to command. |
src/main.zig+3| ... | @@ -3867,6 +3867,9 @@ fn createModule( | ... | @@ -3867,6 +3867,9 @@ fn createModule( |
| 3867 | error.TargetRequiresPie => fatal("the specified target requires position independent executables", .{}), | 3867 | error.TargetRequiresPie => fatal("the specified target requires position independent executables", .{}), |
| 3868 | error.SanitizeThreadRequiresPie => fatal("thread sanitization requires position independent executables", .{}), | 3868 | error.SanitizeThreadRequiresPie => fatal("thread sanitization requires position independent executables", .{}), |
| 3869 | error.BackendLacksErrorTracing => fatal("the selected backend has not yet implemented error return tracing", .{}), | 3869 | error.BackendLacksErrorTracing => fatal("the selected backend has not yet implemented error return tracing", .{}), |
| 3870 | error.LlvmLibraryUnavailable => fatal("zig was compiled without LLVM libraries", .{}), | ||
| 3871 | error.LldUnavailable => fatal("zig was compiled without LLD libraries", .{}), | ||
| 3872 | error.ClangUnavailable => fatal("zig was compiled without Clang libraries", .{}), | ||
| 3870 | }; | 3873 | }; |
| 3871 | } | 3874 | } |
| 3872 | 3875 |