Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions QuoteGeneration/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ SGX_MAJOR_VER:= $(call get_major_version,STRFILEVER)
# If the value of _FORTIFY_SOURCE is greater than 2, use the value, else use 2.
FORTIFY_SOURCE_VAL:= $(lastword $(sort $(word 2,$(subst =, ,$(filter -D_FORTIFY_SOURCE=%,$(CFLAGS)))) 2))

# If USE_PREBUILT_OPENSSL not equal 0, link prebuilt openssl, else link system openssl
USE_PREBUILT_OPENSSL ?= 0
ifeq ($(USE_PREBUILT_OPENSSL), 0)
CRYPTO_LIB = $(shell pkg-config --libs libcrypto 2>/dev/null)
CRYPTO_INC = $(shell pkg-config --cflags libcrypto 2>/dev/null)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding warning about potential pkg-config issues (and/or not installed) to be considered plus fallback mechanism:

Suggested change
CRYPTO_INC = $(shell pkg-config --cflags libcrypto 2>/dev/null)
CRYPTO_INC = $(shell pkg-config --cflags libcrypto 2>/dev/null)
# Fallback if pkg-config fails or not installed
ifeq ($(CRYPTO_LIB),)
CRYPTO_LIB := -lcrypto
endif
ifeq ($(CRYPTO_INC),)
CRYPTO_INC :=
endif

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in case CRYPTO_LIB and CRYPTO_INC cannot be retrieved with pkg-config, we can stop and output an error message

else
CRYPTO_LIB = -L$(ROOT_DIR)/../prebuilt/openssl/lib/linux64 -lcrypto
CRYPTO_INC = -I$(ROOT_DIR)/../prebuilt/openssl/inc
endif

CP := cp -f
LN := ln -sf
MKDIR := mkdir -p
Expand Down
6 changes: 3 additions & 3 deletions QuoteGeneration/pce_wrapper/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
include ../../buildenv.mk

INCLUDE += -I. -I../inc
INCLUDE += -I$(SGX_SDK)/include \
-I$(COMMON_DIR)/inc/internal \
INCLUDE += -I$(SGX_TRUSTED_INCLUDE_PATH) \
Copy link
Contributor Author

@bgotowal bgotowal Oct 13, 2025

Choose a reason for hiding this comment

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

Can we have access to specific location (path) and content of the specific SDK include path? Is it simply a regular SGX SDK's include directory (built from Open Source or installed from Intel provided bin) but located outside of default installation location? E.g., SDK sub-dirs are located in Ubuntu-specific areas depending on the nature of the files?

-I$(COMMON_DIR)/inc/internal \
-I$(COMMON_DIR)/inc/internal/linux

INCLUDE += -I$(ROOT_DIR)/ae/common \
Expand All @@ -43,7 +43,7 @@ INCLUDE += -I$(ROOT_DIR)/ae/common \
CXXFLAGS += -fPIC -Werror -g

CFLAGS += -fPIC -Werror -g
Link_Flags := $(SGX_COMMON_CFLAGS) -L$(ROOT_DIR)/build/linux -L$(SGX_SDK)/lib64 -lsgx_urts -lpthread -ldl
Link_Flags := $(SGX_COMMON_CFLAGS) -L$(ROOT_DIR)/build/linux -L$(SGX_LIBRARY_PATH) -lsgx_urts -lpthread -ldl
Copy link
Contributor Author

@bgotowal bgotowal Oct 13, 2025

Choose a reason for hiding this comment

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

Can we have access to specific location (path) and content of the specific SDK library path? Is it simply a regular SGX SDK's library directory (built from Open Source or installed from Intel provided bin) but located outside of default installation location? E.g., SDK sub-dirs are located in Ubuntu-specific areas depending on the nature of the files?

Copy link
Contributor

@hector-cao hector-cao Oct 27, 2025

Choose a reason for hiding this comment

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

Could you elaborate a little bit more on your question ?

The idea of this diff, I believe, is to use the right variable SGX_LIBRARY_PATH that points to the SGX libs


