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
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.