From ef5e74fd8a9d2333e73e629830c0715cbf12f537 Mon Sep 17 00:00:00 2001 From: Haoxuan Xu Date: Tue, 2 Jan 2024 09:32:16 +0100 Subject: [PATCH] fix(sgx-ra): Fix building when enclave is built without librats ahead (#2968) This PR addresses the issue with building the sgx-ra sample when the enclave under the path product-mini/platforms/linux-sgx/enclave-sample is built beforehand. When the enclave is built without librats ahead, an error occurs as the following without the changes: ```bash ... CP libvmlib.a <= /home/haoxuan/wasm-micro-runtime/samples/sgx-ra/build/libvmlib.a /usr/local/bin/ld: libvmlib.a(lib_rats_wrapper.c.o): in function `librats_collect_wrapper': lib_rats_wrapper.c:(.text.librats_collect_wrapper+0x4a): undefined reference to `wasm_runtime_get_module_hash' collect2: error: ld returned 1 exit status ``` --- samples/sgx-ra/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/sgx-ra/CMakeLists.txt b/samples/sgx-ra/CMakeLists.txt index 7ab552248..3f5f23e97 100644 --- a/samples/sgx-ra/CMakeLists.txt +++ b/samples/sgx-ra/CMakeLists.txt @@ -69,6 +69,7 @@ execute_process ( add_custom_target ( iwasm ALL DEPENDS vmlib_untrusted vmlib_untrusted vmlib + COMMAND make -C ${SGX_PLATFORM_DIR}/enclave-sample clean COMMAND make -C ${SGX_PLATFORM_DIR}/enclave-sample SGX_MODE=HW SGX_DEBUG=1 VMLIB_BUILD_DIR=${CMAKE_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E copy ${SGX_PLATFORM_DIR}/enclave-sample/enclave.signed.so ${CMAKE_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E copy ${SGX_PLATFORM_DIR}/enclave-sample/iwasm ${CMAKE_BINARY_DIR}