Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]zfs-kmod failed to build on Gentoo musl with gcc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Ichika-Zou
n00b
n00b


Joined: 03 Jan 2023
Posts: 9
Location: Kyoto, Japan

PostPosted: Sat Feb 18, 2023 9:54 pm    Post subject: [solved]zfs-kmod failed to build on Gentoo musl with gcc Reply with quote

emerge —info
Code:

# emerge --info
Portage 3.0.44 (python 3.10.9-final-0, default/linux/amd64/17.0/musl/hardened, gcc-12, musl-1.2.3, 5.15.88-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.15.88-gentoo-x86_64-x86_64-12th_Gen_Intel-R-_Core-TM-_i7-1260P-with-libc
KiB Mem:    32553428 total,  24795200 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Sat, 18 Feb 2023 00:45:01 +0000
Head commit of repository gentoo: 61d6109bc74aa273d8679dae2e3d3592addcdb7f
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9-r1::gentoo, 3.11.1-r1::gentoo
dev-lang/rust-bin:         1.66.1::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            1.0.0::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-musl"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --complete-graph y --color y --jobs=6 --load-average=6 --keep-going y --ask"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo rsync://ftp.wh2.tu-dresden.de/gentoo https://ftp.uni-hannover.de/gentoo/ https://ftp.riken.jp/Linux/gentoo/ rsync://ftp.riken.jp/gentoo/ http://ftp.twaren.net/Linux/Gentoo/"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j6 -l6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X acl alsa amd64 bluetooth bzip2 cet clang cli crypt dbus dist-kernel dri fortran gpm hardened iconv ios ipv6 libglvnd libtirpc ncurses nls nptl openmp pam pcre pie pipewire readline seccomp split-usr ssl ssp test-rust unicode vulkan wayland xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput synaptics wacom" KERNEL="linux" L10N="en_GB en_US de_DE zh_TW ja el" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


Build log:
Code:

Package:    sys-fs/zfs-kmod-2.1.9:0/2.1.9
 * Repository: gentoo
 * Maintainer: gyakovlev@gentoo.org sam@gentoo.org
 * Upstream:   https://github.com/openzfs/zfs/issues
 * USE:        abi_x86_64 amd64 dist-kernel elibc_musl kernel_linux rootfs userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     6.1.12-gentoo-dist
 * Checking for suitable kernel configuration options ...
 [ ok ]
>>> Unpacking source...
>>> Unpacking zfs-2.1.9.tar.gz to /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work
>>> Source unpacked in /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work
>>> Preparing source in /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9 ...
 * Running eautoreconf in '/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9' ...
 * Running 'libtoolize --install --copy --force --automake' ...
 [ ok ]
 * Running 'aclocal -I config --system-acdir=/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/temp/aclocal' ...
 [ ok ]
 * Running 'autoconf --force' ...
 [ ok ]
 * Running 'autoheader' ...
 [ ok ]
 * Running 'automake --add-missing --copy --foreign --force-missing' ...
 [ ok ]
 * Running elibtoolize in: zfs-2.1.9/
 * Running elibtoolize in: zfs-2.1.9/config/
 *   Applying portage/1.2.0 patch ...
 *   Applying sed/1.5.6 patch ...
 *   Applying as-needed/2.4.3 patch ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9 ...
 * econf: updating zfs-2.1.9/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating zfs-2.1.9/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating zfs-2.1.9/config/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating zfs-2.1.9/config/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --build=x86_64-pc-linux-musl --host=x86_64-pc-linux-musl --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --disable-dependency-tracking --disable-silent-rules --disable-static --docdir=/usr/share/doc/zfs-kmod-2.1.9 --htmldir=/usr/share/doc/zfs-kmod-2.1.9/html --with-sysroot=/ --libdir=/usr/lib HOSTCC=gcc --bindir=/bin --sbindir=/sbin --with-config=kernel --with-linux=/usr/src/linux --with-linux-obj=/usr/src/linux --disable-debug
checking for gawk... gawk
checking metadata... META file
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for x86_64-pc-linux-musl-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-gentoo-linux-musl/bin/ld
checking if the linker (/usr/x86_64-gentoo-linux-musl/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking how to convert x86_64-pc-linux-musl file names to x86_64-pc-linux-musl format... func_convert_file_noop
checking how to convert x86_64-pc-linux-musl file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-gentoo-linux-musl/bin/ld option to reload object files... -r
checking for x86_64-pc-linux-musl-file... no
checking for file... file
checking for x86_64-pc-linux-musl-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-pc-linux-musl-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-pc-linux-musl-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-pc-linux-musl-strip... no
checking for strip... strip
checking for x86_64-pc-linux-musl-ranlib... no
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... /
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for x86_64-pc-linux-musl-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-gentoo-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for x86_64-pc-linux-musl-gcc... gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) none
checking whether ln -s works... yes
checking for x86_64-pc-linux-musl-pkg-config... /usr/bin/x86_64-pc-linux-musl-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking dependency style of gcc... none
checking whether to build with code coverage support... no
checking how to create a pax tar archive... gnutar
checking zfs author... OpenZFS
checking zfs license... CDDL
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/gmsgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld... /usr/x86_64-gentoo-linux-musl/bin/ld -m elf_x86_64
checking if the linker (/usr/x86_64-gentoo-linux-musl/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking 32-bit host C ABI... no
checking for the common suffixes of directories in the library search path... lib,lib
checking zfs config... kernel
checking the number of available CPUs... 16
checking whether gcc supports -Wno-clobbered... yes
checking whether gcc supports -Winfinite-recursion... yes
checking whether gcc supports -Wimplicit-fallthrough... yes
checking whether gcc supports -Wframe-larger-than=<size>... yes
checking whether gcc supports -Wno-format-truncation... yes
checking whether gcc supports -Wno-format-zero-length... yes
checking whether gcc supports -fno-omit-frame-pointer... yes
checking whether gcc supports -fno-ipa-sra... yes
checking whether to build with -fsanitize=address support... no
checking whether host toolchain supports SSE... yes
checking whether host toolchain supports SSE2... yes
checking whether host toolchain supports SSE3... yes
checking whether host toolchain supports SSSE3... yes
checking whether host toolchain supports SSE4.1... yes
checking whether host toolchain supports SSE4.2... yes
checking whether host toolchain supports AVX... yes
checking whether host toolchain supports AVX2... yes
checking whether host toolchain supports AVX512F... yes
checking whether host toolchain supports AVX512CD... yes
checking whether host toolchain supports AVX512DQ... yes
checking whether host toolchain supports AVX512BW... yes
checking whether host toolchain supports AVX512IFMA... yes
checking whether host toolchain supports AVX512VBMI... yes
checking whether host toolchain supports AVX512PF... yes
checking whether host toolchain supports AVX512ER... yes
checking whether host toolchain supports AVX512VL... yes
checking whether host toolchain supports AES... yes
checking whether host toolchain supports PCLMULQDQ... yes
checking whether host toolchain supports MOVBE... yes
checking whether host toolchain supports XSAVE... yes
checking whether host toolchain supports XSAVEOPT... yes
checking whether host toolchain supports XSAVES... yes
checking for system type (linux-musl)... Linux
checking for python3... python3
checking for python version... 3.10
checking for python platform... linux
checking for GNU default python prefix... ${prefix}
checking for GNU default python exec_prefix... ${exec_prefix}
checking for python script directory (pythondir)... ${PYTHON_PREFIX}/lib/python3.10/site-packages
checking for python extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.10/site-packages
configure: Disabling pyzfs for kernel/srpm config
checking whether to enable pyzfs: ... no
checking for sed --in-place... --in-place
checking for cppcheck... no
checking for shellcheck... no
checking for checkbashisms... no
checking for parallel... no
checking kernel source and build directories... done
checking kernel source directory... /usr/src/linux
checking kernel build directory... /usr/src/linux
checking kernel source version... 6.1.12-gentoo-dist
checking for kernel config option compatibility... done
checking whether CONFIG_MODULES is defined... no
configure: error:
      *** This kernel does not include the required loadable module
      *** support!
      ***
      *** To build OpenZFS as a loadable Linux kernel module
      *** enable loadable module support by setting
      *** `CONFIG_MODULES=y` in the kernel configuration and run
      *** `make modules_prepare` in the Linux source tree.
      ***
      *** If you don't intend to enable loadable kernel module
      *** support, please compile OpenZFS as a Linux kernel built-in.
      ***
      *** Prepare the Linux source tree by running `make prepare`,
      *** use the OpenZFS `--enable-linux-builtin` configure option,
      *** copy the OpenZFS sources into the Linux source tree using
      *** `./copy-builtin <linux source directory>`,
      *** set `CONFIG_ZFS=y` in the kernel configuration and compile
      *** kernel as usual.
         

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9/config.log
 * ERROR: sys-fs/zfs-kmod-2.1.9::gentoo failed (configure phase):
 *   econf failed
 *
 * Call stack:
 *               ebuild.sh, line  136:  Called src_configure
 *             environment, line 3286:  Called econf 'HOSTCC=gcc' '--bindir=/bin' '--sbindir=/sbin' '--with-config=kernel' '--with-linux=/usr/src/linux' '--with-linux-obj=/usr/src/linux' '--disable-debug'
 *        phase-helpers.sh, line  730:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=sys-fs/zfs-kmod-2.1.9::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/zfs-kmod-2.1.9::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9'
 * S: '/var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9'

I’m using admincd to install.
I have tried install gentoo-kernel-bin-5.15.94 but also failed, on my gcc machine 6.1.12 will build successful.
_________________
良くも悪くも我流を貫く
For better or worse, stick to your own way.


Last edited by Ichika-Zou on Thu Feb 23, 2023 12:56 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31748
Location: here

PostPosted: Sun Feb 19, 2023 7:36 am    Post subject: Reply with quote

Your emerge --info say 5.15.88-gentoo-x86_64 x86_64 but sys-fs/zfs-kmod say Found sources for kernel version: 6.1.12-gentoo-dist .
Have you set the kernel in use correctly?
Can you post the /var/tmp/portage/sys-fs/zfs-kmod-2.1.9/work/zfs-2.1.9/config.log file?
_________________
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Back to top
View user's profile Send private message
Ichika-Zou
n00b
n00b


Joined: 03 Jan 2023
Posts: 9
Location: Kyoto, Japan

PostPosted: Wed Feb 22, 2023 8:59 pm    Post subject: Reply with quote

Problem resolved , I didn’t know change CHOST wiki page existed so I directly use my old make.conf, which CHOST is set to “x86_64-pc-linux-gnu” and I simply change to “x86_64-pc-linux-musl”, but the correct CHOST should be “x86_64-gentoo-linux-musl”.

Sorry for the trouble. Thanks for reply.
_________________
良くも悪くも我流を貫く
For better or worse, stick to your own way.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum