Create Polyspace Platform Project from Cross-Compiler Build
R2026bWhen you create a Polyspace® Platform project from a build command that uses a supported cross-compiler, the project uses a fully configured template toolchain corresponding to this cross-compiler. Template toolchains are predefined toolchains for supported cross-compilers such as Green Hills®, IAR, Wind River® Diab, and others. For more information on template toolchains and how to configure them, see Configure Template Toolchains for Testing (Polyspace Test).
This example uses a Green Hills build command to illustrate the workflow. You can apply the same approach to any other supported cross-compiler toolchain.
Build Project with Cross-Compiler
Before running polyspace-configure, make sure that your cross-compiler build completes successfully. For instance, if you use the Green Hills
gbuild command to build a project file default.gpj:
<GHS_Install_Dir>/gbuild -all default.gpj<GHS_Install_Dir> is the folder where the Green Hills compiler executables are installed. The build must complete without errors.Create Project from Build Command
Trace the build command with polyspace-configure to create a Polyspace Platform project:
polyspace-configure -output-platform-project myGHSProject <GHS_Install_Dir>/gbuild -all default.gpjWhen gbuild runs, it invokes the underlying Green Hills compiler commands (for instance, ccppc for C files and cxppc for C++ files on a PowerPC target). polyspace-configure traces these compiler invocations, identifies the compiler as a Green Hills compiler targeting PowerPC, and selects the matching template toolchain greenhills - powerpc.
Resulting Configuration
Open the generated project myGHSProject.psprjx in the Polyspace Platform User Interface. In the build configuration:
Compilation toolchain (Testing) is set to the template toolchain
greenhills - powerpc.The Folder toolchain configuration variable is set to the path of the Green Hills installation folder (
<GHS_Install_Dir>), which is where the compiler executables reside.Compilation toolchain (Static analysis) is set to
Same as testing toolchain.Target board name (Testing) is set to
None.The source files from the project match the sources referenced in
default.gpj.
Running polyspace-configure with the cross-compiler build command produces a project where the template toolchain is fully configured. The toolchain configuration variable Folder is automatically populated from the path to the compiler executable in the build command, so the project is ready for building and testing without further manual configuration.
See Also
polyspace-configure | Compilation toolchain (Testing) (Polyspace Test) | Compilation toolchain for static analysis (-compiler)