Currently, this code is modified from the release tarball. We should also wrap code changes in a new config flag or something.
Some notes:
duktape-dist
- SGX include dirs,
/NODEFAULTLIB - Compile for SGX platform.
DUK_OPT_NO_FILE_IO - File I/O is not available in enclave.
DUK_OPT_CPP_EXCEPTIONS - The SGX SDK doesn't support setjmp.
DUK_OPT_NO_JX - The SGX SDK doesn't support sscanf, which JX needs.
/TP - Compile as C++ because we need C++ exceptions.
Code changes (duktape-dist)
DUK_SNPRINTF in duk_bi_date.c - The SGX SDK doesn't support sprintf (without the "n"). Provide DUK_BI_DATE_ISO8601_BUFSIZE.
duk_bi_date_get_*_sgx - Stubbed out routines for getting the time and locale information from the OS. Consider using SGX's Trusted Time system to implement this for real.
- Don't include
<windows.h> - We're not running on Windows.
- Don't include
<setjmp.h> - The SGX SDK doesn't have this file.
- Use unprefixed
snprintf and vsnprintf - That's what the SGX SDK provides.
- Remove
duk_file and DUK_STD* - The SGX SDK doesn't provide the underlying FILE and std*.
Currently, this code is modified from the release tarball. We should also wrap code changes in a new config flag or something.
Some notes:
duktape-dist
/NODEFAULTLIB- Compile for SGX platform.DUK_OPT_NO_FILE_IO- File I/O is not available in enclave.DUK_OPT_CPP_EXCEPTIONS- The SGX SDK doesn't supportsetjmp.DUK_OPT_NO_JX- The SGX SDK doesn't supportsscanf, which JX needs./TP- Compile as C++ because we need C++ exceptions.Code changes (duktape-dist)
DUK_SNPRINTFin duk_bi_date.c - The SGX SDK doesn't supportsprintf(without the "n"). ProvideDUK_BI_DATE_ISO8601_BUFSIZE.duk_bi_date_get_*_sgx- Stubbed out routines for getting the time and locale information from the OS. Consider using SGX's Trusted Time system to implement this for real.<windows.h>- We're not running on Windows.<setjmp.h>- The SGX SDK doesn't have this file.snprintfandvsnprintf- That's what the SGX SDK provides.duk_fileandDUK_STD*- The SGX SDK doesn't provide the underlyingFILEandstd*.