Fix linux-sgx build error when libc-wasi is disabled (#2997)

Compilation error was reported when `cmake -DWAMR_BUILD_LIBC_WASI=0`
on linux-sgx platform:
```
core/shared/platform/linux-sgx/sgx_socket.c:8:10:
fatal error: libc_errno.h: No such file or directory
    8 | #include "libc_errno.h"
      |          ^~~~~~~~~~~~~~
```
After fixing, both `cmake -DWAMR_BUILD_LIBC_WASI=1` and
`WAMR_BUILD_LIBC_WASI=0` work good.
This commit is contained in:
Wenyong Huang
2024-01-11 14:26:39 +08:00
committed by GitHub
parent 9121db5671
commit 3198018214
6 changed files with 40 additions and 6 deletions

View File

@ -102,7 +102,7 @@ Enclave_Include_Paths := -IEnclave -I$(WAMR_ROOT)/core/iwasm/include \
Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
# disable wasi
Enclave_C_Flags += -DSGX_DISABLE_WASI
Enclave_C_Flags += -DWASM_ENABLE_LIBC_WASI=0
ifeq ($(SPEC_TEST), 1)
Enclave_C_Flags += -DWASM_ENABLE_SPEC_TEST=1