authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-11-10 12:56:35+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-11-10 12:56:35+00:00
log13993c4f62d8603aa5a25de70e2d111a01cbfaab
treef6148a9c44f6acb600086675a59a9704c6d99230
parent6d280dc1b0779209b4790da9e939d8254d11348a
signaturelock-open Commit is signed but in an unrecognized format.

compiler: warn when using -fincremental with LLVM backend

This configuration hasn't had much work put into it yet, so is all but guaranteed to miscompile or crash. Since users are starting to try out `-fincremental`, and LLVM is still the default backend in many cases, it's worth having this warning to avoid bug reports like https://github.com/ziglang/zig/issues/25873.

1 files changed, 4 insertions(+), 0 deletions(-)

src/main.zig+4
...@@ -3360,6 +3360,10 @@ fn buildOutputType(...@@ -3360,6 +3360,10 @@ fn buildOutputType(
3360 fatal("--debug-incremental requires -fincremental", .{});3360 fatal("--debug-incremental requires -fincremental", .{});
3361 }3361 }
33623362
3363 if (incremental and create_module.resolved_options.use_llvm) {
3364 warn("-fincremental is currently unsupported by the LLVM backend; crashes or miscompilations are likely", .{});
3365 }
3366
3363 const cache_mode: Compilation.CacheMode = b: {3367 const cache_mode: Compilation.CacheMode = b: {
3364 // Once incremental compilation is the default, we'll want some smarter logic here,3368 // Once incremental compilation is the default, we'll want some smarter logic here,
3365 // considering things like the backend in use and whether there's a ZCU.3369 // considering things like the backend in use and whether there's a ZCU.