Skip to content

Cross-compiling for arm64-apple-darwin fails at _remote_debugging/module.o due to implicit declaration of getpagesize #157549

Closed

Description

@wxrayut

Bug report

Bug description:

When cross-compiling the repository from an x86_64 macOS host to an arm64 macOS target, the compilation fails in remote_debug.h because modern C compilers (ISO C99 and later) reject implicit function declarations.

I attempted to disable remote debugging using the --without-remote-debug configure option, but the _remote_debugging module is still being compiled.

Environment

  • Host Build OS/Arch: x86_64-apple-darwin20.6.0
  • Host Environment: The x86_64 macOS host is running as a virtual machine under VMware.
  • Target Host/Arch: arm64-apple-darwin
  • Command Executed:
./configure --without-ensurepip \
             --without-static-libpython \
             --disable-test-modules \
             --disable-ipv6 \
             --without-remote-debug \
             --host=arm64-apple-darwin \
             --build=x86_64-apple-darwin20.6.0 \
             --with-build-python=/Users/wxrayut/Desktop/skins-diffusion/cross-build/host-python/python.exe \
             --enable-shared \
             --prefix=/Users/wxrayut/Desktop/skins-diffusion/cross-build/macOS/arm64-apple-darwin

Error Log

gcc  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall    -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -Werror=unguarded-availability  -I/Users/wxrayut/Desktop/skins-diffusion/.cpython/Include/internal -I/Users/wxrayut/Desktop/skins-diffusion/.cpython/Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I/Users/wxrayut/Desktop/skins-diffusion/.cpython/Include     -c /Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/module.c -o Modules/_remote_debugging/module.o
In file included from /Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/module.c:8:
In file included from /Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/_remote_debugging.h:35:
/Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/../../Python/remote_debug.h:145:29: error: call to undeclared function 'getpagesize'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  145 |         page_size = (size_t)getpagesize();
      |                             ^
/Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/../../Python/remote_debug.h:145:29: note: did you mean 'get_page_size'?
/Users/wxrayut/Desktop/skins-diffusion/.cpython/Modules/_remote_debugging/../../Python/remote_debug.h:137:1: note: 'get_page_size' declared here
  137 | get_page_size(void) {
      | ^
  138 |     size_t page_size = 0;
  139 |     if (page_size == 0) {
  140 | #ifdef MS_WINDOWS
  141 |         SYSTEM_INFO si;
  142 |         GetSystemInfo(&si);
  143 |         page_size = si.dwPageSize;
  144 | #else
  145 |         page_size = (size_t)getpagesize();
      |                             ~~~~~~~~~~~
      |                             get_page_size

Questions

  • Did I misconfigured something on my end?
  • Is --without-remote-debug the correct configure option for disabling the _remote_debugging module?
  • If so, why is Modules/_remote_debugging/module.c still being compiled after configuring with --without-remote-debug ?
  • If --without-remote-debug is not intended to disable this module, is there another supported configuration option or mechanism for excluding the remote debugging components from the build?

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Activity

  1. added a commit that references this issue on Sep 19, 2026
  2. added a commit that references this issue on Sep 19, 2026
  3. added 3 commits that reference this issue on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildextension-modulesC modules in the Modules dirtopic-profilingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions