|
1 | 1 | diff --git a/numpy/core/include/numpy/ndarrayobject.h b/numpy/core/include/numpy/ndarrayobject.h
|
2 | 2 | index d4b73eb..af90a68 100644
|
3 |
| ---- a/vendored-meson/meson/mesonbuild/utils/universal.py |
4 |
| -+++ b/vendored-meson/meson/mesonbuild/utils/universal.py |
5 |
| -@@ -727,6 +727,7 @@ def windows_detect_native_arch() -> str: |
6 |
| - """ |
7 |
| - if sys.platform != 'win32': |
8 |
| - return '' |
9 |
| -+ return 'amd64' # Workaround for GraalPy bug on Windows with kernel32.GetCurrentProcess() |
10 |
| - try: |
11 |
| - import ctypes |
12 |
| - process_arch = ctypes.c_ushort() |
13 | 3 | --- a/numpy/core/include/numpy/ndarrayobject.h
|
14 | 4 | +++ b/numpy/core/include/numpy/ndarrayobject.h
|
15 | 5 | @@ -225,7 +225,7 @@ NPY_TITLE_KEY_check(PyObject *key, PyObject *value)
|
@@ -71,46 +61,46 @@ index 2890406..353a657 100644
|
71 | 61 | #include <feature_detection_misc.h>
|
72 | 62 |
|
73 | 63 | diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
|
74 |
| -index 8fccc9a..e7f79e1 100644 |
| 64 | +index 8fccc9a..3bb9cf0 100644 |
75 | 65 | --- a/numpy/core/src/npymath/ieee754.c.src
|
76 | 66 | +++ b/numpy/core/src/npymath/ieee754.c.src
|
77 |
| -@@ -362,6 +362,17 @@ int npy_get_floatstatus_barrier(char* param) |
| 67 | +@@ -362,6 +362,11 @@ int npy_get_floatstatus_barrier(char* param) |
78 | 68 | * By using a volatile, the compiler cannot reorder this call
|
79 | 69 | */
|
80 | 70 | if (param != NULL) {
|
81 | 71 | + // GraalPy change: the pointer needs to be dereferenced to establish
|
82 | 72 | + // a data dependency to to ensure the compiler won't reorder the call
|
83 |
| -+#define HANDLE_BASE 0x8000000000000000ULL |
84 |
| -+#define points_to_py_handle_space(PTR) ((((uintptr_t) (PTR)) & HANDLE_BASE) != 0) |
85 |
| -+#define pointer_to_stub(PTR) ((PyObject *)(((uintptr_t) (PTR)) & ~HANDLE_BASE)) |
86 | 73 | + if (points_to_py_handle_space(param)) {
|
87 |
| -+ param = pointer_to_stub(param); |
| 74 | ++ param = (char*)pointer_to_stub(param); |
88 | 75 | + }
|
89 |
| -+#undef points_to_py_handle_space |
90 |
| -+#undef pointer_to_stub |
91 |
| -+#undef HANDLE_BASE |
92 | 76 | volatile char NPY_UNUSED(c) = *(char*)param;
|
93 | 77 | }
|
94 | 78 |
|
95 | 79 | diff --git a/numpy/core/src/npymath/ieee754.cpp b/numpy/core/src/npymath/ieee754.cpp
|
96 |
| -index 1c59bf3..131985e 100644 |
| 80 | +index 1c59bf3..519fabc 100644 |
97 | 81 | --- a/numpy/core/src/npymath/ieee754.cpp
|
98 | 82 | +++ b/numpy/core/src/npymath/ieee754.cpp
|
99 |
| -@@ -428,6 +428,17 @@ npy_get_floatstatus_barrier(char *param) |
| 83 | +@@ -428,6 +428,11 @@ npy_get_floatstatus_barrier(char *param) |
100 | 84 | * By using a volatile, the compiler cannot reorder this call
|
101 | 85 | */
|
102 | 86 | if (param != NULL) {
|
103 | 87 | + // GraalPy change: the pointer needs to be dereferenced to establish
|
104 | 88 | + // a data dependency to to ensure the compiler won't reorder the call
|
105 |
| -+#define HANDLE_BASE 0x8000000000000000ULL |
106 |
| -+#define points_to_py_handle_space(PTR) ((((uintptr_t) (PTR)) & HANDLE_BASE) != 0) |
107 |
| -+#define pointer_to_stub(PTR) ((PyObject *)(((uintptr_t) (PTR)) & ~HANDLE_BASE)) |
108 | 89 | + if (points_to_py_handle_space(param)) {
|
109 |
| -+ param = pointer_to_stub(param); |
| 90 | ++ param = (char*)pointer_to_stub(param); |
110 | 91 | + }
|
111 |
| -+#undef points_to_py_handle_space |
112 |
| -+#undef pointer_to_stub |
113 |
| -+#undef HANDLE_BASE |
114 | 92 | volatile char NPY_UNUSED(c) = *(char *)param;
|
115 | 93 | }
|
116 | 94 |
|
| 95 | +diff --git a/vendored-meson/meson/mesonbuild/utils/universal.py b/vendored-meson/meson/mesonbuild/utils/universal.py |
| 96 | +index 1694912..a555fe3 100644 |
| 97 | +--- a/vendored-meson/meson/mesonbuild/utils/universal.py |
| 98 | ++++ b/vendored-meson/meson/mesonbuild/utils/universal.py |
| 99 | +@@ -727,6 +727,7 @@ def windows_detect_native_arch() -> str: |
| 100 | + """ |
| 101 | + if sys.platform != 'win32': |
| 102 | + return '' |
| 103 | ++ return 'amd64' # Workaround for GraalPy bug on Windows with kernel32.GetCurrentProcess() |
| 104 | + try: |
| 105 | + import ctypes |
| 106 | + process_arch = ctypes.c_ushort() |
0 commit comments