Article ID: 000090873 Content Type: Compatibility Last Reviewed: 05/23/2022

Compiling an Intel® Software Guard Extensions (Intel® SGX) Application with Position-Dependent Code

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

It is not possible to compile an Intel® SGX application with position-dependent code.

Description

Is it possible to create an Intel® SGX application that refernces a static library, compiled as position-dependent code? Use case:

  • Porting a test application to Intel® SGX application using third party porting tool, but can only successfully compile using -fPIC flag.
  • Only have access to .a files of one library, so recompiling as PIC is not an option.

 

Resolution

Porting a library means recompiling it from source where the -fPIC flag is mandatory. If you only have access to .a files of a library, using Gramine to wrap the whole application in an enclave is the best option although this is not the same as porting a library.

Related Products

This article applies to 1 products