mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-04-02 14:55:17 +00:00
use static linking
This commit is contained in:
parent
ed5646b71a
commit
2d7ebdedee
6
Makefile
6
Makefile
@ -6,6 +6,10 @@ BINARY_NAME := 0gchaind
|
||||
MAIN_ENTRY := ./cmd/$(BINARY_NAME)
|
||||
DOCKER_IMAGE_NAME := 0glabs/$(PROJECT_NAME)
|
||||
GO_BIN ?= go
|
||||
ARCH := $(shell uname -m)
|
||||
WASMVM_VERSION := $(shell $(GO_BIN) list -m github.com/CosmWasm/wasmvm | sed 's/.* //')
|
||||
$(shell wget https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/libwasmvm_muslc.$(ARCH).a -O /lib/libwasmvm.$(ARCH).a)
|
||||
LINK_STATICALLY=true
|
||||
|
||||
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||
GIT_COMMIT := $(shell git rev-parse HEAD)
|
||||
@ -175,7 +179,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
|
||||
ldflags += -w -s
|
||||
endif
|
||||
ifeq ($(LINK_STATICALLY),true)
|
||||
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
|
||||
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static -lm"
|
||||
endif
|
||||
ldflags += $(LDFLAGS)
|
||||
ldflags := $(strip $(ldflags))
|
||||
|
Loading…
Reference in New Issue
Block a user