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.33k stars 543 forks source link

symbol undefined with third party library #705

Closed njeans closed 10 months ago

njeans commented 3 years ago

Hi, I want to do static code analysis of c/c++ code in an enclave. I am trying to see if I can use Libclang in my enclave.

I have installed libclang-dev in my Dockerfile and added

I am getting the errors

LINK => enclave.so -Wl,-z,relro,-z,now,-z,noexecstack -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L/opt/intel/sgxsdk/lib64 -Wl,--whole-archive -lsgx_trts -Wl,--no-whole-archive -Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_tcrypto -lsgx_tservice -lsgx_tprotected_fs -L/usr/lib/llvm-6.0/lib/ -lclang -Wl,--end-group -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections -Wl,--version-script=Enclave/Enclave.lds [check_symbol_table elfparser.cpp:253] symbol 'clang_createIndex' is undefined Symbol table incorrect The input enclave file is not correct. Error happened while signing the enclave.

I was expecting errors since it is not ported for sgx but the function it is talking about is just the libclang api function. Any advice is appreciated.

baoqian426 commented 11 months ago

how to resolve this problem

njeans commented 10 months ago

It can't be resolved as far as I know