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

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

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

How to measure test coverage in Intel® SGX enclaves.

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 2 products