Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.
1453 Discussions

What configuration can cause error when resolving libcxx dependencies?

l_r
Beginner
1,003 Views

I have started to work on an already existing SGX Application, with an already existing Makefile, that is for 90% the same as the one in the CXX11SGXDemo, but of course has some modifications (Important ones below).

I wanted to use some standard c++ classes (like vector), and I can compile the small snippets that I wrote when I include them in the CXX11SGX Demo, but In this project, the linker gives the error

/usr/bin/ld: Udfs/extended-data-types.o: in function `std::__1::vector<row_t, std::__1::allocator<row_t> >::allocate(unsigned long)':
/home/leonhard/sgx/sdk/sgxsdk/include/libcxx/vector:930: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: Udfs/extended-data-types.o: in function `std::__1::allocator<row_t>::allocate(unsigned long, void const*)':
/home/leonhard/sgx/sdk/sgxsdk/include/libcxx/memory:1740: undefined reference to `std::bad_alloc::bad_alloc()'

 

Which is what I get when I try to include the line

auto* rows = new std::vector<row_t>(underlying->tuples, underlying->tuples + underlying->num_tuples * sizeof(row_t));

Other small snippets in the similar spirit cause similar errors, all in relation to exceptions from <new> or <stdexcept>

 

The biggest difference in the makefile are (probably) the link flags:

Enclave_Link_Flags := $(Enclave_Security_Link_Flags) \
-Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_TRUSTED_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--whole-archive -lsgx_tcmalloc -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_omp -lsgx_pthread -lsgx_tkey_exchange -l$(Crypto_Library_Name) \
-l$(Service_Library_Name) -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

 Is there anything that has to be configured differently?

Labels (1)
0 Kudos
3 Replies
JesusG_Intel
Moderator
994 Views

Hello l_r,


How closely are you following the Cxx11SGXDemo?


To help us troubleshoot, send your full Makefile.


Did you remember to source the sgxsdk/environment file?


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
JesusG_Intel
Moderator
964 Views

Hello l_r,


Do you still need help with this issue?


You should follow Cxx11SGXDemo as closely as possible.


To help us troubleshoot, send your full Makefile.


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
JesusG_Intel
Moderator
941 Views

Hello l_r,


We have not heard from you in several days so we will no longer monitor this thread. We hope you were able to resolve your issue. Please start a new thread if you need further help.


Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.


0 Kudos
Reply