Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936677 - dev-lang/python-3.12.4_p2 refuses to cross-emerge into an Armv7-A target
Summary: dev-lang/python-3.12.4_p2 refuses to cross-emerge into an Armv7-A target
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-26 20:23 UTC by Roland Metivier
Modified: 2025-01-25 13:36 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info, emerge -pqv, and Python's build.log concatenated (complete.log,173.21 KB, text/x-log)
2024-07-26 20:23 UTC, Roland Metivier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Metivier 2024-07-26 20:23:37 UTC
Created attachment 898382 [details]
emerge --info, emerge -pqv, and Python's build.log concatenated

Using target profile "default/linux/arm/23.0/split-usr/armv7a_hf" and emerging @system.

Host has profile "default/linux/amd64/23.0/desktop/systemd".

The crossdev environment is trying to pull in the host's libffi from the wrong location, as seen in the log files. This might be an issue with the Python ebuild.
Comment 1 Mike Gilbert gentoo-dev 2024-07-26 21:54:24 UTC
dev-lang/python builds 2 copies of python: one for CBUILD and one for CHOST.

Do you somehow not have libffi installed for CBUILD?
Comment 2 Roland Metivier 2024-07-26 22:05:31 UTC
(In reply to Mike Gilbert from comment #1)
> dev-lang/python builds 2 copies of python: one for CBUILD and one for CHOST.
> 
> Do you somehow not have libffi installed for CBUILD?
libffi 3.4.4-r4 is installed on CBUILD.
Comment 3 Dave Vasilevsky 2024-09-07 06:52:52 UTC
I have this problem as well, compiling with crossdev for powerpc.
Comment 4 Dave Vasilevsky 2024-09-07 06:54:52 UTC
I think it may be specifically a problem with a 64-bit build host and a 32-bit target. The host has /usr/lib64/libffi/include/ffi.h, but Python believes it lives in /usr/lib/libffi/include instead.
Comment 5 Dave Vasilevsky 2024-09-07 07:02:35 UTC
Can confirm that symlinking /usr/lib/libffi -> ../lib/libffi works as a temporary solution, and allows Python to cross-build.
Comment 6 Dave Vasilevsky 2024-09-07 07:03:32 UTC
Woops I meant /usr/lib/libffi -> ../lib64/libffi
Comment 7 Omar Sandoval 2024-09-19 20:53:01 UTC
I had the same issue cross compiling Python 3.12 for aarch64-unknown-linux-gnu, and the same workaround worked, so it doesn't seem to be limited to 32-bit targets.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-21 20:02:13 UTC
Chewi, can you have a look?
Comment 9 Larry the Git Cow gentoo-dev 2024-09-21 21:06:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=6caddf235b5598a9725d21134801b4426e6d3ea6

commit 6caddf235b5598a9725d21134801b4426e6d3ea6
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2024-09-21 21:02:45 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2024-09-21 21:02:45 +0000

    Don't set PKG_CONFIG_PATH in make.conf
    
    This is pointless because cross-pkg-config unsets it anyway. It's also
    harmful because if a cross build needs to call CBUILD's pkg-config,
    which doesn't use the wrapper, it will pick up .pc files from the wrong
    location.
    
    Bug: https://bugs.gentoo.org/936677
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 wrappers/etc/portage/make.conf | 1 -
 1 file changed, 1 deletion(-)
Comment 10 James Le Cuirot gentoo-dev 2024-09-21 21:08:41 UTC
Fixed in crossdev master. Just needs a release.
Comment 11 James Le Cuirot gentoo-dev 2024-09-21 21:12:37 UTC
To be clear, you'll need to manually remove this line from /usr/<CHOST>/etc/portage/make.conf unless you recreate the cross environment using the future crossdev release.
Comment 12 James Le Cuirot gentoo-dev 2024-09-29 21:57:20 UTC
Now fixed in crossdev 20240921.