I'm working with Intel SGX and would like to use Chaiscript inside an enclave. SGX forbids the use of dynamically loaded libraries inside an enclave. Is there any way to use Chaiscript in such ways (I cannot compile using the "-ldl" parameter)?
Using Chaiscript without dynamically loaded libraries
262 Views Asked by user1866363 At
2
There are 2 best solutions below
0

See this comment from lefticus (Jason Turner) the author of Chaiscript:
You should never try linking to the chaiscript stdlib, as the compiler is warning you about. ChaiScript is fundamentally a header-only toolkit. It also has the ability to use loadable modules, and it's possible to compile the standard library as one of those loadable modules.
Source is here: https://github.com/ChaiScript/ChaiScript/issues/126
Since ChaiScript 6.0 the standard library has been compiled into ChaiScript itself. So that aspect does not need
-ldl
.What you are looking for is the
-DCHAISCRIPT_NO_DYNLOAD
option, which completely disables the ability to dynamically load libraries and does not require linking against the dynamic loader.