Skip to content

Commit

Permalink
Make enclave rebuild if the interpreter libraries change
Browse files Browse the repository at this point in the history
Signed-off-by: Mic Bowman <[email protected]>
  • Loading branch information
cmickeyb authored and prakashngit committed Feb 19, 2020
1 parent 950f3b8 commit 337676a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion eservice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SCRIPTDIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
SRCDIR ?= $(abspath $(SCRIPTDIR)/..)

PY_VERSION=${shell python --version | sed 's/Python \([0-9]\.[0-9]\).*/\1/'}
MOD_VERSION=${shell ../bin/get_version}

Expand Down Expand Up @@ -52,7 +55,9 @@ SCRIPTS = \
bin/ss-stop.sh \
bin/ss-status.sh

ENCLAVE_FILES = $(wildcard lib/libpdo_enclave/*.cpp lib/libpdo_enclave/*.h lib/libpdo_enclave/*.edl ${SGX_SSL}/include/*.edl lib/libpdo_enclave/state/*.cpp lib/libpdo_enclave/state/*.h lib/libpdo_enclave/state/*.edl)
ENCLAVE_FILES = $(wildcard lib/libpdo_enclave/*.cpp lib/libpdo_enclave/*.h lib/libpdo_enclave/*.edl)
ENCLAVE_FILES += $(wildcard ${SGX_SSL}/include/*.edl)
ENCLAVE_FILES += $(wildcard ${SRCDIR}/common/build/*.a)

all : $(ENCLAVE_LIB) $(EGG_FILE)

Expand Down
15 changes: 14 additions & 1 deletion eservice/lib/libpdo_enclave/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,22 @@ SET(CMAKE_SHARED_LIBRARY_PREFIX "")

ADD_LIBRARY(${PROJECT_NAME} SHARED ${PROJECT_HEADERS} ${PROJECT_SOURCES} ${PROJECT_EDGE_SOURCES} ${PROJECT_EDL})
SGX_SIGN_ENCLAVE(${PROJECT_NAME} ${PDO_ENCLAVE_CODE_SIGN_PEM} ${PROJECT_CONFIG})

TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libtpdo-common.a")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libpdo_contracts.a")
IF ($ENV{PDO_INTERPRETER} STREQUAL "gipsy")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libgipsy.a")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libtinyscheme.a")
ELSEIF ($ENV{PDO_INTERPRETER} STREQUAL "wawaka")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libwwasm.a")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} "${PDO_TOP_DIR}/common/build/libiwasm.a")
ENDIF()

TARGET_LINK_LIBRARIES(${PROJECT_NAME} -Wl,--whole-archive -lsgx_tsgxssl -Wl,--no-whole-archive)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} -Wl,--whole-archive -l${TRTS_LIBRARY_NAME} -Wl,--no-whole-archive)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} -Wl,--start-group -ltpdo-common ${INTERPRETER_LIBS} -lpdo_contracts -lsgx_tsgxssl_crypto -lsgx_tstdc -lsgx_tcxx -lsgx_tcrypto -l${SERVICE_LIBRARY_NAME} -Wl,--end-group)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} -Wl,--start-group -ltpdo-common ${INTERPRETER_LIBS} -lpdo_contracts -Wl,--end-group)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} -Wl,--start-group -lsgx_tsgxssl_crypto -lsgx_tstdc -lsgx_tcxx -lsgx_tcrypto -l${SERVICE_LIBRARY_NAME} -Wl,--end-group)

TARGET_INCLUDE_DIRECTORIES( ${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${SGX_ENCLAVE_INCLUDE})

ADD_CUSTOM_COMMAND(
Expand Down

0 comments on commit 337676a

Please sign in to comment.