feat: make clang20 preset use zig with glibc 2.35#20897
Merged
johnathan79717 merged 4 commits intoFeb 26, 2026
Conversation
Change the clang20 preset (and variants) to use zig cc/c++ with native-linux-gnu.2.35 target. This ensures every build — dev and release — produces binaries compatible with Ubuntu 22.04+ (glibc 2.35). Also pin cross-compile zig presets (zig-amd64-linux, zig-arm64-linux) to glibc 2.35. Tested: bb built with cmake --preset clang20 runs correctly in ubuntu:22.04 docker container. Max glibc required: 2.34.
ludamad
approved these changes
Feb 26, 2026
Three fixes: 1. smt-verification preset: override CC/CXX back to clang-20 and clear CMAKE_AR/CMAKE_RANLIB. cvc5's ExternalProject configure.sh passes CMAKE_C_COMPILER=/usr/local/bin/zig to cmake which then calls zig without the 'cc' subcommand, breaking compiler detection. SMT is a CI-only tool so glibc 2.35 targeting is not required. 2. field.fuzzer.hpp: mark uint_product [[maybe_unused]] — only used in assert() which is compiled away in some build configs. 3. sha256.fuzzer.cpp: mark circuit_val [[maybe_unused]] — same reason.
…resets Zig does not provide the ASAN/TSAN/etc. runtime libraries (libclang_rt.asan), causing link errors for __asan_* symbols. Debug and sanitizer presets now override CC/CXX back to plain clang-20 (inheriting clang20's cmake settings like TARGET_ARCH/ENABLE_PIC, but skipping zig's compiler wrapper). smt-verification similarly uses clang-20 directly because cvc5's ExternalProject receives CMAKE_C_COMPILER and needs a plain compiler binary (not zig, which requires the `cc` subcommand). Both presets null out CMAKE_AR/CMAKE_RANLIB so zig-ar.sh does not propagate to sub-projects.
…warnings Zig does not provide libFuzzer (libclang_rt.fuzzer), causing 'undefined symbol: main' when linking fuzzer binaries with -fsanitize=fuzzer. Change fuzzing presets to use plain clang-20 instead of zig: - fuzzing: inherits from default with CC=clang-20 (was clang20/zig) - fuzzing-noasm, fuzzing-coverage: now inherit from fuzzing - fuzzing-avm: override CC/CXX to clang-20, null CMAKE_AR/RANLIB Also fix two more [[maybe_unused]] warnings in fuzzer files where variables are only referenced inside assert() which is compiled away in release builds: - field.fuzzer.hpp: product - sha256.fuzzer.cpp: expected_output
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 27, 2026
BEGIN_COMMIT_OVERRIDE chore: builders audit response 0 (#20792) feat: early circuit block deallocation after trace populate (#20776) fix: Fix script for testing vks haven't changed (#20852) fix: move debug_incoming_circuit before block deallocation in Chonk::accumulate (#20876) refactor: deduplicate debug_incoming_circuit in Chonk::accumulate (#20870) fix: denoise causing mysterious error 141 (#20871) feat: make clang20 preset use zig with glibc 2.35 (#20897) chore: remove final instances of unneeded +1 in SRS construction (#20912) chore: avoid use of size_t in bbapi to be safe (#20916) chore: Claudebox remedy example (#20922) END_COMMIT_OVERRIDE
johnathan79717
added a commit
that referenced
this pull request
Mar 4, 2026
## Summary - Change the \`clang20\` preset (and variants) to use \`zig cc/c++ -target native-linux-gnu.2.35\` instead of plain \`clang-20\`. This ensures every build — dev and release — produces binaries compatible with Ubuntu 22.04+ (glibc 2.35). - Pin cross-compile zig presets (\`zig-amd64-linux\`, \`zig-arm64-linux\`) to glibc 2.35. - The \`native\` zig target auto-detects host architecture — no hardcoded \`x86_64\`/\`aarch64\`. - \`debug\` preset inherits from \`default\` with explicit \`CC=clang-20\` so all sanitizer presets (ASAN/TSAN/UBSAN/MSAN) use plain clang-20. Zig does not provide the sanitizer runtimes (\`libclang_rt.asan\` etc.). - \`smt-verification\` inherits from \`clang20\` but overrides to \`CC=clang-20\` with \`CMAKE_AR=null\`, since cvc5's ExternalProject receives \`CMAKE_C_COMPILER\` and needs a plain binary path. - Remove \`bb-cpp-cross-amd64-linux\` Makefile target — native \`clang20\` build now covers amd64-linux. - Remove release-preset switching in \`bootstrap.sh\` — \`clang20\`'s \`build/\` dir is already glibc 2.35 compatible. ## Test plan - [x] Built \`bb\` with \`cmake --preset clang20\`, confirmed max glibc requirement is 2.34 via \`readelf -V\` - [x] Ran \`bb --version\` inside \`ubuntu:22.04\` Docker container — succeeded - [x] Fuzz presets configure/build correctly (fixed \`[[maybe_unused]]\` for \`-Wunused-variable\` under \`-Wfatal-errors\`) - [x] \`asan-fast\` preset configures with \`clang-20\` compiler (not zig) — \`CMAKE_C_COMPILER=/usr/bin/clang-20\` - [x] \`smt-verification\` preset configures with \`clang-20\` — \`CMAKE_C_COMPILER=/usr/bin/clang-20\`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan