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
```
This commit is contained in:
Haoxuan Xu 2024-01-02 09:32:16 +01:00 committed by GitHub
parent 5c3ad0279a
commit ef5e74fd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}