[New-bugs-announce] [issue45886] Fix Program/_freeze_module for cross compiling Python

Christian Heimes report at bugs.python.org
Tue Nov 23 17:35:22 EST 2021


New submission from Christian Heimes <lists at cheimes.de>:

The build process creates the binary Program/_freeze_module, which is used to create frozen modules. The program takes a Python file, compiles it, and stores its marshalled output in a header file.

The approach does not work when cross compiling Python. In cross building case Program/_freeze_module cannot be executed on the build host. For example a cross build with build host "x86_64" and target host "aarch64" would create a aarch64 Program/_freeze_module. The current x86_64 host cannot executed binary (unless you use qemu and binfmt, which I'm deliberately ignoring here).

To unblock cross building and until we find a better solution, I propose that we allow developers to override the freeze module command on the command line. This allows developers to use a freeze_module program from a non-cross build:

   ../../configure -C --host=aarch64-linux-gnu-gcc --build=x86_64-pc-linux-gnu
   make FREEZE_MODULE=../x86_64/Program/_freeze_module

----------
assignee: christian.heimes
components: Build
messages: 406893
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Fix Program/_freeze_module for cross compiling Python
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45886>
_______________________________________


More information about the New-bugs-announce mailing list