vpath %.cpp ..
vpath %.c $(COMMON_DIR)/src
Expand Down
9 changes: 4 additions & 5 deletions QuoteGeneration/qcnl/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
######## SGX SDK Settings ########
TOP_DIR = ../..
include $(TOP_DIR)/buildenv.mk
PREBUILD_OPENSSL_PATH = ../../../prebuilt/openssl

######## SGX CNL Library Settings ########

Expand All @@ -41,12 +40,12 @@ CNL_Lib_C_Files := $(wildcard *.c ../*.c) ../../common/src/se_thread.c

######## Include path -- Don't forget to update AESM CMakefile ########
CNL_Lib_Include_Paths := -I../../quote_wrapper/common/inc \
-I../inc -I$(SGX_SDK)/include \
-I../inc -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I../../common/inc/internal \
-I../../pce_wrapper/inc \
-I../../../QuoteVerification/QVL/Src/ThirdParty/rapidjson/include/rapidjson \
-I../../../tools/PCKCertSelection/include \
-I$(PREBUILD_OPENSSL_PATH)/inc
$(CRYPTO_INC)

CNL_Lib_C_Flags := $(COMMON_FLAGS) -g -fPIC -Wno-attributes $(CNL_Lib_Include_Paths)

Expand All @@ -59,9 +58,9 @@ ifdef SELF_SIGNED_CERT
CNL_Lib_Cpp_Flags+= -DSELF_SIGNED_CERT
endif

CNL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(TOP_DIR)/build/linux -L$(SGX_SDK)/lib64 \
CNL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(TOP_DIR)/build/linux -L$(SGX_LIBRARY_PATH) \
-lpthread -ldl ../../../tools/PCKCertSelection/static_out/libPCKCertSelection.a

ifndef DEBUG
CNL_Lib_Cpp_Flags += -DDISABLE_TRACE
CNL_Lib_Link_Flags += -DDISABLE_TRACE
Expand Down
9 changes: 4 additions & 5 deletions QuoteGeneration/qpl/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@
######## SGX SDK Settings ########
TOP_DIR = ../..
include $(TOP_DIR)/buildenv.mk
PREBUILD_OPENSSL_PATH = ../../../prebuilt/openssl

######## SGX QPL Library Settings ########

QPL_Lib_Cpp_Files := $(wildcard *.cpp ../*.cpp)

######## Include path -- Don't forget to update AESM CMakefile ########
QPL_Lib_Include_Paths := -I../../quote_wrapper/common/inc \
-I../inc -I$(SGX_SDK)/include \
-I../inc -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I../../common/inc/internal \
-I../../qcnl/inc \
-I$(PREBUILD_OPENSSL_PATH)/inc
$(CRYPTO_INC)

QPL_Lib_C_Flags := $(COMMON_FLAGS) -g -fPIC -Wno-attributes $(QPL_Lib_Include_Paths)

Expand All @@ -52,8 +51,8 @@ LDUFLAGS += -Wl,--version-script=sgx_default_quote_provider.lds -Wl,--gc-section

QPL_Lib_Cpp_Flags := $(QPL_Lib_C_Flags) -std=c++11

QPL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(TOP_DIR)/build/linux -L$(SGX_SDK)/lib64 -L$(PREBUILD_OPENSSL_PATH)/lib/linux64 \
-lcrypto -lsgx_default_qcnl_wrapper -lpthread -ldl
QPL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(TOP_DIR)/build/linux -L$(SGX_LIBRARY_PATH) $(CRYPTO_LIB) \
-lsgx_default_qcnl_wrapper -lpthread -ldl

ifndef DEBUG
QPL_Lib_Cpp_Flags += -DDISABLE_TRACE
Expand Down
5 changes: 3 additions & 2 deletions QuoteGeneration/quote_wrapper/qgs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include $(TOP_DIR)/buildenv.mk
QGS_SRCS = se_trace.c server_main.cpp qgs_server.cpp qgs_log.cpp qgs_ql_logic.cpp
QGS_OBJS = $(patsubst %.c,%.o,$(patsubst %.cc,%.o,$(patsubst %.cpp,%.o,$(QGS_SRCS))))

QGS_INC = -I$(SGX_SDK)/include \
QGS_INC = -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I$(COMMON_DIR)/inc/internal \
-I$(TOP_DIR)/qpl/inc \
-I$(TOP_DIR)/quote_wrapper/tdx_quote/inc \
Expand All @@ -52,7 +52,8 @@ DEPENDS = ${QGS_OBJS test_client.o:.o=.d}

# SGX related libraries
QGS_LFLAGS = -L$(TOP_DIR)/build/linux -lsgx_tdx_logic -lsgx_pce_logic -ldl \
-L$(SGX_SDK)/lib64 -lsgx_urts -g
-L$(SGX_LIBRARY_PATH) -lsgx_urts -g

# add boost_system for link
QGS_LFLAGS += -lboost_system -lboost_thread -lpthread
# add qgs_msg_lib for link
Expand Down
5 changes: 3 additions & 2 deletions QuoteGeneration/quote_wrapper/ql/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ vpath %.c $(COMMON_DIR)/src
QL_Lib_Cpp_Files := $(wildcard ../*.cpp)
QL_Lib_C_Files := se_trace.c se_thread.c

QL_Lib_Include_Paths := -I../../common/inc -I./ -I$(SGX_SDK)/include -I../../../common/inc/internal

QL_Lib_Include_Paths := -I../../common/inc -I./ -I$(SGX_TRUSTED_INCLUDE_PATH) -I../../../common/inc/internal
QL_Lib_Include_Paths += -I../../quote/inc -I../../../pce_wrapper/inc -I../inc

QL_Lib_C_Flags := $(COMMON_FLAGS) -g -fPIC -Wno-attributes $(QL_Lib_Include_Paths)
Expand All @@ -54,7 +55,7 @@ LDUFLAGS:= -pthread $(COMMON_LDFLAGS)
LDUFLAGS += -Wl,--version-script=dcap_ql_wrapper.lds -Wl,--gc-sections

QL_Lib_Cpp_Flags := $(QL_Lib_C_Flags) -std=c++11
QL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(Quote_Library_Dir) -lsgx_qe3_logic -L$(PCE_Library_Dir) -lsgx_pce_logic -L$(TOP_DIR)/build/linux -L$(SGX_SDK)/lib64 -lpthread -ldl
QL_Lib_Link_Flags := $(SGX_COMMON_FLAGS) -g -L$(Quote_Library_Dir) -lsgx_qe3_logic -L$(PCE_Library_Dir) -lsgx_pce_logic -L$(TOP_DIR)/build/linux -L$(SGX_LIBRARY_PATH) -lpthread -ldl

QL_Lib_Cpp_Flags += -DDISABLE_TRACE
QL_Lib_Link_Flags += -DDISABLE_TRACE
Expand Down
6 changes: 3 additions & 3 deletions QuoteGeneration/quote_wrapper/quote/enclave/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ SONAME := $(AENAME).so

TCRYPTO_LIB_NAME := sgx_tcrypto

INCLUDE := -I$(SGX_SDK)/include \
-I$(SGX_SDK)/include/tlibc \
-I$(SGX_SDK)/include/libcxx \
INCLUDE := -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I$(SGX_TRUSTED_INCLUDE_PATH)/tlibc \
-I$(SGX_TRUSTED_INCLUDE_PATH)/libcxx \
-I$(COMMON_DIR)/inc/internal \
-I$(COMMON_DIR)/inc/internal/linux \
-I$(TOP_DIR)/ae/inc/internal \
Expand Down
6 changes: 3 additions & 3 deletions QuoteGeneration/quote_wrapper/quote/id_enclave/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ SONAME := $(AENAME).so

TCRYPTO_LIB_NAME := sgx_tcrypto

INCLUDE := -I$(SGX_SDK)/include \
-I$(SGX_SDK)/include/tlibc \
-I$(SGX_SDK)/include/libcxx \
INCLUDE := -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I$(SGX_TRUSTED_INCLUDE_PATH)/tlibc \
-I$(SGX_TRUSTED_INCLUDE_PATH)/libcxx \
-I$(COMMON_DIR)/inc/internal \
-I$(COMMON_DIR)/inc/internal/linux \
-I$(TOP_DIR)/ae/inc/internal \
Expand Down
4 changes: 2 additions & 2 deletions QuoteGeneration/quote_wrapper/quote/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ vpath %.cpp .. .
Quote_C_Files := qe3_u.c id_enclave_u.c se_thread.c se_trace.c
Quote_Cpp_Files := qe_logic.cpp sgx_ql_core_wrapper.cpp

Quote_Include_Paths := -I$(SGX_SDK)/include -I../inc -I../../common/inc -I./ -I../enclave -I$(TOP_DIR)/pce_wrapper/inc -I$(COMMON_DIR)/inc/internal -I$(COMMON_DIR)/inc/internal/linux
Quote_Include_Paths := -I$(SGX_TRUSTED_INCLUDE_PATH) -I../inc -I../../common/inc -I./ -I../enclave -I$(TOP_DIR)/pce_wrapper/inc -I$(COMMON_DIR)/inc/internal -I$(COMMON_DIR)/inc/internal/linux

Quote_C_Flags := $(COMMON_FLAGS) -g -fPIC -Wno-attributes $(Quote_Include_Paths)

Quote_Cpp_Flags := $(Quote_C_Flags) -std=c++11
Quote_Link_Flags := $(COMMON_FLAGS) -g -L$(ROOT_DIR)/build/linux -L$(SGX_SDK)/lib64 -lsgx_urts -lpthread -ldl
Quote_Link_Flags := $(COMMON_FLAGS) -g -L$(ROOT_DIR)/build/linux -L$(SGX_LIBRARY_PATH) -lsgx_urts -lpthread -ldl

ifndef DEBUG
Quote_Cpp_Flags += -DDISABLE_TRACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ SONAME := $(AENAME).so

TCRYPTO_LIB_NAME := sgx_tcrypto

INCLUDE := -I$(SGX_SDK)/include \
-I$(SGX_SDK)/include/tlibc \
-I$(SGX_SDK)/include/libcxx \
INCLUDE := -I$(SGX_TRUSTED_INCLUDE_PATH) \
-I$(SGX_TRUSTED_INCLUDE_PATH)/tlibc \
-I$(SGX_TRUSTED_INCLUDE_PATH)/libcxx \
-I$(COMMON_DIR)/inc/internal \
-I$(COMMON_DIR)/inc/internal/linux \
-I$(TOP_DIR)/ae/inc/internal \
Expand Down
4 changes: 2 additions & 2 deletions QuoteGeneration/quote_wrapper/tdx_quote/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ vpath %.c $(COMMON_DIR)/src
Quote_C_Files := tdqe_u.c id_enclave_u.c se_thread.c se_trace.c
Quote_Cpp_Files := $(wildcard ../*.cpp)

Quote_Include_Paths := -I$(SGX_SDK)/include -I../inc -I../../common/inc -I./ \
Quote_Include_Paths := -I$(SGX_TRUSTED_INCLUDE_PATH) -I../inc -I../../common/inc -I./ \
-I../enclave -I$(TOP_DIR)/pce_wrapper/inc \
-I$(COMMON_DIR)/inc/internal \
-I$(COMMON_DIR)/inc/internal/linux
Expand All @@ -58,7 +58,7 @@ Quote_C_Flags := $(CFLAGS) -g -MMD -fPIC -Wno-attributes $(Quote_Include_Paths)

Quote_Cpp_Flags := $(CXXFLAGS) -g -MMD -fPIC -Wno-attributes $(Quote_Include_Paths)
Quote_Link_Flags := $(COMMON_LDFLAGS) -g -L$(ROOT_DIR)/build/linux \
-L$(PCE_Library_Dir) -lsgx_pce_logic -L$(SGX_SDK)/lib64 \
-L$(PCE_Library_Dir) -lsgx_pce_logic -L$(SGX_LIBRARY_PATH) \
-lsgx_urts -lpthread -ldl

Quote_Link_Flags += -Wl,--version-script=td_ql_logic.lds -Wl,--gc-sections
Expand Down
4 changes: 1 addition & 3 deletions QuoteVerification/QvE/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ endif
SIGNED_QVE_NAME := libsgx_qve.signed.so
QVE_CONFIG_FILE := Enclave/linux/config.xml

QVE_VER:= $(shell awk '$$2 ~ /QVE_VERSION/ { print substr($$3, 2, length($$3) - 2); }' $(DCAP_QG_DIR)/common/inc/internal/se_version.h)


ENCLAVE_INC_PATH := $(COMMON_INCLUDE) -IInclude -IEnclave -I$(DCAP_QG_DIR)/quote_wrapper/common/inc -I$(DCAP_QG_DIR)/pce_wrapper/inc -I$(DCAP_QPL_DIR)/inc -I$(DCAP_QV_DIR)/appraisal/common
ifdef SERVTD_ATTEST
Expand Down Expand Up @@ -195,7 +193,7 @@ $(QVL_PARSER_OBJS): %.o: %.cpp $(SGXSSL_HEADER_CHECK)

ifndef SERVTD_ATTEST
Enclave/qve_t.h: $(SGX_EDGER8R) Enclave/qve.edl
@cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/qve.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
@cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/qve.edl --search-path ../Enclave --search-path $(SGX_TRUSTED_INCLUDE_PATH)
@echo "GEN => $@"

Enclave/qve_t.c: Enclave/qve_t.h
Expand Down
5 changes: 2 additions & 3 deletions QuoteVerification/appraisal/qal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ WARM_Lib_Path := $(WARM_Top_Path)/product-mini/platforms/linux/build/

JWT_CPP_Path := ../../../external/jwt-cpp/
RAPIDJSON_DIR := ../../QVL/Src/ThirdParty/rapidjson/include
PREBUILD_OPENSSL_PATH := ../../../prebuilt/openssl
QAL_Include_Path := -I./ \
-I$(SGX_SDK)/include \
-I$(PREBUILD_OPENSSL_PATH)/inc \
$(CRYPTO_INC) \
-I$(DCAP_QG_DIR)/common/inc/internal/linux \
-I$(WARM_Top_Path)/core/iwasm/include \
-I$(JWT_CPP_Path)/include \
Expand All @@ -53,7 +52,7 @@ QAL_Cpp_Flags := $(CXXFLAGS) -g -fPIC $(QAL_Include_Path)
QAL_C_Flags := $(CFLAGS) -g -fPIC $(QAL_Include_Path)

QAL_Link_Flags := $(COMMON_LDFLAGS) -L$(WARM_Lib_Path) -lvmlib -ldl -lm -lpthread \
-L$(PREBUILD_OPENSSL_PATH)/lib/linux64 -lcrypto \
$(CRYPTO_LIB) \
-Wl,--gc-sections -Wl,--version-script=sgx_dcap_qal.lds

WASM_CONFIG ?= -DCMAKE_BUILD_TYPE=Release
Expand Down
5 changes: 2 additions & 3 deletions QuoteVerification/appraisal/tee_appraisal_tool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
DCAP_TOPDIR = ../../..
include $(DCAP_TOPDIR)/QuoteGeneration/buildenv.mk

PREBUILD_OPENSSL_PATH := $(DCAP_TOPDIR)/prebuilt/openssl
FLAGS := -fpie -g -I./ \
-I$(SGX_SDK)/include \
-I$(DCAP_TOPDIR)/external/jwt-cpp/include \
-I../../QVL/Src/ThirdParty/rapidjson/include \
-I$(DCAP_TOPDIR)/QuoteGeneration/common/inc/internal/ \
-I$(DCAP_TOPDIR)/QuoteGeneration/common/inc/internal/linux/ \
-I$(PREBUILD_OPENSSL_PATH)/inc \
-I../common
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
-I../common
-I../common \

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @bgotowal for this fix, Lgtm

$(CRYPTO_INC)

ifdef DEBUG
FLAGS += -DSE_DEBUG_LEVEL=SE_TRACE_DEBUG
Expand All @@ -56,7 +55,7 @@ Cpp_Common_Obj_Files := file_util.o format_util.o
C_Obj_Files := se_trace.o

Obj_Files := $(Cpp_Files:.cpp=.o) $(C_Obj_Files) $(Cpp_Common_Obj_Files)
LDFLAGS += -L$(PREBUILD_OPENSSL_PATH)/lib/linux64 -lcrypto -lpthread -ldl
LDFLAGS += $(CRYPTO_LIB) -lpthread -ldl


TARGET_NAME := tee_appraisal_tool
Expand Down
3 changes: 1 addition & 2 deletions QuoteVerification/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ PREBUILD_PATH := $(DCAP_QG_DIR)/../prebuilt
DCAP_QV_DIR := $(DCAP_QG_DIR)/../QuoteVerification
QVL_SRC_PATH ?= $(DCAP_QV_DIR)/QVL/Src
SGXSSL_PACKAGE_PATH ?= $(DCAP_QV_DIR)/sgxssl/Linux/package
PREBUILD_OPENSSL_PATH ?= $(PREBUILD_PATH)/openssl

SGX_COMMON_CFLAGS := $(COMMON_FLAGS) -m64 -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants
SGX_COMMON_CXXFLAGS := $(COMMON_FLAGS) -m64 -Wnon-virtual-dtor -std=c++17
Expand All @@ -70,7 +69,7 @@ QVL_COMMON_PATH := $(QVL_SRC_PATH)/AttestationCommons
ifdef SERVTD_ATTEST
COMMON_INCLUDE := -I$(ROOT_DIR)/../../../common/inc/ -I$(ROOT_DIR)/../../../common/inc/tlibc -I$(ROOT_DIR)/../../../sdk/tlibcxx/include -I$(SGXSSL_PACKAGE_PATH)/include
else
COMMON_INCLUDE := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx -I$(SGXSSL_PACKAGE_PATH)/include
COMMON_INCLUDE := -I$(SGX_TRUSTED_INCLUDE_PATH) -I$(SGX_TRUSTED_INCLUDE_PATH)/tlibc -I$(SGX_TRUSTED_INCLUDE_PATH)/libcxx -I$(SGXSSL_PACKAGE_PATH)/include
endif

QVL_LIB_INC := -I$(QVL_COMMON_PATH)/include -I$(QVL_COMMON_PATH)/include/Utils -I$(QVL_LIB_PATH)/include -I$(QVL_LIB_PATH)/src -I$(QVL_PARSER_PATH)/include -I$(QVL_SRC_PATH)/ThirdParty/rapidjson/include -I$(DCAP_EXTERNAL_DIR)/jwt-cpp/include
Expand Down
12 changes: 6 additions & 6 deletions QuoteVerification/dcap_quoteverify/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ INSTALL_PATH ?= /usr/lib/x86_64-linux-gnu
QVE_SRC_PATH := $(DCAP_QV_DIR)/QvE
DCAP_QPL_DIR := $(DCAP_QG_DIR)/qpl

QVL_LIB_INC += -I$(PREBUILD_OPENSSL_PATH)/inc -I$(QVE_SRC_PATH)/Include
QVL_PARSER_INC += -I$(PREBUILD_OPENSSL_PATH)/inc
QVL_LIB_INC += $(CRYPTO_INC) -I$(QVE_SRC_PATH)/Include
QVL_PARSER_INC += $(CRYPTO_INC)
QVL_VERIFY_INC := -I$(QVE_SRC_PATH)/Include \
-I../inc \
-I$(DCAP_QG_DIR)/quote_wrapper/common/inc \
-I$(SGX_SDK)/include \
-I$(SGX_TRUSTED_INCLUDE_PATH) \
-I$(DCAP_QG_DIR)/common/inc/internal \
-I$(DCAP_QG_DIR)/common/inc/internal/linux \
-I$(DCAP_QG_DIR)/pce_wrapper/inc \
-I$(PREBUILD_OPENSSL_PATH)/inc \
$(CRYPTO_INC) \
$(QVL_LIB_INC) \
-I$(DCAP_QPL_DIR)/inc \
-I$(DCAP_QV_DIR)/appraisal/common \
Expand All @@ -64,7 +64,7 @@ QVL_PARSER := sgx_dcap_qvl_attestation
QVL_LIB_NAME := lib$(QVL_LIB).a
QVL_PARSER_NAME := lib$(QVL_PARSER).a

LDUFLAGS := -pthread -ldl -L. -l$(QVL_LIB) -l$(QVL_PARSER) $(COMMON_LDFLAGS) -L$(PREBUILD_OPENSSL_PATH)/lib/linux64 -lcrypto
LDUFLAGS := -pthread -ldl -L. -l$(QVL_LIB) -l$(QVL_PARSER) $(COMMON_LDFLAGS) $(CRYPTO_LIB)
LDUFLAGS += -Wl,--version-script=sgx_dcap_quoteverify.lds -Wl,--gc-sections

QVL_VERIFY_CPP_SRCS := $(wildcard ../*.cpp) $(wildcard *.cpp)
Expand Down Expand Up @@ -122,7 +122,7 @@ run: all
######## QVL Library Objects ########

qve_u.h: $(SGX_EDGER8R) $(QVE_SRC_PATH)/Enclave/qve.edl
@$(SGX_EDGER8R) --untrusted $(QVE_SRC_PATH)/Enclave/qve.edl --search-path $(QVE_SRC_PATH)/Enclave --search-path $(SGX_SDK)/include
@$(SGX_EDGER8R) --untrusted $(QVE_SRC_PATH)/Enclave/qve.edl --search-path $(QVE_SRC_PATH)/Enclave --search-path $(SGX_TRUSTED_INCLUDE_PATH)
@echo "GEN => $@"

qve_u.c : qve_u.h
Expand Down
10 changes: 2 additions & 8 deletions tools/PCKCertSelection/PCKCertSelectionLib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ ifndef QG_DIR
QG_DIR := $(PROJ_ROOT_DIR)/../../QuoteGeneration
endif

# openssl include dir
OPENSSL_INC := $(PROJ_ROOT_DIR)/../../prebuilt/openssl/inc

# openssl lib dir
OPENSSL_LIB := $(PROJ_ROOT_DIR)/../../prebuilt/openssl/lib/linux64

# JSON parser include dir
JSON_INC := $(QVL_DIR)/ThirdParty/rapidjson/include

Expand Down Expand Up @@ -116,7 +110,7 @@ LIB_CPP_OBJECTS := \
$(UTILS_CPP_FILES:.cpp=.o)

# include paths, local, parser and openssl
LIB_INCLUDE_PATHS := -I. -I$(PROJ_ROOT_DIR)/include -I$(OPENSSL_INC) -I$(JSON_INC) -I$(PARSERS_INC) -I$(PARSERS_COMM_INC) -I$(PARSERS_DIR) -I$(VER_DIR) -I$(PARSERS_UTIL_INC)
LIB_INCLUDE_PATHS := -I. -I$(PROJ_ROOT_DIR)/include $(CRYPTO_INC) -I$(JSON_INC) -I$(PARSERS_INC) -I$(PARSERS_COMM_INC) -I$(PARSERS_DIR) -I$(VER_DIR) -I$(PARSERS_UTIL_INC)

# the library shared object name
LIB_NAME := libPCKCertSelection.so
Expand All @@ -136,7 +130,7 @@ C_FLAGS := -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wno-ov
C_FLAGS += -UPCK_CERT_SELECTION_WITH_COMPONENT

# link flags, link openssl crypto
LINK_FLAGS := -shared -L$(OPENSSL_LIB) -lcrypto -lpthread -ldl
LINK_FLAGS := -shared $(CRYPTO_LIB) -lpthread -ldl
LINK_FLAGS += -Wl,--version-script=pck_cert_selection.lds -Wl,--gc-sections

# debug/release switch
Expand Down
Loading