Skip to content

Commit

Permalink
Fix compilation on s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Feb 11, 2025
1 parent c901b62 commit 1f353d6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ ALL = b2sum b3sum md5sum sha1sum sha256sum sha512sum

GO := go

.PHONY: all
all: $(BIN)
# https://github.com/golang/go/issues/64875
arch := $(shell uname -m)
ifeq ($(arch),s390x)
CGO_ENABLED = 0
else
CGO_ENABLED := 1
endif

$(BIN): *.go
CGO_ENABLED=0 $(GO) build -trimpath -ldflags="-s -w -buildid=" -buildmode=pie
CGO_ENABLED=$(CGO_ENABLED) $(GO) build -trimpath -ldflags="-s -w -buildid=" -buildmode=pie

.PHONY: all
all: $(BIN)

.PHONY: test
test:
Expand Down

0 comments on commit 1f353d6

Please sign in to comment.