Backport PR #59906 on branch 2.3.x (BLD: Fix armv7 build)
State: closed

Backport PR #59906: BLD: Fix armv7 build

Labels:
name: Build
description: Library building on various platforms
name: Stale
name: ARM
description: aarch64 architecture

Comments:
On the dev mailing list, there is an email on the 2.2 documentation not being visible for the 2.2 docs. I want to see if this is fixed in 2.3.
/preview
/preview
It anything missing here? Both test failures seem to be unrelated.
Friendly ping @WillAyd 
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
@WillAyd Would you mind taking a quick look at this? It's just a backport PR.
@cdce8p @meeseeksmachine 

thank you for the patch. this fixes when cross compiling

```
2024-11-28T12:38:44.7548560Z [87/151] Compiling C object pandas/_libs/json.cpython-311-aarch64-linux-musl.so.p/src_vendored_ujson_python_JSONtoObj.c.o
2024-11-28T12:38:44.7550384Z FAILED: pandas/_libs/json.cpython-311-aarch64-linux-musl.so.p/src_vendored_ujson_python_JSONtoObj.c.o
2024-11-28T12:38:44.7559848Z aarch64-openwrt-linux-musl-gcc -Ipandas/_libs/json.cpython-311-aarch64-linux-musl.so.p -Ipandas/_libs -I../pandas/_libs -I../../../../../staging_dir/hostpkg/lib/python3.11/site-packages/numpy/_core/include -I../pandas/_libs/include -I/home/staging_dir/target-aarch64_generic_musl/usr>
2024-11-28T12:38:44.7570218Z In file included from /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/string.h:25,
2024-11-28T12:38:44.7571561Z                  from ../pandas/_libs/include/pandas/portable.h:12,
2024-11-28T12:38:44.7583849Z                  from ../pandas/_libs/include/pandas/vendored/ujson/lib/ultrajson.h:55,
2024-11-28T12:38:44.7585802Z                  from ../pandas/_libs/src/vendored/ujson/python/JSONtoObj.c:41:
2024-11-28T12:38:44.7587339Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h:40:13: error: 'realpath' undeclared here (not in a function)
2024-11-28T12:38:44.7589230Z    40 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
2024-11-28T12:38:44.7589874Z       |             ^~~~~~~~
2024-11-28T12:38:44.7591172Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/fortify-headers.h:20:40: note: in definition of macro '_FORTIFY_ORIG'
2024-11-28T12:38:44.7592808Z    20 | #define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
2024-11-28T12:38:44.7593782Z       |                                        ^~
2024-11-28T12:38:44.7595073Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h:40:1: note: in expansion of macro '_FORTIFY_FN'
2024-11-28T12:38:44.7596536Z    40 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
2024-11-28T12:38:44.7597197Z       | ^~~~~~~~~~~
2024-11-28T12:38:44.7598205Z In file included from /home/staging_dir/target-aarch64_generic_musl/usr/include/python3.11/Python.h:23,
2024-11-28T12:38:44.7599472Z                  from ../pandas/_libs/src/vendored/ujson/python/JSONtoObj.c:43:
2024-11-28T12:38:44.7600749Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h: In function 'realpath':
2024-11-28T12:38:44.7602791Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h:43:2: error: #error PATH_MAX unset. A fortified realpath will not work.
2024-11-28T12:38:44.7604340Z    43 | #error PATH_MAX unset. A fortified realpath will not work.
2024-11-28T12:38:44.7604959Z       |  ^~~~~
2024-11-28T12:38:44.7606244Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h:40:50: warning: unused parameter '__p' [-Wunused-parameter]
2024-11-28T12:38:44.7607792Z    40 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
2024-11-28T12:38:44.7608493Z       |                                      ~~~~~~~~~~~~^~~
2024-11-28T12:38:44.7609863Z /home/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify/stdlib.h:40:61: warning: unused parameter '__r' [-Wunused-parameter]
2024-11-28T12:38:44.7611649Z    40 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
2024-11-28T12:38:44.7612370Z       |                                                       ~~~~~~^~~
2024-11-28T12:38:45.2830764Z [88/151] Compiling C object pandas/_libs/json.cpython-311-aarch64-linux-musl.so.p/src_vendored_ujson_python_objToJSON.c.o
2024-11-28T12:38:47.6451654Z [89/151] Compiling C object pandas/_libs/join.cpython-311-aarch64-linux-musl.so.p/meson-generated_pandas__libs_join.pyx.c.o
2024-11-28T12:38:47.6453394Z In file included from pandas/_libs/join.cpython-311-aarch64-linux-musl.so.p/pandas/_libs/join.pyx.c:1232:
2024-11-28T12:38:47.6646929Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h: In function 'traced_realloc':
2024-11-28T12:38:47.6648317Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h:48:7: warning: pointer 'old_ptr' may be used after 'realloc' [-Wuse-after-free]
2024-11-28T12:38:47.6649452Z    48 |       PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr);
2024-11-28T12:38:47.6650062Z       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-11-28T12:38:47.6650826Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h:45:15: note: call to 'realloc' here
2024-11-28T12:38:47.6651584Z    45 |   void *ptr = realloc(old_ptr, size);
2024-11-28T12:38:47.6651996Z       |               ^~~~~~~~~~~~~~~~~~~~~~
2024-11-28T12:38:50.4323281Z [90/151] Compiling C object pandas/_libs/groupby.cpython-311-aarch64-linux-musl.so.p/meson-generated_pandas__libs_groupby.pyx.c.o
2024-11-28T12:38:53.4355266Z [91/151] Compiling C object pandas/_libs/parsers.cpython-311-aarch64-linux-musl.so.p/meson-generated_pandas__libs_parsers.pyx.c.o
2024-11-28T12:38:53.4357132Z In file included from pandas/_libs/parsers.cpython-311-aarch64-linux-musl.so.p/pandas/_libs/parsers.pyx.c:1236:
2024-11-28T12:38:53.4358412Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h: In function 'traced_realloc':
2024-11-28T12:38:53.4359697Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h:48:7: warning: pointer 'old_ptr' may be used after 'realloc' [-Wuse-after-free]
2024-11-28T12:38:53.4360857Z    48 |       PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr);
2024-11-28T12:38:53.4361604Z       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-11-28T12:38:53.4362363Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h:45:15: note: call to 'realloc' here
2024-11-28T12:38:53.4363103Z    45 |   void *ptr = realloc(old_ptr, size);
2024-11-28T12:38:53.4363510Z       |               ^~~~~~~~~~~~~~~~~~~~~~
2024-11-28T12:38:53.7753284Z [92/151] Compiling C object pandas/_libs/hashtable.cpython-311-aarch64-linux-musl.so.p/meson-generated_pandas__libs_hashtable.pyx.c.o
2024-11-28T12:38:53.7755107Z In file included from pandas/_libs/hashtable.cpython-311-aarch64-linux-musl.so.p/pandas/_libs/hashtable.pyx.c:1232:
2024-11-28T12:38:53.7756252Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h: In function 'traced_realloc':
2024-11-28T12:38:53.7757349Z ../pandas/_libs/include/pandas/vendored/klib/khash_python.h:48:7: warning: pointer 'old_ptr' may be used after 'realloc' [-Wuse-after-free]
2024-11-28T12:38:53.7758308Z    48 |       PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr);
```
@rhshadrach @WillAyd Small ping. Anything I can help with to get this over the finish line? It's just a 4 line change backport PR after all.
@cdce8p Thanks for the reminder, merged!