It is not possible to compile an Intel® SGX application with position-dependent code.
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.
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.