How can I use MKL in Enclave？
/usr/bin/ld: /opt/intel/compilers_and_libraries_2017.4.196/linux/mkl/lib/intel64/libmkl_core.a(mkl_msg_support.o): undefined reference to symbol 'fflush@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status makefile:203: recipe for target 'enclave.so' failed make: *** [enclave.so] Error
While trying to use MKL functions in enclave I meet this error, what can I do, to make it works.
You can not use untrusted library calls inside enclave. The untrusted library functions can only be called from application code - outside the enclave. Linking the enclave with any untrusted library either fail the enclave signing process or cause a runtime failure due to the use of restricted instructions.
You can refer to below document for more information on trusted/untrsusted libraries and linking application with the untrusted libraries.
I think if I can static link the untrusted library function into enclave successfully, I can used it. I my case, I want to use the MKL library function in enclave because one of the parameter is defined as secret and should not be bring out from enclave. Now I use an ecall get the parameter and destroy it immediately。