From ff239ef98d884bbabac423d91d1aa7f8f286f74c Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 27 Sep 2023 04:00:08 +0900 Subject: [PATCH] Fix compilation for GOLANG=(mipsle|mips64le) `libcontainer/dmz_linux.go` is not compiled in for MIPS, as libcontainer/dmz/nolibc/arch.h isn't compatible. Signed-off-by: Akihiro Suda --- cc_platform.mk | 4 ++++ libcontainer/dmz/dmz_linux.go | 3 ++- libcontainer/dmz/dmz_unsupported.go | 4 ++-- script/lib.sh | 6 ++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cc_platform.mk b/cc_platform.mk index 6aa2b5ecb8b..454a92c9ee7 100644 --- a/cc_platform.mk +++ b/cc_platform.mk @@ -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 diff --git a/libcontainer/dmz/dmz_linux.go b/libcontainer/dmz/dmz_linux.go index 12f9709a269..0b1ccdbfe1c 100644 --- a/libcontainer/dmz/dmz_linux.go +++ b/libcontainer/dmz/dmz_linux.go @@ -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 diff --git a/libcontainer/dmz/dmz_unsupported.go b/libcontainer/dmz/dmz_unsupported.go index 2ba67270495..38a37d86cf6 100644 --- a/libcontainer/dmz/dmz_unsupported.go +++ b/libcontainer/dmz/dmz_unsupported.go @@ -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 diff --git a/script/lib.sh b/script/lib.sh index f79dc3c2335..48a48e15d50 100644 --- a/script/lib.sh +++ b/script/lib.sh @@ -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