Porting LUA to SGX application

74 views Asked by At

I want to use Luacpp in an SGX application. For example, in the SampleEnclave application, I want to send some Lua codes to be executed securely in SGX.

I have updated the Enclave's MakeFile to make the SampleEnclave app Lua compatible. But getting below error:

/usr/local/bin/ld: Enclave/Enclave.o: warning: relocation against `_ZTVN6LuaCpp6Engine10LuaTStringE' in read-only section `.text._ZN6LuaCpp6Engine10LuaTStringD2Ev[_ZN6LuaCpp6Engine10LuaTStringD5Ev]'
    /usr/local/bin/ld: /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
    /usr/local/bin/ld: DWARF error: section .debug_str is larger than its filesize! (0x55ebb vs 0x40078)
Enclave/Enclave.o:/usr/local/include/LuaCpp/Engine/LuaTString.hpp:62: undefined reference to `LuaCpp::Engine::LuaType::LuaType()'
/usr/local/bin/ld: Enclave/Enclave.o:/usr/local/include/LuaCpp/Engine/LuaTString.hpp:62: undefined reference to `vtable for LuaCpp::Engine::LuaTString'
/usr/local/bin/ld: Enclave/Enclave.o:/usr/local/include/LuaCpp/Engine/LuaTString.hpp:67: undefined reference to `vtable for LuaCpp::Engine::LuaTString'
/usr/local/bin/ld: Enclave/Enclave.o:/usr/local/include/LuaCpp/Engine/LuaTString.hpp:67: undefined reference to `LuaCpp::Engine::LuaType::~LuaType()'
/usr/local/bin/ld: Enclave/Enclave.o: in function `ecall_test':
/home/alam/practice/LuaEnclave/Enclave/Enclave.cpp:55: undefined reference to `LuaCpp::LuaContext::AddGlobalVariable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<LuaCpp::Engine::LuaType>)'
/usr/local/bin/ld: /home/alam/practice/LuaEnclave/Enclave/Enclave.cpp:56: undefined reference to `LuaCpp::LuaContext::CompileString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: /home/alam/practice/LuaEnclave/Enclave/Enclave.cpp:62: undefined reference to `LuaCpp::LuaContext::Run(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: /home/alam/practice/LuaEnclave/Enclave/Enclave.cpp:69: undefined reference to `LuaCpp::Engine::LuaTString::getValue() const'
/usr/local/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:256: enclave.so] Error 1
make[1]: Leaving directory '/home/alam/practice/LuaEnclave'
make: *** [Makefile:181: all] Error 2

Can I get rid of the dynamic library dependency from LUA? Because SGX does not support dynamic libraries in Enclave.

0

There are 0 answers