edgelesssys / edgelessrt

Edgeless RT is an SDK and a runtime for Intel SGX. It combines top-notch Go support with simplicity, robustness and a small TCB. Developing confidential microservices has never been easier! C++17 and Rust (experimental) are also supported.
https://edgeless.systems
MIT License
134 stars 20 forks source link

build failure due to -Werror=jump-misses-init #105

Closed aep closed 2 years ago

aep commented 2 years ago

is there any tag that is known to build?

home/aep/consulting/enclaive/edgelessrt/build/3rdparty/openenclave/openenclave-src/include/openenclave/internal/raise.h:86:9: error: jump skips variable initialization [-Werror=jump-misses-init]
   86 |         goto done;                                        \
      |         ^~~~
/home/aep/consulting/enclaive/edgelessrt/build/3rdparty/openenclave/openenclave-src/include/openenclave/internal/raise.h:169:13: note: in expansion of macro ‘OE_RAISE’
  169 |             OE_RAISE(_result_);              \
      |             ^~~~~~~~
/home/aep/consulting/enclaive/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:1144:13: note: in expansion of macro ‘OE_CHECK’
 1144 |             OE_CHECK(oe_safe_add_u64(offset, dynamic_rva, &offset));
      |             ^~~~~~~~
/home/aep/consulting/enclaive/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:1180:1: note: label ‘done’ defined here
 1180 | done:
      | ^~~~
/home/aep/consulting/enclaive/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:1154:11: note: ‘new_relocation_data’ declared here
 1154 |     void* new_relocation_data = NULL;
      |           ^~~~~~~~~~~~~~~~~~~
thomasten commented 2 years ago

Hi, You probably build with gcc, which isn't supported. You must have clang-10 installed before you invoke cmake.

aep commented 2 years ago

hm current clang is version 13. getting an old version to build sounds like alot more work than just removing -Wall

thomasten commented 2 years ago

AFAIK jump-misses-init doesn't exist in clang, but only in gcc. So I guess cmake chose gcc for some reason. Try deleting and recreating the build folder and force clang with cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang ... However, it might still not build with another version than clang-10. This is a requirement of the underlying Open Enclave.

aep commented 2 years ago

thanks, that worked. got different errors now.

undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'

but as you said, that's expected. i'll just extract the binaries from the dpkg instead.

btw any reason ert is based on openenclave? Compared to gramine it seems rather immature.

thomasten commented 2 years ago

IMO Open Enclave is the most mature SGX SDK-if you want to write new apps in C/C++. I've not used Gramine for a while. I think it has evolved impressively. In the past it had serious stability, security, and UX issues.