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.