Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694126 - sys-fs/zfs sys-fs/zfs-kmod should depend on sys-libs/zlib : conftest.c:69:10: fatal error: zlib.h: No such file or directory
Summary: sys-fs/zfs sys-fs/zfs-kmod should depend on sys-libs/zlib : conftest.c:69:10:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-12 05:08 UTC by anonymous
Modified: 2019-09-30 23:39 UTC (History)
2 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 anonymous 2019-09-12 05:08:41 UTC
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.
Comment 1 anonymous 2019-09-12 07:32:20 UTC
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
Comment 2 Georgy Yakovlev archtester gentoo-dev 2019-09-12 21:40:25 UTC
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.
Comment 3 Larry the Git Cow gentoo-dev 2019-09-12 21:50:11 UTC
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(-)
Comment 4 Georgy Yakovlev archtester gentoo-dev 2019-09-12 21:51:02 UTC
can you check how it works now?

especially cool if you could test with USE=python.
python bits are picky about cross-compiling.
Comment 5 anonymous 2019-09-12 21:55:44 UTC
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
Comment 6 anonymous 2019-09-12 22:04:45 UTC
Anyway, I will check whether it builds and get back.
Comment 7 anonymous 2019-09-14 08:28:29 UTC
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
Comment 8 Ben Kohler gentoo-dev 2019-09-20 15:21:18 UTC
Seems like you should close this bug and bug 693126 and open a new report for this new issue, no?
Comment 9 Georgy Yakovlev archtester gentoo-dev 2019-09-30 23:39:24 UTC
fixed in 0.8.2

like I said in other bug please file cross-compilation related issues separately.