Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 628440

Summary: sys-apps/portage fails install on crossdev: pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
Product: Gentoo Linux Reporter: m.manico
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description m.manico 2017-08-20 21:43:41 UTC
When trying to cross-compile gentoo on arm64 for armv7 [1] it fails for portage with the following message (note the cc1 warning):

armv7a-hardfloat-linux-gnueabi-gcc -O2 -pipe -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c src/portage_util_libc.c -o /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-apps/portage-2.3.8/work/portage-2.3.8-python2_7/temp.linux-x86_64-2.7/src/portage_util_libc.o -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
cc1: warning: include location "/usr/include/python2.7" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /usr/include/python2.7/Python.h:58:0,
                 from src/portage_util_libc.c:5:
/usr/include/python2.7/pyport.h:886: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 'armv7a-hardfloat-linux-gnueabi-gcc' failed with exit status 1

Similar bug reports [2][3] exist but I decided that this might be worth an extra report since it is about portage. There is a comment [3] from 2017 stating:

"Cross-compiling python packages is not generally expected to work."
Is that still the case (especially for portage)?

[1] sudo armv7a-hardfloat-linux-gnueabi-emerge -uva --newuse @system
Comment 1 Arfrever Frehtes Taifersar Arahesis 2017-08-21 13:08:46 UTC
Set USE="-native-extensions" for sys-apps/portage.

sys-apps/portage/metadata.xml says:

    <flag name="native-extensions">
        Compiles native "C" extensions (speedups, instead of using python
        backup code).  Currently includes libc-locales.
        This should only be temporarily disabled for some bootstrapping
        operations.  Cross-compilation is not supported.

Due to "Cross-compilation is not supported." I am closing this bug.