Skip to content

Fix SGX-RA Building #4208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions product-mini/platforms/linux-sgx/enclave-sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ SPEC_TEST ?= 0

# These variables are automatically set by CMakeLists.txt
WAMR_BUILD_SGX_IPFS = 0
WAMR_BUILD_LIB_RATS = 0
WAMR_BUILD_LIB_RATS = 1
WAMR_BUILD_GLOBAL_HEAP_POOL = 0
WAMR_BUILD_GLOBAL_HEAP_SIZE = 10485760
WAMR_BUILD_STATIC_PGO = 0
WAMR_BUILD_LIBC_WASI = 1

VMLIB_BUILD_DIR ?= $(CURDIR)/../build
LIB_RATS_SRC ?= $(VMLIB_BUILD_DIR)/_deps/librats-build
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/librats/lib/librats
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/librats/include
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-build
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-src/include

ifeq ($(shell getconf LONG_BIT), 32)
SGX_ARCH := x86
Expand Down Expand Up @@ -99,7 +99,7 @@ else
endif

ifeq ($(WAMR_BUILD_LIB_RATS), 1)
App_Link_Flags += -L$(LIB_RATS_INSTALL_DIR) -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
App_Link_Flags += -L$(LIB_RATS_SRC)/tee/sgx/untrust -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
endif

App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
Expand Down Expand Up @@ -152,7 +152,19 @@ else
endif

ifeq ($(WAMR_BUILD_LIB_RATS), 1)
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) -L$(LIB_RATS_INSTALL_DIR)/attesters -L$(LIB_RATS_INSTALL_DIR)/verifiers -L$(SGX_SSL)/lib64 -L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib -L$(LIB_RATS_INSTALL_DIR)/crypto_wrappers
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) \
-L$(LIB_RATS_SRC)/tee/sgx/trust \
-L$(LIB_RATS_SRC)/attesters/sgx-ecdsa \
-L$(LIB_RATS_SRC)/attesters/nullattester \
-L$(LIB_RATS_SRC)/attesters/sgx-la \
-L$(LIB_RATS_SRC)/verifiers/nullverifier \
-L$(LIB_RATS_SRC)/verifiers/sgx-la \
-L$(LIB_RATS_SRC)/verifiers/sgx-ecdsa-qve \
-L$(SGX_SSL)/lib64 \
-L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib \
-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate line with 166

-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
-L$(LIB_RATS_SRC)/crypto_wrappers/nullcrypto
Rats_Lib_W_Link_libs := -lattester_nullattester -lattester_sgx_ecdsa -lattester_sgx_la \
-lverifier_nullverifier -lverifier_sgx_la -lverifier_sgx_ecdsa_qve -lcbor \
-lrats_lib -lsgx_tsgxssl -lcrypto_wrapper_nullcrypto -lcrypto_wrapper_openssl
Expand All @@ -171,7 +183,7 @@ Enclave_Edl_Search_Path = --search-path ../Enclave \
--search-path $(SGX_SDK)/include \
--search-path $(WAMR_ROOT)/core/shared/platform/linux-sgx
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/librats/edl --search-path $(SGX_SSL)/include
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/edl --search-path $(SGX_SSL)/include
endif


Expand Down
Loading