zig cc maps -O1/-O2/-O3 to one level (-O2) — intended? and is there a clean -O3 escape hatch? (opens in new tab)
Hi all — sharing a finding plus a couple of questions after a confusing afternoon, in case it helps others and to sanity-check my understanding. I was cross-compiling DuckDB’s amalgamation (~24 MB single translation unit) to aarch64-linux-musl with zig c++, building three times changing only -O1 / -O2 / -O3. All three produced byte-identical 456 MB objects — and each was a genuine ~4.5-minute compile, not a cache hit. After digging (the trail leads to Zig’s ReleaseFast → clang -O2 mapping), h...
Read the original article