evervault/node-secureworker

Can't build an enclave.so file due to missing import sgx_tae_service in duk_enclave file

Opened this issue · 1 comments

I'm trying to build an enclave.so file, but it seems to be missing an import. I spent a while installing SGX and have re-read the documentation a few times so I don't think the install is missing anything. How might I fix this? Where should this sgx_tae_service.h be? I can't find reference to it in the SGX SDK

./secureworker-create --output enclave.so hello-world-from-enclave.js
g++ -m64 -O0 -g -nostdinc -fvisibility=hidden -fpie -fstack-protector -I/opt/intel/sgxsdk/include -I/opt/intel/sgxsdk/include/tlibc -I/opt/intel/sgxsdk/include/stdc++ -std=c++03 -nostdinc++ -Iduktape-1.4.0/src-separate -Iscripts -c -o duk_enclave/duk_enclave.o duk_enclave/duk_enclave.cpp
duk_enclave/duk_enclave.cpp:6:10: fatal error: sgx_tae_service.h: No such file or directory
#include "sgx_tae_service.h"
^~~~~~~~~~~~~~~~~~~
compilation terminated.
: recipe for target 'duk_enclave/duk_enclave.o' failed
make: *** [duk_enclave/duk_enclave.o] Error 1
child_process.js:624
throw err;
^

Error: Command failed: make enclave SCRIPTS=/home/jason/WebstormProjects/sgx-test/node_modules/secureworker/bin/hello-world-from-enclave.js ENCLAVE_KEY=/home/jason/WebstormProjects/sgx-test/node_modules/secureworker/bin/key.pem ENCLAVE_CONFIG=/home/jason/WebstormProjects/sgx-test/node_modules/secureworker/bin/enclave.config.xml ENCLAVE_OUTPUT=/home/jason/WebstormProjects/sgx-test/node_modules/secureworker/bin/enclave.so
at checkExecSyncError (child_process.js:603:11)
at Object.execFileSync (child_process.js:621:15)
at Object. (/home/jason/WebstormProjects/sgx-test/node_modules/secureworker/bin/secureworker-create:34:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
at Module.load (internal/modules/cjs/loader.js:914:32)
at Function.Module._load (internal/modules/cjs/loader.js:822:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1143:12)
at internal/main/run_main_module.js:16:11 {
status: 2,
signal: null,
output: [ null, null, null ],
pid: 41369,
stdout: null,
stderr: null
}

EDIT: I downgraded all of the SGX tools to 2.7 and it worked. I guess there is a breaking change in the latest SGX SDK or PSW.

sgx_tae_service.h removed since sgx sdk 2.8, u may see that in the release notes