1. sys-fs/zfs env SYSROOT=/path/to/rpi3b+ ROOT=/path/to/rpi3b+ CBUILD=$(portageq envvar CHOST) HOSTCC=$CBUILD-gcc MAKEOPTS="-j8" KERNEL_DIR=/path/to/rpi-kernel CROSS_COMPILE=aarch64-unknown-linux-gnu- aarch64-unknown-linux-gnu-emerge -q zfs fails because checking for zlib.h... no configure: error: in `/var/tmp/portage/sys-fs/zfs-0.8.1/work/zfs-0.8.1': configure: error: *** zlib.h missing, zlib-devel package required See `config.log' for more details. and configure:38492: checking zlib.h usability configure:38509: aarch64-unknown-linux-gnu-gcc -c -O2 -pipe conftest.c >&5 conftest.c:69:10: fatal error: zlib.h: No such file or directory #include <zlib.h> ^~~~~~~~ /usr/include/zlib.h clearly exists in the root file system of raspberry pi 3 b+. Is sys-fs/zfs simply not ready for cross compilation? 2. sys-fs/zfs-kmod env SYSROOT=/path/to/rpi3b+ ROOT=/path/to/rpi3b+ CBUILD=$(portageq envvar CHOST) HOSTCC=$CBUILD-gcc MAKEOPTS="-j8" KERNEL_DIR=/path/to/rpi-kernel CROSS_COMPILE=aarch64-unknown-linux-gnu- aarch64-unknown-linux-gnu-emerge -1q zfs-kmod installs kernel modules in /path/to/rpi3b+/path/to/rpi3b+/lib/modules/kernel-ver instead of /path/to/rpi3b+/lib/modules/kernel-ver. If I emerge zfs-kmod in an aarch64 chroot, kernel modules are installed in /lib/modules/kernel-ver in the chroot.
1. /usr/include/zlib.h already existed when I tried to install sys-fs/zfs. 2. zfs-kmod doesn't print an error about zlib.h
oh I just realized there's a huge mistake in ebuild. will fix asap. the whole DEPEND is missing. sys-fs/zfs already depends on zlib, but it's only in RDEPEND for now. once it moved to DEPEND it'll be pulled before and found in sysroot. BDEPEND pulls it on host, but not on target.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab07fce7cbc7cf1e135aebc519f1aa51d5be16d4 commit ab07fce7cbc7cf1e135aebc519f1aa51d5be16d4 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2019-09-12 21:41:56 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2019-09-12 21:50:01 +0000 sys-fs/zfs: fix missing DEPEND in live ebuild Bug: https://bugs.gentoo.org/694126 Package-Manager: Portage-2.3.75, Repoman-2.3.17 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-fs/zfs/zfs-9999.ebuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
can you check how it works now? especially cool if you could test with USE=python. python bits are picky about cross-compiling.
1. /usr/include/zlib.h already exists in the build host and the target system. sys-fs/zfs already builds with emerge in an aarch64 chroot. It is aarch64-unknown-linux-gnu-emerge that fails to find /usr/include/zlib.h 2. sys-fs/zfs-kmod never complainsa bout zlib.h. But, it installs kernel modules in /path/to/rpi3b+/path/to/rpi3b+/lib/modules/kernel-ver instead of /path/to/rpi3b+/lib/modules/kernel-ver
Anyway, I will check whether it builds and get back.
I tried to build sys-fs/zfs-9999, but failed because sys-fs/zfs-kmod-9999 failed to build due to the following error. /lib/ld-linux-aarch64.so.1: No such file or directory
Seems like you should close this bug and bug 693126 and open a new report for this new issue, no?
fixed in 0.8.2 like I said in other bug please file cross-compilation related issues separately.