openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
282 stars 181 forks source link

Failure in configure phase: #675

Closed patchMonkey156 closed 6 years ago

patchMonkey156 commented 6 years ago
localhost-live /usr/src/linux # emerge -1 spl
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-kernel/spl-0.7.5::gentoo
 * spl-0.7.5.tar.gz BLAKE2B SHA512 size ;-) ...                                 [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.14.8-gentoo-r1/build
 * Found sources for kernel version:
 *     4.14.8-gentoo-r1
 * Checking for suitable kernel configuration options...                        [ ok ]
>>> Unpacking source...
>>> Unpacking spl-0.7.5.tar.gz to /var/tmp/portage/sys-kernel/spl-0.7.5/work
>>> Source unpacked in /var/tmp/portage/sys-kernel/spl-0.7.5/work
>>> Preparing source in /var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5 ...
 * Running elibtoolize in: spl-0.7.5/
 *   Applying target-nm/2.4.2 patch ...
 *   Applying ppc64le/2.4.2 patch ...
 * Running elibtoolize in: spl-0.7.5/config/
 *   Applying portage/2.2 patch ...
 *   Applying sed/1.5.6 patch ...
 *   Applying as-needed/2.2.6 patch ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5"
 * econf: updating spl-0.7.5/config/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating spl-0.7.5/config/config.guess with /usr/share/gnuconfig/config.guess
/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --docdir=/usr/share/doc/spl-0.7.5 --bindir=/bin --sbindir=/sbin --with-config=all --with-linux=/usr/src/linux --with-linux-obj=/lib/modules/4.14.8-gentoo-r1/build --disable-debug
checking for gawk... gawk
checking metadata... META file
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/lib/portage/python3.5/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/lib/portage/python3.5/ebuild-helpers/xattr/install -c
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of x86_64-pc-linux-gnu-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 x86_64-pc-linux-gnu-gcc... /usr/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/x86_64-pc-linux-gnu-nm -B
checking the name lister (/usr/bin/x86_64-pc-linux-gnu-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for x86_64-pc-linux-gnu-objdump... x86_64-pc-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-pc-linux-gnu-ar... x86_64-pc-linux-gnu-ar
checking for x86_64-pc-linux-gnu-strip... x86_64-pc-linux-gnu-strip
checking for x86_64-pc-linux-gnu-ranlib... x86_64-pc-linux-gnu-ranlib
checking command to parse /usr/bin/x86_64-pc-linux-gnu-nm -B output from x86_64-pc-linux-gnu-gcc object... ok
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if x86_64-pc-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for x86_64-pc-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if x86_64-pc-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if x86_64-pc-linux-gnu-gcc static flag -static works... yes
checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o... yes
checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the x86_64-pc-linux-gnu-gcc linker (/usr/x86_64-pc-linux-gnu/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... yes
checking spl author... OpenZFS on Linux
checking spl license... GPL
checking linux distribution... gentoo
checking default package type... tgz
checking whether rpm is available... no
checking whether rpmbuild is available... no
checking whether spec files are available... yes (rpm/generic/*.spec.in)
checking whether dpkg is available... no
checking whether dpkg-buildpackage is available... no
checking whether alien is available... no
checking spl config... all
checking kernel source directory... /usr/src/linux
checking kernel build directory... /lib/modules/4.14.8-gentoo-r1/build
checking kernel source version... 4.14.8-gentoo-r1
checking kernel file name for module symbols... Module.symvers
checking whether debugging is enabled... no
checking whether basic kmem accounting is enabled... no
checking whether detailed kmem tracking is enabled... no
checking whether modules can be built... yes
checking whether atomic types use spinlocks... no
checking whether kernel defines atomic64_t... yes
checking whether old 2-argument shrinker exists... no
checking whether old 3-argument shrinker exists... no
checking whether new 2-argument shrinker exists... no
checking whether ->count_objects callback exists... configure: error: error

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/[config.log](https://github.com/zfsonlinux/spl/files/1592556/config.log)
 * ERROR: sys-kernel/spl-0.7.5::gentoo failed (configure phase):
 *   econf failed
 * 
 * Call stack:
 *               ebuild.sh, line  124:  Called src_configure
 *             environment, line 3815:  Called autotools-utils_src_configure
 *             environment, line  602:  Called econf '--docdir=/usr/share/doc/spl-0.7.5' '--bindir=/bin' '--sbindir=/sbin' '--with-config=all' '--with-linux=/usr/src/linux' '--with-linux-obj=/lib/modules/4.14.8-gentoo-r1/build' '--disable-debug'
 *        phase-helpers.sh, line  665:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  117:  Called die
 * The specific snippet of code:
 *          die "$@"
 * 
 * If you need support, post the output of `emerge --info '=sys-kernel/spl-0.7.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-kernel/spl-0.7.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-kernel/spl-0.7.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-kernel/spl-0.7.5/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5'
 * S: '/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5'

>>> Failed to emerge sys-kernel/spl-0.7.5, Log file:

>>>  '/var/tmp/portage/sys-kernel/spl-0.7.5/temp/build.log'

 * Messages for package sys-kernel/spl-0.7.5:

 * ERROR: sys-kernel/spl-0.7.5::gentoo failed (configure phase):
 *   econf failed
 * 
 * Call stack:
 *               ebuild.sh, line  124:  Called src_configure
 *             environment, line 3815:  Called autotools-utils_src_configure
 *             environment, line  602:  Called econf '--docdir=/usr/share/doc/spl-0.7.5' '--bindir=/bin' '--sbindir=/sbin' '--with-config=all' '--with-linux=/usr/src/linux' '--with-linux-obj=/lib/modules/4.14.8-gentoo-r1/build' '--disable-debug'
 *        phase-helpers.sh, line  665:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  117:  Called die
 * The specific snippet of code:
 *          die "$@"
 * 
 * If you need support, post the output of `emerge --info '=sys-kernel/spl-0.7.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-kernel/spl-0.7.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-kernel/spl-0.7.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-kernel/spl-0.7.5/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5'
 * S: '/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5'

localhost-live /usr/src/linux # 

Any suggestions?

patchMonkey156 commented 6 years ago
emerge --info '=sys-kernel/spl-0.7.5::gentoo'

Portage 2.3.13 (python 3.5.4-final-0, default/linux/amd64/13.0/desktop, gcc-7.2.0, glibc-2.25-r9, 4.13.9-300.fc27.x86_64 x86_64)

System Settings:

System uname: Linux-4.13.9-300.fc27.x86_64-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.4.1
KiB Mem:    32901516 total,  16684032 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 28 Dec 2017 00:45:01 +0000
Head commit of repository gentoo: dbbcaa80af14ec02c8eba29c56f946886b192845
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://lug.mtu.edu/gentoo/ http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ rsync://mirrors.rit.edu/gentoo/ http://gentoo.mirrors.tds.net/gentoo http://mirror.lug.udel.edu/pub/gentoo/ ftp://cosmos.illinois.edu/pub/gentoo/ http://gentoo.cs.uni.edu/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
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"
USE="X a52 aac acl acpi alsa amd64 audit berkdb bluetooth branding bzip2 cairo cdda cdr clamav cli consolekit cracklib crypt css cxx dbus device-mapper dga dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif git glamor gpm gtk hardened iconv ipv6 jpeg lcms ldap libnotify libzfs lm_sensors lz4 lzma lzo mad mmap mng modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl offensive ogg openal opengl openmp pam pango pcre pdf png policykit ppds profile pulseaudio qt3support qt5 readline sdl seccomp session smp sound spell ssl startup-notification svg syslog tcpd tiff truetype udev udisks unicode upnp upower usb vdpau vorbis wxwidgets x264 xattr xcb xml xscreensaver xv xvid zlib" ABI_X86="64" ELIBC="glibc" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
bunder2015 commented 6 years ago
configure:15981: checking whether old 2-argument shrinker exists
configure:16019: cp conftest.c build && make modules -C /lib/modules/4.14.8-gentoo-r1/build EXTRA_CFLAGS=-Werror-implicit-function-declaration -Werror  M=/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/build 
/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/build/conftest.c: In function ‘main’:
/var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/build/conftest.c:68:5: error: ‘struct shrinker’ has no member named ‘shrink’
    .shrink = shrinker_cb,
     ^~~~~~

I wonder if this is a duplicate of #418. Can you try with gcc 6? I also noticed you are running gcc 7 on the 13.0 profile, stock should actually be gcc 5.4.0. The new 17.0 profile uses gcc 6.

edit: apparently zol should support gcc 7... did you install it recently without recompiling your kernel perhaps?

patchMonkey156 commented 6 years ago

actually? on this fresh install, it came with gcc 6.4.0 - the devs must be pushing the migration to 17 faster than we thought.

Yeah, that probably should have been my first move - trying again in gcc6. USE=-custom-cflags didn't fix anything, even though I'm used to that flag being the problem.

As for the potential regression: When I've had this problem in the past, the only workaround was to use an earlier kernel. gcc-7.2.0 worked for gentoo's kernel 4.12, but nothing later. On 4.13 from gentoo, Copperhead, even vanilla, I had trouble regardless of whether it was gcc 6 or 7.

Is there some kind of kernel/dependency config option I'm missing? I do try to cut my packages pretty lean, but with all the security options blocking everything. I had to remember to recompile with the unused kernel symbols left in.

Gimme a sec to recompile gcc6

bunder2015 commented 6 years ago

FWIW, I'm running 4.14.2 on a semi-recent git master with gcc 6.4.0. You might want to file a bug over with gentoo as well if you're having problems.

patchMonkey156 commented 6 years ago

You might want to file a bug over with gentoo as well if you're having problems.

Absolutely. The independence from specific kernels tells me it could be something about my build.

Aaaand the same thing happens with gcc 6.4.0 - recompiled the kernel afterwards to match spl.

I wonder which shrinker this is supposed to be, that spl is missing it: /usr/src/linux/include/linux/shrinker.h (renamed to a .log to get it uploaded). diff against the latest on kernel.org shows they're identical files.

Which tells me there's something else coming between spl and this memory function.

             from ./include/asm-generic/bug.h:5:0,
             from ./arch/x86/include/asm/bug.h:82,
             from ./include/linux/bug.h:5,
             from ./include/linux/mmdebug.h:5,
             from ./include/linux/mm.h:9,
             /var/tmp/portage/sys-kernel/spl-0.7.5/work/spl-0.7.5/build/conftest.c:59:

So... this puppy leads down an initially interesting rabbit hole. Each line is a reference to the previous header file. bug.h:5 references /include/linux/compiler.h... Each header is identical to the mainline for this kernel version. Tomorrow, I guess I can chase this rabbit down the hole of the actual code?

Perhaps there is a code incompatibility between some gentoo-patched-kernel option and spl. This feels more and more like a job for their devs. Either way, I would like to leave this open until the consultation with them yields something as well. If such yields a solution, I'd like to edit the title of this thread to mention downstream issues, kernel config issues, etc... perhaps the spl ebuild in portage needs to add another kernel config check.

I'm hoping this is something I can smack my head about, maybe edit some wikis, and rest soundly about the answer being there for anyone else - the real reason why these things stay around after being solved.

patchMonkey156 commented 6 years ago

SO...

After switching to a different liveCD for the install, I got to playing around inside the Gentoo security options... yeah, seems like there's a option to "Harden common str/mem functions against buffer overflows" (CONFIG_FORTIFY_SOURCE).

This seems to be the culprit. After disabling this option, spl compiles normally. Time to update the documentation.