compiling python3.13 alpha release on openbsd

I just wanted to raise an issue regarding compiling Python on openbsd. I know that it is not supported but uptil 3.12 I have been able to compile and run on openbsd.
However, I tried to checkout 3.13 and it seems Python may be introducing changes that will
make compiling infeasible on openbsd.

In file included from Objects/mimalloc/prim/prim.c:22,
                 from Objects/mimalloc/static.c:37,
                 from Objects/obmalloc.c:22:
Objects/mimalloc/prim/unix/prim.c: In function 'mi_prim_open':
Objects/mimalloc/prim/unix/prim.c:67:10: error: implicit declaration of function 'syscall'; did you mean 'sysconf'? [-Werror=implicit-function-declaration]
   return syscall(SYS_open,fpath,open_flags,0);
          ^~~~~~~
          sysconf

The error is same for both clang and gcc. Can’t we use expressions that are the same for both openbsd and linux?

If feasible, please consider the request.
Thanks

Maybe @colesbury can help? Or you may have to file an issue with upstream mimalloc.

2 Likes

The configure script checks if mimalloc can be built, but I guess that’s not working on OpenBSD. We should be able to fix that as well as the underlying compile error in mimalloc.

For now, please use ./configure --without-mimalloc

I’ve filed mimalloc compile error on OpenBSD · Issue #117547 · python/cpython · GitHub to track this.

1 Like

@KabiraK, would you please verify that gh-117547: Fix mimalloc compile error on OpenBSD by colesbury · Pull Request #117548 · python/cpython · GitHub fixes the compile error on OpenBSD?