summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorOla x Nilsson <olani@axis.com>2024-01-26 14:57:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-27 08:20:02 +0000
commitfd0980f74f0b34363cf4282667c918f1925db0f9 (patch)
treed3d05ccc927abb03cbcfa27e66253f24d0097ca9 /meta/recipes-devtools/python
parent348d9aba3305cd98b0c0b1ec0f4b1407e786307a (diff)
downloadpoky-fd0980f74f0b34363cf4282667c918f1925db0f9.tar.gz
python3-numpy: Use Large File Support version of fallocate
This was supposed to always be the case from upstream but was exposed by the 64-bit-time QA checker when file function scanning was enabled. (From OE-Core rev: 3d556e59f658ac29615fb7a14b6ea48533122ff6) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python3-numpy/0001-BUG-Use-large-file-fallocate-on-32-bit-linux-platfor.patch51
-rw-r--r--meta/recipes-devtools/python/python3-numpy_1.26.3.bb1
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 @@
1From 43b9b2626a59e8764f3bfb1d6b0d73b2d665584e Mon Sep 17 00:00:00 2001
2From: Ola x Nilsson <olani@axis.com>
3Date: Fri, 19 Jan 2024 10:26:41 +0100
4Subject: [PATCH] BUG: Use large file fallocate on 32 bit linux platforms
5
6Using a local prototype for fallocate instead of the fcntl.h header
7meant that the redirect triggered by -D_FILE_OFFSET_BITS=64 was not
8triggered.
9
10The prototypes in feature_detection_stdio.h should only be used by
11functions in setup_common.py. If they are used by the feature
12discovery code they might trigger false positives.
13
14Upstream-Status: Backport [https://github.com/numpy/numpy/commit/f49c6f9ea735cd7f718e74f8d637ffbbd3a7a03b]
15Signed-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
22diff --git a/numpy/core/feature_detection_stdio.h b/numpy/core/feature_detection_stdio.h
23index 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
36diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
37index 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 "
16SRC_URI[sha256sum] = "697df43e2b6310ecc9d95f05d5ef20eacc09c7c4ecc9da3f235d39e71b7da1e4" 17SRC_URI[sha256sum] = "697df43e2b6310ecc9d95f05d5ef20eacc09c7c4ecc9da3f235d39e71b7da1e4"
17 18