Skip To Main Content
Support Knowledge Base

Is It Possible to Measure Test Coverage in Intel® Software Guard Extensions (Intel® SGX) Enclaves Using “Gcov” or Some Other Method?

Content Type: Maintenance & Performance   |   Article ID: 000057733   |   Last Reviewed: 07/31/2024

Description

  • Attempted to compile Intel® SGX enclave with the GNU Compiler Collection [GCC] --coverage flag in order to use gcov
  • Received compilation errors related to libgcov.a and other undefined references

Resolution

  • It is possible to use gcov to get code coverage data for the untrusted part of the Intel® SGX application.
  • It is not possible to use gcov get coverage data for the Intel® SGX enclave code.
  • Calling the untrusted gcov library from within an Intel® SGX enclave causes compilation errors.
  • Any calls to functions outside of the enclave have to be wrapped in an OCALL.

Additional information

Refer to the Trusted Libraries section of the Intel® SGX Developer Reference for Linux for more information on library calls you can make directly from within enclaves.

Related Products

This article applies to 3 products.

Discontinued Products

Intel® Tiber™ Trust Authority Intel® Software Guard Extensions (Intel® SGX)