Skip to content

Commit 3d97799

Browse files
committed
Fix sgx_epid linking issue
1 parent 6676e69 commit 3d97799

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ GO_TAGS := $(build_tags)
148148
# -ldflags
149149
LD_FLAGS := $(ldflags)
150150

151-
ifeq ($(SGX_MODE), HW)
152-
CGO_LDFLAGS += $(shell pkg-config --libs libsgx_epid)
153-
endif
154-
155151
all: build_all
156152

157153
go.sum: go.mod

go-cosmwasm/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ build: build-rust build-go
6363

6464
.PHONY: build-rust
6565
build-rust: build-enclave
66+
if [[ $(SGX_MODE) == HW ]]; then \
67+
sed -i 's/sgx_epid_sim/sgx_epid/' ./api/link_std.go; \
68+
else \
69+
sed -i 's/sgx_epid/sgx_epid_sim/' ./api/link_std.go; \
70+
fi;
6671
cargo build -Z unstable-options --profile $(BUILD_PROFILE) --features "$(FEATURES_U)"
6772
cp target/$(BUILD_PROFILE)/libgo_cosmwasm.$(DLL_EXT) api
6873
@ #this pulls out ELF symbols, 80% size reduction!

go-cosmwasm/api/link_std.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
package api
55

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

0 commit comments

Comments
 (0)