openwrt-packages/utils/oci-runtime-tools/patches/001-fix-32-bit-build.patch

40 lines
1.6 KiB
Diff

From 6502e57dbebcacd9b55fc7a80655c8f31d7dae8f Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 8 Feb 2021 01:26:31 +0000
Subject: [PATCH] Fix build of hugetlb tests on 32-bit platforms
https://github.com/opencontainers/runtime-tools/pull/712
Use explicit 64-bit types to avoid fall-back on incompatible 32-bit
types on 32-bit platforms.
Fixes: #711
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go | 2 +-
.../linux_cgroups_relative_hugetlb.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
+++ b/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
@@ -24,7 +24,7 @@ func testHugetlbCgroups() error {
// When setting the limit just for checking if writing works, the amount of memory
// requested does not matter, as all insigned integers will be accepted.
// Use 2GiB as an example
- const limit = 2 * (1 << 30)
+ var limit uint64 = 2 * (1 << 30)
for _, pageSize := range pageSizes {
g, err := util.GetDefaultGenerator()
--- a/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
+++ b/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
@@ -21,7 +21,7 @@ func main() {
// When setting the limit just for checking if writing works, the amount of memory
// requested does not matter, as all insigned integers will be accepted.
// Use 2GiB as an example
- const limit = 2 * (1 << 30)
+ var limit uint64 = 2 * (1 << 30)
for _, pageSize := range pageSizes {
g, err := util.GetDefaultGenerator()