Repository navigation
Cross-compiling for arm64-apple-darwin fails at _remote_debugging/module.o due to implicit declaration of getpagesize #157549
Copy link
Copy link
Closed
Labels
buildThe build process and cross-buildThe build process and cross-buildextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
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_64macOS 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-darwinError 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-debugthe correct configure option for disabling the_remote_debuggingmodule? - If so, why is
Modules/_remote_debugging/module.cstill being compiled after configuring with--without-remote-debug? - If
--without-remote-debugis 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildThe build process and cross-buildThe build process and cross-buildextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
pythongh-157549: Use sysconf() for the page size in remote_debug.h
pythongh-157549: Fix `getpagesize()` in `_remote_debugging` module fo…
gh-157549: Use sysconf() for the page size in remote_debug.h (#157800)
[3.14] gh-157549: Use sysconf() for the page size in remote_debug.h (G…
[3.15] gh-157549: Use sysconf() for the page size in remote_debug.h (G…