Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Intel SGX Pthreads

PYuhala
Beginner
1,483 Views

Hello,

The latest Intel SGX developer Reference for Linux* OS (version 2.12) specifies (from page 137) APIs provided by the SGX pthread library. However there is not any example Sample code that uses or shows how to use these APIs in SGX applications. More specifically, what are the associated header files to import, EDL files etc. 

I have tried using the API (pthread_create(...) etc) after adding "-lsgx_pthread" in my link options, but this alone does not seem to be enough; the said routines are not found by my compiler. 

0 Kudos
1 Solution
JesusG_Intel
Moderator
1,470 Views

Hello PYuhala,

In addition to adding -lsgx_pthread to your link statement in the Makefile, you must...

  1. Copy sgxsdk/include/sgx_pthread.edl to your Enclave source directory.
  2. In Enclave.edl, add: from "sgx_pthread.edl" import *;
  3. In Enclave.cpp, add: #include "pthread.h"

 

View solution in original post

0 Kudos
3 Replies
JesusG_Intel
Moderator
1,471 Views

Hello PYuhala,

In addition to adding -lsgx_pthread to your link statement in the Makefile, you must...

  1. Copy sgxsdk/include/sgx_pthread.edl to your Enclave source directory.
  2. In Enclave.edl, add: from "sgx_pthread.edl" import *;
  3. In Enclave.cpp, add: #include "pthread.h"

 

0 Kudos
PYuhala
Beginner
1,456 Views

Hello, 

Thank you for your response. Will do as you have said.

0 Kudos
JesusG_Intel
Moderator
1,437 Views

This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.


0 Kudos
Reply