Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MULTIARCH-3441: Enable builds for s390x (#1) #2

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ builds:
goarch:
- amd64
- ppc64le
- s390x
env:
- CGO_ENABLED=1
flags:
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ RUN set -ex \
&& /usr/local/go/bin/go version \
&& ln -f /usr/local/go/bin/go /usr/bin/go

#################################################################################
# Link gcc to /usr/bin/s390x-linux-gnu-gcc as go requires it on s390x
RUN ARCH=$(arch | sed 's|x86_64|amd64|g') \
&& [ "${ARCH}" == "s390x" ] \
&& ln /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc \
|| echo "Not running on s390x, skip linking gcc binary"

WORKDIR /build
ENTRYPOINT ["make"]
CMD []
Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ cross-build-linux-ppc64le:
+@GOOS=linux GOARCH=ppc64le $(MAKE) "$(GO_BUILD_FLAGS)" --no-print-directory build GO_BUILD_BINDIR=$(GO_BUILD_BINDIR)/linux-ppc64le
.PHONY: cross-build-linux-ppc64le

cross-build: cross-build-linux-amd64 cross-build-linux-ppc64le
cross-build-linux-s390x:
+@GOOS=linux GOARCH=s390x $(MAKE) "$(GO_BUILD_FLAGS)" --no-print-directory build GO_BUILD_BINDIR=$(GO_BUILD_BINDIR)/linux-s390x
.PHONY: cross-build-linux-s390x

cross-build: cross-build-linux-amd64 cross-build-linux-ppc64le cross-build-linux-s390x
.PHONY: cross-build

hack-build: clean
Expand Down Expand Up @@ -75,12 +79,12 @@ publish-catalog:
@cd test/operator && make
.PHONY: publish-catalog

format:
format:
$(GO) fmt ./pkg/...
$(GO) fmt ./cmd/...
.PHONY: format

vet:
$(GO) vet $(GO_BUILD_FLAGS) ./pkg/...
$(GO) vet $(GO_BUILD_FLAGS) ./cmd/...
.PHONY: vet
vet:
$(GO) vet $(GO_BUILD_FLAGS) ./pkg/...
$(GO) vet $(GO_BUILD_FLAGS) ./cmd/...
.PHONY: vet