Skip to content

Commit

Permalink
Fix compilation for GOLANG=(mipsle|mips64le)
Browse files Browse the repository at this point in the history
`libcontainer/dmz_linux.go` is not compiled in for MIPS,
as libcontainer/dmz/nolibc/arch.h isn't compatible.

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Sep 28, 2023
1 parent 4d948b1 commit ff239ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cc_platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ else ifeq ($(GOARCH),riscv64)
HOST := riscv64-$(PLATFORM)-
else ifeq ($(GOARCH),s390x)
HOST := s390x-$(PLATFORM)-
else ifeq ($(GOARCH),mipsle)
HOST := mipsel-$(PLATFORM)-
else ifeq ($(GOARCH),mips64le)
HOST := mips64el-$(PLATFORM)abi64-
else
$(error Unsupported GOARCH $(GOARCH))
endif
Expand Down
3 changes: 2 additions & 1 deletion libcontainer/dmz/dmz_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build !runc_nodmz
//go:build (386 || amd64 || arm || arm64 || loong64 || ppc64le || riscv64 || s390x) && !runc_nodmz
// +build 386 amd64 arm arm64 loong64 ppc64le riscv64 s390x
// +build !runc_nodmz

package dmz
Expand Down
4 changes: 2 additions & 2 deletions libcontainer/dmz/dmz_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !linux || runc_nodmz
// +build !linux runc_nodmz
//go:build !linux || (!386 && !amd64 && !arm && !arm64 && !loong64 && !ppc64le && !riscv64 && !s390x) || runc_nodmz
// +build !linux !386,!amd64,!arm,!arm64,!loong64,!ppc64le,!riscv64,!s390x runc_nodmz

package dmz

Expand Down
6 changes: 6 additions & 0 deletions script/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ function set_cross_vars() {
s390x)
HOST=s390x-${PLATFORM}
;;
mipsle)
HOST=mipsel-${PLATFORM}
;;
mips64le)
HOST=mips64el-${PLATFORM}abi64
;;
*)
echo "set_cross_vars: unsupported architecture: $1" >&2
exit 1
Expand Down

0 comments on commit ff239ef

Please sign in to comment.