Hello,
We are trying to build a simple c++ code for eapp based on the hello example. When running it in the non-docker keystone (with the latest code), the eapp printed out "the futex facility returned an unexpected error code", then kept on printing "non-handle interrupt/exception at 0x10c54 on 0x0 (scause:0x3) error" after finishing uncompressing keystone enclave package. The same code can be run successfully on the docker version of Keystone (keystoneenclaveorg/keystone:master). We are wondering whether keystone still support C++ on eapp. If so, what is the correct way to build c++ for eapp?
Our C++ code is as below:
#include <iostream>
int main()
{
std::cout << "The VGG16 Net" << std::endl;
std::cout << "-----------------------------" << std::endl;
std::cout << "NAME:\tMEM\tPARAM\tMAC" << std::endl;
std::cout << "-----------------------------" << std::endl;
return 0;
}
Our CMakeList.txt is as follows:
set(eapp_bin vgg16-simple)
set(eapp_src eapp/vgg16-simple.cpp)
set(host_bin vgg16-simple-runner)
set(host_src host/host.cpp)
set(package_name "vgg16-simple.ke")
set(package_script "./vgg16-simple-runner vgg16-simple eyrie-rt loader.bin")
if(RISCV32)
set(eyrie_plugins "freemem io_syscall linux_syscall env_setup rv32")
else()
set(eyrie_plugins "freemem io_syscall linux_syscall env_setup")
endif()
#We tried the below to replace above. But still did not work.
#set(eyrie_plugins "io_syscall linux_syscall env_setup")
# eapp
add_executable(${eapp_bin} ${eapp_src})
target_link_libraries(${eapp_bin} "-static")
set_target_properties(${eapp_bin} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO)
# host
add_executable(${host_bin} ${host_src})
target_link_libraries(${host_bin} ${KEYSTONE_LIB_HOST} ${KEYSTONE_LIB_EDGE})
# add target for Eyrie runtime (see keystone.cmake)
set(eyrie_files_to_copy .options_log eyrie-rt loader.bin)
add_eyrie_runtime(${eapp_bin}-eyrie
${eyrie_plugins}
${eyrie_files_to_copy})
# add target for packaging (see keystone.cmake)
add_keystone_package(${eapp_bin}-package
${package_name}
${package_script}
${eyrie_files_to_copy} ${eapp_bin} ${host_bin})
add_dependencies(${eapp_bin}-package ${eapp_bin}-eyrie)
# add package to the top-level target
add_dependencies(examples ${eapp_bin}-package)
Thanks!