Add CBMC target platform support#1200
Closed
tob-joe wants to merge 2 commits into
Closed
Conversation
Add explicit CBMC target platform selection for the proof infrastructure, including i386 Linux support with an i686 preprocessor and matching target-model flags. Add target compiler shims for goto-instrument, a target ABI canary proof, and the solver/proof configuration tweaks needed by the 32-bit ML-DSA suite. Verification: git diff --check; python3 -B -m py_compile scripts/tests proofs/cbmc/run-cbmc-proofs.py; ./scripts/tests cbmc --help target list; canary dry-runs for i386-linux, x86_64-linux, aarch64-linux, riscv64-linux, riscv32-linux, and ppc64le-linux; nix eval --raw .#devShells.aarch64-linux.cbmc32.drvPath. Signed-off-by: Joe Doyle <joseph.doyle@trailofbits.com> Co-authored-by: Codex <codex@openai.com>
Remove riscv32-linux from the CBMC target platform list because this CBMC toolchain does not support that architecture model. Keep the regular repository cross-riscv32 shell untouched; only the CBMC target interface and cbmc32 proof shell are narrowed. Verification: git diff --check; python3 -B -m py_compile scripts/tests proofs/cbmc/run-cbmc-proofs.py; ./scripts/tests cbmc --help target list; canary dry-runs for i386-linux, x86_64-linux, aarch64-linux, riscv64-linux, and ppc64le-linux; nix eval --raw .#devShells.aarch64-linux.cbmc32.drvPath. Signed-off-by: Joe Doyle <joseph.doyle@trailofbits.com> Co-authored-by: Codex <codex@openai.com>
Author
|
Superseded by #1201, which removes the unsupported riscv32 CBMC target and keeps a single commit with parseable trailers. |
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
i386-linux,x86_64-linux,aarch64-linux,riscv64-linux, andppc64le-linuxcbmc32Nix shell with the matching target compilersgoto-ccandgoto-instrumentsize_t,long, anduint64_twidthsTarget execution model
The CBMC proofs do not execute target binaries. No QEMU or binfmt is involved in these proof runs. The target compiler is used to build the GOTO program with matching headers/preprocessor definitions, and CBMC checks that program on the host under the selected target model.
The repository also has
riscv32andaarch64_becross shells, but this PR does not expose them as CBMC targets.riscv32is not supported by this CBMC target-model set, and this CBMC toolchain exposesarm64rather than a separate big-endian Arm64 model foraarch64_be. The compiler and CBMC target model should agree before adding either lane.Verification
git diff --checkpython3 -B -m py_compile scripts/tests proofs/cbmc/run-cbmc-proofs.py./scripts/tests cbmc --help | rg -- '--cbmc-target|i386-linux|x86_64-linux|aarch64-linux|riscv64-linux|ppc64le-linux|riscv32-linux|native|ilp32'i386-linux,x86_64-linux,aarch64-linux,riscv64-linux, andppc64le-linuxnix eval --raw .#devShells.aarch64-linux.cbmc32.drvPathThis work was completed by Trail of Bits as part of the Patch The Planet project in collaboration with OpenAI. The issue was identified primarily by the Codex coding agent, and manually reviewed before submission.