Polyspace configure - Compiler Configuration for cctc
Show older comments
I encountered a problem when running polyspace-configure with a json file as compile database for a TASKING Tricore Compiler.
polyspace-configure: 2s: ERROR: Binary: V6_3r1p5\bin\cctc.exe not recognized as a valid compiler.
polyspace-configure: 2s: ERROR: All detected programs are unknown: there is no matching compiler configuration found.
polyspace-configure: 2s: ERROR: Fatal error
While investigating the tasking.xml in compiler_configuration, i saw this information:
<!--
The driver (cctc) calls the C (ctc) or C++ (cptc) compiler. Tasking
documents the latters so end-users may call them directly and consequently
we must register them here.
We do not register the cctc driver here because there is a conflict on the
-c option. For the driver it must be specified in <compile_options_list>
(or there will be link error when polyspace-configure re-invokes it)
but the compilers do not support it. See g2074811 for details.
-->
What is the recommended workflow for TASKING TriCore projects whose build system invokes cctc.exe?
Is there a supported way to create or extend the compiler configuration to handle cctc.exe?
3 Comments
Torsten
on 2 Nov 2026 at 11:18
If the below answer doesn't help, contact official TMW support:
Answer from AI:
The error occurs because Polyspace explicitly excludes cctc.exe (the TASKING control program/driver wrapper) from its default compiler configuration due to fundamental option conflicts (such as how the -c flag is parsed and passed during downstream re-invocation). Instead, Polyspace expects to see the direct underlying compilers: ctc.exe for C source files and cptc.exe for C++ source files. [1]
Because your build system records the driver wrapper (cctc.exe) in the JSON compilation database, polyspace-configure fails to map the commands to a known toolchain. [1]
Recommended Workflow: Post-Process the JSON Database
The most robust, industry-standard workflow for this scenario is to pre-process the compile_commands.json file before passing it to polyspace-configure. You can use a script (Python, PowerShell, or a simple text replacement tool) to rewrite the commands based on the file extension: [1, 2]
- For C files (.c): Replace instances of cctc.exe with ctc.exe.
- For C++ files (.cpp, .cc): Replace instances of cctc.exe with cptc.exe. [1]
Example Python Post-Processing Script
You can automate this step in your CI/CD or build pipeline with a short script like this:
python
import json
import re
json_path = "compile_commands.json"
with open(json_path, "r") as f:
db = json.load(f)
for entry in db:
file_path = entry.get("file", "")
# Determine the actual underlying compiler compiler binary
compiler_replacement = "ctc.exe"
if file_path.lower().endswith((".cpp", ".cc", ".cxx")):
compiler_replacement = "cptc.exe"
# Update the command string if 'command' field is used
if "command" in entry:
entry["command"] = re.sub(r"\bcctc(\.exe)?\b", compiler_replacement, entry["command"])
# Update the arguments list if 'arguments' field is used
if "arguments" in entry:
entry["arguments"] = [
compiler_replacement if re.search(r"\bcctc(\.exe)?\b", arg) else arg
for arg in entry["arguments"]
]
with open("compile_commands_polyspace.json", "w") as f:
json.dump(db, f, indent=2)
bash
polyspace-configure -compilation-database compile_commands_polyspace.json -output-platform-project my_project.psprjx
Can you extend the compiler configuration (tasking.xml)?
While Polyspace supports writing custom XML compiler configurations to map unrecognized binaries, attempting to force cctc.exe support via XML customization is explicitly discouraged. [1]
As noted in the comment inside tasking.xml, if you add a registration entry for cctc.exe, polyspace-configure will attempt to parse the arguments like a regular compiler stub. However, because cctc.exe is a driver wrapper, it uses unique combinations of flags (such as the mandatory mapping requirements for -c or --pass-c) that break the internal option-handling logic of Polyspace's translation layer. This invariably leads to syntax errors, missed source components, or translation phase crashes down the line.
Summary: Do not customize the XML to recognize cctc.exe. Instead, alter your JSON compilation database to point directly to ctc.exe or cptc.exe.
Hello Torsten, hello Hoa,
Hoa had raised a TS ticket in parallel, which I've answered yesterday. Our recommendation is also to edit the compilation database to point to the cptc (C++) and ctc (C) executables respectively.
Starting with R2026a, this workaround isn't necessary anymore.
Michael
Note, that I didn't validate the Python script above to perform this substitution as expected.
Answers (0)
Categories
Find more on Generate Reports in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!