Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628440 - sys-apps/portage fails install on crossdev: pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
Summary: sys-apps/portage fails install on crossdev: pyport.h:886:2: error: #error "LO...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-20 21:43 UTC by m.manico
Modified: 2017-08-21 13:08 UTC (History)
0 users

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 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
[2] https://bugs.gentoo.org/show_bug.cgi?id=582130
[3] https://bugs.gentoo.org/show_bug.cgi?id=610116
[3] https://bugs.gentoo.org/show_bug.cgi?id=610116#c1
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.
    </flag>

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