Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612158 - Unable cross-compile =sys-apps/portage-2.3.4 and =sys-apps/portage-2.3.3 with USE="native-extensions"
Summary: Unable cross-compile =sys-apps/portage-2.3.4 and =sys-apps/portage-2.3.3 with...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 635020
  Show dependency tree
 
Reported: 2017-03-09 20:39 UTC by Oleksii
Modified: 2023-01-17 02:33 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksii 2017-03-09 20:39:39 UTC
Hello there! Cross-compile via crossdev fail for sys-apps/portage-2.3.4 and =sys-apps/portage-2.3.3 (but version 2.3.2 pretty ok)

Details about error please see here:

https://paste.pound-python.org/show/VvJ5FM3Om3xWP7nSmivF/



Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2017-03-09 20:50:56 UTC
We know that it doesn't work with USE="native-extensions" enabled. You should set this in /etc/portage/package.use:

sys-apps/portage -native-extensions
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-10-12 19:30:49 UTC
Just snapping the failure context from the pastebin:

running build_ext
building 'portage.util.libc' extension
creating /usr/mipsel-unknown-linux-gnu/tmp/portage/sys-apps/portage-2.3.4/work/portage-2.3.4-python3_5/temp.linux-x86_64-3.5
creating /usr/mipsel-unknown-linux-gnu/tmp/portage/sys-apps/portage-2.3.4/work/portage-2.3.4-python3_5/temp.linux-x86_64-3.5/src
mipsel-unknown-linux-gnu-gcc -O2 -pipe -fomit-frame-pointer -mglibc -fPIC -I/usr/include/python3.5m -c src/portage_util_libc.c -o /usr/mipsel-unknown-linux-gnu/tmp/portage/sys-apps/portage-2.3.4/work/portage-2.3.4-python3_5/temp.linux-x86_64-3.5/src/portage_util_libc.o
cc1: warning: include location "/usr/include/python3.5m" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /usr/include/python3.5m/Python.h:50:0,
                 from src/portage_util_libc.c:5:
/usr/include/python3.5m/pyport.h:820:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
error: command 'mipsel-unknown-linux-gnu-gcc' failed with exit status 1


( OP, please attach build logs as files in future )


cross-dev for dev-python/cffi *also* fails the same way for me, so to avoid that, one might want to do:

USE="-native-extensions -rsync-verify" for cross.
Comment 3 Larry the Git Cow gentoo-dev 2022-03-21 23:33:49 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24631f38a61a53ffd2773090585eb98e9d4e8185

commit 24631f38a61a53ffd2773090585eb98e9d4e8185
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-03-21 23:33:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-21 23:33:08 +0000

    sys-apps/portage: disable USE=native-extensions for cross-compilation
    
    It doesn't work because cross-compiling Python modules is
    either tricky or flat-out impossible, so let's disable
    it when cross-compiling to make life easier for people.
    
    Bug: https://bugs.gentoo.org/612158
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/portage-3.0.30-r1.ebuild | 6 +++++-
 sys-apps/portage/portage-9999.ebuild      | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)