Skip to content

Commit 926fb24

Browse files
authored
fix: cross compile when building (#477)
Signed-off-by: Ji Hwan <[email protected]>
1 parent 950de82 commit 926fb24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ cross: $(BUILD_DIR) ## Cross-compile go binaries using CGO.
4242
# - `-linkmode external -extldflags "-static-libgo"` allows dynamic linking.
4343
echo "Building $(BIN_NAME)_$(GIT_TAG)_linux_arm64..."
4444
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build \
45-
-ldflags '$(VERSION_FLAGS) -s -w -linkmode external -extldflags "-static-libgo"' \
45+
-ldflags '$(VERSION_FLAGS) -s -w -linkmode external -extldflags "-static"' \
4646
-tags netgo \
4747
-o $(BUILD_DIR)/$(BIN_NAME)_$(GIT_TAG)_linux_arm64 \
4848
main.go
4949

5050
echo "Building $(BIN_NAME)_$(GIT_TAG)_linux_amd64..."
5151
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
52-
-ldflags '$(VERSION_FLAGS) -s -w -linkmode external -extldflags "-static-libgo"' \
52+
-ldflags '$(VERSION_FLAGS) -s -w -linkmode external -extldflags "-static"' \
5353
-tags netgo \
5454
-o $(BUILD_DIR)/$(BIN_NAME)_$(GIT_TAG)_linux_amd64 \
5555
main.go

0 commit comments

Comments
 (0)