authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-18 19:32:07-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-20 20:59:52-08:00
log2391c460b1c137e44c8e0c092a2401b2676e2629
treef409585abb12765983a137ff5703cdf1c592cf82
parent77af309cb6e731a1f30967acc9e1204955c7d242

fix build failure when llvm not available


4 files changed, 15 insertions(+), 5 deletions(-)

src/glibc.zig+6-2
......@@ -178,7 +178,9 @@ pub const CrtFile = enum {
178178 libc_nonshared_a,
179179};
180180
181pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) !void {
181/// TODO replace anyerror with explicit error set, recording user-friendly errors with
182/// setMiscFailure and returning error.SubCompilationFailed. see libcxx.zig for example.
183pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) anyerror!void {
182184 if (!build_options.have_llvm) {
183185 return error.ZigCompilerNotBuiltWithLLVMExtensions;
184186 }
......@@ -735,7 +737,9 @@ fn wordDirective(target: std.Target) []const u8 {
735737 return if (target.ptrBitWidth() == 64) ".quad" else ".long";
736738}
737739
738pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !void {
740/// TODO replace anyerror with explicit error set, recording user-friendly errors with
741/// setMiscFailure and returning error.SubCompilationFailed. see libcxx.zig for example.
742pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anyerror!void {
739743 const tracy = trace(@src());
740744 defer tracy.end();
741745
src/mingw.zig+3-1
......@@ -17,7 +17,9 @@ pub const CrtFile = enum {
1717 mingw32_lib,
1818};
1919
20pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) !void {
20/// TODO replace anyerror with explicit error set, recording user-friendly errors with
21/// setMiscFailure and returning error.SubCompilationFailed. see libcxx.zig for example.
22pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) anyerror!void {
2123 if (!build_options.have_llvm) {
2224 return error.ZigCompilerNotBuiltWithLLVMExtensions;
2325 }
src/musl.zig+3-1
......@@ -18,7 +18,9 @@ pub const CrtFile = enum {
1818 libc_so,
1919};
2020
21pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Progress.Node) !void {
21/// TODO replace anyerror with explicit error set, recording user-friendly errors with
22/// setMiscFailure and returning error.SubCompilationFailed. see libcxx.zig for example.
23pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Progress.Node) anyerror!void {
2224 if (!build_options.have_llvm) {
2325 return error.ZigCompilerNotBuiltWithLLVMExtensions;
2426 }
src/wasi_libc.zig+3-1
......@@ -57,7 +57,9 @@ pub fn execModelCrtFileFullName(wasi_exec_model: std.builtin.WasiExecModel) []co
5757 };
5858}
5959
60pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) !void {
60/// TODO replace anyerror with explicit error set, recording user-friendly errors with
61/// setMiscFailure and returning error.SubCompilationFailed. see libcxx.zig for example.
62pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progress.Node) anyerror!void {
6163 if (!build_options.have_llvm) {
6264 return error.ZigCompilerNotBuiltWithLLVMExtensions;
6365 }