From 60f1e9ade76ee7bb4017a9aa9c61822358b73d70 Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 17 Jan 2025 19:31:14 +0800 Subject: [PATCH] backport cli v26.1.0 patch to fix riscv64 build error (cherry picked from commit d427add3bc703357ed2fe80418091a1eba21658f) --- 0001-Set-CGO_ENABLED-1-on-riscv64.patch | 29 +++++++++++++++++++++++++ moby.spec | 6 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-Set-CGO_ENABLED-1-on-riscv64.patch diff --git a/0001-Set-CGO_ENABLED-1-on-riscv64.patch b/0001-Set-CGO_ENABLED-1-on-riscv64.patch new file mode 100644 index 0000000..3e4d656 --- /dev/null +++ b/0001-Set-CGO_ENABLED-1-on-riscv64.patch @@ -0,0 +1,29 @@ +From 800a51d6cd22ac7b7465d2d408362f9683a11800 Mon Sep 17 00:00:00 2001 +From: Zhuo Zhi +Date: Mon, 11 Mar 2024 13:57:35 +0800 +Subject: [PATCH] Set CGO_ENABLED=1 on riscv64 + +CGO works fine on riscv64 thus should be enabled. +Avoid build error https://github.com/golang/go/issues/64875 + +Signed-off-by: Zhuo Zhi +--- + scripts/build/.variables | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/build/.variables b/scripts/build/.variables +index a9371ebec2b6..de7945d0a7b3 100755 +--- a/scripts/build/.variables ++++ b/scripts/build/.variables +@@ -48,7 +48,7 @@ if [ -z "$CGO_ENABLED" ]; then + case "$(go env GOOS)" in + linux) + case "$(go env GOARCH)" in +- amd64|arm64|arm|s390x) ++ amd64|arm64|arm|s390x|riscv64) + CGO_ENABLED=1 + ;; + *) +-- +2.43.0 + diff --git a/moby.spec b/moby.spec index 1e4c00d..d029f7e 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: moby Version: 25.0.3 -Release: 22 +Release: 23 Summary: The open-source application container engine License: Apache-2.0 URL: https://www.docker.com @@ -21,6 +21,7 @@ Source3: docker.service Source4: docker.socket Source5: docker.sysconfig # Patch 0001-0999 for cli +Patch0001: 0001-Set-CGO_ENABLED-1-on-riscv64.patch # Patch 1001-1999 for moby Patch1001: 1001-fix-cve-2024-29018.patch Patch1002: 1002-fix-cve-2024-32473.patch @@ -225,6 +226,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Fri Jan 17 2025 laokz - 25.0.3-23 +- backport cli v26.1.0 patch to fix riscv64 build error + * Sat Nov 30 2024 Funda Wang - 25.0.3-22 - fix CVE-2024-36620, CVE-2024-36621, CVE-2024-36623 - reorganize patches so that they could be applied automatically -- Gitee