diff options
| -rw-r--r-- | meta/recipes-devtools/python/python3-numpy/0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch | 51 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-numpy_1.26.3.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch b/meta/recipes-devtools/python/python3-numpy/0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch new file mode 100644 index 0000000000..0702b8499a --- /dev/null +++ b/meta/recipes-devtools/python/python3-numpy/0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From 43b9b2626a59e8764f3bfb1d6b0d73b2d665584e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ola x Nilsson <olani@axis.com> | ||
| 3 | Date: Fri, 19 Jan 2024 10:26:41 +0100 | ||
| 4 | Subject: [PATCH] BUG: Use large file fallocate on 32 bit linux platforms | ||
| 5 | |||
| 6 | Using a local prototype for fallocate instead of the fcntl.h header | ||
| 7 | meant that the redirect triggered by -D_FILE_OFFSET_BITS=64 was not | ||
| 8 | triggered. | ||
| 9 | |||
| 10 | The prototypes in feature_detection_stdio.h should only be used by | ||
| 11 | functions in setup_common.py. If they are used by the feature | ||
| 12 | discovery code they might trigger false positives. | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://github.com/numpy/numpy/commit/f49c6f9ea735cd7f718e74f8d637ffbbd3a7a03b] | ||
| 15 | Signed-off-by: Ola x Nilsson <olani@axis.com> | ||
| 16 | |||
| 17 | --- | ||
| 18 | numpy/core/feature_detection_stdio.h | 3 +++ | ||
| 19 | numpy/core/src/multiarray/convert.c | 5 +++-- | ||
| 20 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/numpy/core/feature_detection_stdio.h b/numpy/core/feature_detection_stdio.h | ||
| 23 | index bc14d16..d8bbfbd 100644 | ||
| 24 | --- a/numpy/core/feature_detection_stdio.h | ||
| 25 | +++ b/numpy/core/feature_detection_stdio.h | ||
| 26 | @@ -1,6 +1,9 @@ | ||
| 27 | +#define _GNU_SOURCE | ||
| 28 | #include <stdio.h> | ||
| 29 | #include <fcntl.h> | ||
| 30 | |||
| 31 | +#if 0 /* Only for setup_common.py, not the C compiler */ | ||
| 32 | off_t ftello(FILE *stream); | ||
| 33 | int fseeko(FILE *stream, off_t offset, int whence); | ||
| 34 | int fallocate(int, int, off_t, off_t); | ||
| 35 | +#endif | ||
| 36 | diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c | ||
| 37 | index 60c1a1b..8ec0aee 100644 | ||
| 38 | --- a/numpy/core/src/multiarray/convert.c | ||
| 39 | +++ b/numpy/core/src/multiarray/convert.c | ||
| 40 | @@ -23,8 +23,9 @@ | ||
| 41 | #include "array_coercion.h" | ||
| 42 | #include "refcount.h" | ||
| 43 | |||
| 44 | -int | ||
| 45 | -fallocate(int fd, int mode, off_t offset, off_t len); | ||
| 46 | +#if defined(HAVE_FALLOCATE) && defined(__linux__) | ||
| 47 | +#include <fcntl.h> | ||
| 48 | +#endif | ||
| 49 | |||
| 50 | /* | ||
| 51 | * allocate nbytes of diskspace for file fp | ||
diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.3.bb b/meta/recipes-devtools/python/python3-numpy_1.26.3.bb index 023d40a9b2..326e2c3591 100644 --- a/meta/recipes-devtools/python/python3-numpy_1.26.3.bb +++ b/meta/recipes-devtools/python/python3-numpy_1.26.3.bb | |||
| @@ -12,6 +12,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ | |||
| 12 | file://0001-numpy-core-Define-RISCV-32-support.patch \ | 12 | file://0001-numpy-core-Define-RISCV-32-support.patch \ |
| 13 | file://fix_reproducibility.patch \ | 13 | file://fix_reproducibility.patch \ |
| 14 | file://run-ptest \ | 14 | file://run-ptest \ |
| 15 | file://0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch \ | ||
| 15 | " | 16 | " |
| 16 | SRC_URI[sha256sum] = "697df43e2b6310ecc9d95f05d5ef20eacc09c7c4ecc9da3f235d39e71b7da1e4" | 17 | SRC_URI[sha256sum] = "697df43e2b6310ecc9d95f05d5ef20eacc09c7c4ecc9da3f235d39e71b7da1e4" |
| 17 | 18 | ||
