Skip to content

Commit

Permalink
Fix sgx_epid linking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau committed Nov 1, 2024
1 parent 6676e69 commit 3d97799
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ GO_TAGS := $(build_tags)
# -ldflags
LD_FLAGS := $(ldflags)

ifeq ($(SGX_MODE), HW)
CGO_LDFLAGS += $(shell pkg-config --libs libsgx_epid)
endif

all: build_all

go.sum: go.mod
Expand Down
5 changes: 5 additions & 0 deletions go-cosmwasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ build: build-rust build-go

.PHONY: build-rust
build-rust: build-enclave
if [[ $(SGX_MODE) == HW ]]; then \
sed -i 's/sgx_epid_sim/sgx_epid/' ./api/link_std.go; \
else \
sed -i 's/sgx_epid/sgx_epid_sim/' ./api/link_std.go; \
fi;
cargo build -Z unstable-options --profile $(BUILD_PROFILE) --features "$(FEATURES_U)"
cp target/$(BUILD_PROFILE)/libgo_cosmwasm.$(DLL_EXT) api
@ #this pulls out ELF symbols, 80% size reduction!
Expand Down
2 changes: 1 addition & 1 deletion go-cosmwasm/api/link_std.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

package api

// #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm -lsgx_dcap_ql -lsgx_dcap_quoteverify
// #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_epid
import "C"

0 comments on commit 3d97799

Please sign in to comment.