intel / linux-sgx

Intel SGX for Linux*
https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/linux-overview.html
Other
1.32k stars 543 forks source link

Undefined error in SampleEnclaveGMIPP #769

Open Yuvashri26 opened 2 years ago

Yuvashri26 commented 2 years ago

I'm getting following undefined error even after including IPP header in the Makefile of SampleEnclaveGMIPP.

/usr/bin/ld: Enclave/Enclave.o: in functionnew_ECC_sm2()': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:68: undefined reference to sgx_disp_ippsECCPGetSizeStdSM2' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:82: undefined reference tosgx_disp_ippsECCPInitStdSM2' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:90: undefined reference to sgx_disp_ippsECCPSetStdSM2' /usr/bin/ld: Enclave/Enclave.o: in functionnew_ECC_Point()': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:107: undefined reference to sgx_disp_ippsECCPPointGetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:119: undefined reference tosgx_disp_ippsECCPPointInit' /usr/bin/ld: Enclave/Enclave.o: in function new_BN(int, unsigned int const*)': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:136: undefined reference tosgx_disp_ippsBigNumGetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:148: undefined reference to sgx_disp_ippsBigNumInit' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:156: undefined reference tosgx_disp_ippsSet_BN' /usr/bin/ld: Enclave/Enclave.o: in function new_PRNG()': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:168: undefined reference tosgx_disp_ippsPRNGGetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:180: undefined reference to sgx_disp_ippsPRNGInit' /usr/bin/ld: Enclave/Enclave.o: in functionecall_sm2': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:234: undefined reference to sgx_disp_ippsPRNGen' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:252: undefined reference tosgx_disp_ippsMod_BN' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:286: undefined reference to sgx_disp_ippsPRNGen' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:286: undefined reference tosgx_disp_ippsECCPGenKeyPair' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:292: undefined reference to sgx_disp_ippsPRNGen' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:292: undefined reference tosgx_disp_ippsECCPGenKeyPair' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:300: undefined reference to sgx_disp_ippsECCPSetKeyPair' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:318: undefined reference tosgx_disp_ippsECCPSignSM2' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:326: undefined reference to sgx_disp_ippsECCPSetKeyPair' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:332: undefined reference tosgx_disp_ippsECCPVerifySM2' /usr/bin/ld: Enclave/Enclave.o: in function ecall_sm3': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:370: undefined reference tosgx_disp_ippsSM3GetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:386: undefined reference to sgx_disp_ippsSM3Init' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:395: undefined reference tosgx_disp_ippsSM3Update' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:404: undefined reference to sgx_disp_ippsSM3GetTag' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:413: undefined reference tosgx_disp_ippsSM3Final' /usr/bin/ld: Enclave/Enclave.o: in function ecall_sm4_cbc': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:455: undefined reference tosgx_disp_ippsSMS4GetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:471: undefined reference to sgx_disp_ippsSMS4Init' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:479: undefined reference tosgx_disp_ippsSMS4EncryptCBC' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:485: undefined reference to sgx_disp_ippsSMS4DecryptCBC' /usr/bin/ld: Enclave/Enclave.o: in functionecall_sm4_ctr': /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:528: undefined reference to sgx_disp_ippsSMS4GetSize' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:544: undefined reference tosgx_disp_ippsSMS4Init' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:555: undefined reference to sgx_disp_ippsSMS4EncryptCTR' /usr/bin/ld: /test/SampleCode/SampleEnclaveGMIPP/Enclave/Enclave.cpp:564: undefined reference tosgx_disp_ippsSMS4DecryptCTR' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:255: enclave.so] Error 1`

For some of the functions, I get deprecated warning like below Enclave/Enclave.cpp:68:41: warning: 'IppStatus sgx_disp_ippsECCPGetSizeStdSM2(int*)' is deprecated: is deprecated. This API is considered obsolete and will be removed in one of future Intel IPP Cryptography releases. Use the following link for opening a ticket and providing feedback: https://supporttickets.intel.com/ if you have concerns.

OS: Debian GNU/Linux 11 (bullseye) SDK version: 2.15.1

llly commented 2 years ago

Please install latest SGX SDK and use SampleCode, instead of only copy SampleCode.