After upgrading three very different systems from 3.12.8 to 3.13.0, zfs-kmod failed to build on two of them, with the same error CC [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/dmu_objset.o CC [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/dmu_send.o CC [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/dmu_traverse.o In file included from /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/include/sys/zpl.h:29:0, from /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/arc.c:141: /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/include/linux/vfs_compat.h:74:1: error: static declaration of 'bdi_setup_and_register' follows non-static declaration bdi_setup_and_register(struct backing_dev_info *bdi,char *name,unsigned int cap) ^ In file included from /usr/src/linux-3.13.0-gentoo-r1/include/linux/blkdev.h:15:0, from /usr/src/spl-0.6.2/include/sys/sunldi.h:33, from /usr/src/spl-0.6.2/include/sys/sunddi.h:30, from /usr/src/spl-0.6.2/include/sys/systm.h:28, from /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/include/sys/zfs_context.h:47, from /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/include/sys/spa.h:31, from /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/arc.c:130: /usr/src/linux-3.13.0-gentoo-r1/include/linux/backing-dev.h:120:18: note: previous declaration of 'bdi_setup_and_register' was here int __must_check bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); ^ LD [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zcommon/zcommon.o CC [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/dmu_tx.o /usr/src/linux-3.13.0-gentoo-r1/scripts/Makefile.build:308: recipe for target '/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/arc.o' failed make[6]: *** [/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs/../../module/zfs/arc.o] Error 1 make[6]: *** Waiting for unfinished jobs.... LD [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/nvpair/znvpair.o LD [M] /tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/unicode/zunicode.o /usr/src/linux-3.13.0-gentoo-r1/scripts/Makefile.build:455: recipe for target '/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs' failed make[5]: *** [/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module/zfs] Error 2 /usr/src/linux-3.13.0-gentoo-r1/Makefile:1249: recipe for target '_module_/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module' failed make[4]: *** [_module_/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/module] Error 2 Makefile:133: recipe for target 'sub-make' failed make[3]: *** [sub-make] Error 2 % emerge -pqv '=sys-fs/zfs-kmod-0.6.2-r3::gentoo' [ebuild R ] sys-fs/zfs-kmod-0.6.2-r3 USE="-custom-cflags -debug rootfs" This is the same on all systems
Bugzilla won't let me send attachments, here is emerge --info from the working system Portage 2.2.8-r1 (default/linux/amd64/13.0/desktop/kde, gcc-4.8.2, glibc-2.18-r1, 3.13.0-gentoo-r1-0 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.13.0-gentoo-r1-0-x86_64-Intel-R-_Core-TM-_i3-3217U_CPU_@_1.80GHz-with-gentoo-2.2 KiB Mem: 3745460 total, 662524 free KiB Swap: 3886076 total, 3306924 free Timestamp of tree: Wed, 29 Jan 2014 07:15:01 +0000 ld GNU ld (GNU Binutils) 2.24 app-shells/bash: 4.2_p45-r1 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.6, 3.3.3 dev-util/cmake: 2.8.12.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6, 1.12.6, 1.13.4, 1.14.1 sys-devel/binutils: 2.24-r2 sys-devel/gcc: 4.7.3-r1, 4.8.2 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.13 (virtual/os-headers) sys-libs/glibc: 2.18-r1 Repositories: gentoo pipelight owncloud-client sunrise digimed Installed sets: @desktop, @kde4, @kernels, @lxf, @openbox, @temp, @zenus-deps ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=corei7-avx -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/env.d /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=corei7-avx -O2 -pipe" DISTDIR="/mnt/portage/distfiles" EMERGE_DEFAULT_OPTS="--alphabetical --jobs --load-average 5 --usepkg=y --backtrack=5" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="ftp://gentoo.digimed.co.uk/ ftp://ftp.heanet.ie/pub/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo/" LANG="en_GB" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/mnt/portage/packages/shooty" 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" PORTAGE_TMPDIR="/tmp" PORTDIR="/var/portage" PORTDIR_OVERLAY="/mnt/portage/layman/pipelight /mnt/portage/layman/owncloud-client /mnt/portage/layman/sunrise /mnt/portage/local" SYNC="rsync://portage.digimed.co.uk/portage" USE="X a52 aac aalib acpi alsa amd64 apng audiofile bluetooth branding bzip2 cairo cdda cddb cdr cli consolekit cracklib crypt cups curl cxx dbus declarative device-mapper djvu dri dts dvb dvd dvdr ebook encode exif fam ffmpeg flac gdbm gif gimp gmp gnutls gpg gphoto2 gpm gtk iconv id3 imagemagick imap java jpeg jpeg2k kde kdeenablefinal kdeprefix kipi laptop libnotify libwww lzma lzo mad mmx mmxext mng modules mp3 mp4 mpeg mplayer mtp multilib musicbrainz ncurses network-cron nptl nptlonly nsplugin offensive ogg opengl openmp pam pcre pdf phonon plasma png policykit pulseaudio qt3support qt4 quicktime rdesktop readline real scanner sdl session spell sse sse2 sse3 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb v4l v4l2 vorbis webkit wicd wifi win32codecs wxwidgets x264 xcb xcomposite xml xmp xulrunner xv xvid zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="braindump flow karbon kexi krita sheets stage words" CAMERAS="ptp2 canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby18" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="vesa intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON ================================================================= Package Settings ================================================================= sys-fs/zfs-kmod-0.6.2-r3 was built with the following: USE="-custom-cflags -debug (multilib) (policykit) rootfs" ABI_X86="64" LDFLAGS=""
And from a non-working one Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.18-r1, 3.12.7-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.12.7-gentoo-x86_64-AMD_Turion-tm-_II_Neo_N54L_Dual-Core_Processor-with-gentoo-2.2 KiB Mem: 3922936 total, 767360 free KiB Swap: 4194300 total, 4191904 free Timestamp of tree: Wed, 29 Jan 2014 07:15:01 +0000 ld GNU ld (GNU Binutils) 2.24 app-shells/bash: 4.2_p45-r1 dev-lang/python: 2.7.6, 3.3.3 dev-util/cmake: 2.8.12.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.13.4, 1.14.1 sys-devel/binutils: 2.24-r2 sys-devel/gcc: 4.7.3-r1, 4.8.2 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.13 (virtual/os-headers) sys-libs/glibc: 2.18-r1 Repositories: gentoo digimed Installed sets: @base, @kernels, @temp ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=amdfam10 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/env.d /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=amdfam10 -O2 -pipe" DISTDIR="/mnt/portage/distfiles" EMERGE_DEFAULT_OPTS="--alphabetical --jobs --load-average 6" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync 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="ftp://ftp.heanet.ie/pub/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo/" LANG="en_GB" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="--jobs 5 --load 5" PKGDIR="/mnt/portage/packages/slartibartfast" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--timeout=500 --progress" 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" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/var/portage" PORTDIR_OVERLAY="/mnt/portage/local" SYNC="rsync://portage.digimed.co.uk/portage" USE="acl amd64 bzip2 cli cracklib crypt cups cxx dbus dri fam fortran gdbm gmp gnutls iconv idn maildir mmx modules multilib mysql ncurses nptl openmp pam pcre readline session sse sse2 ssl tcpd unicode vhosts webdav xattr zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON ================================================================= Package Settings ================================================================= sys-fs/zfs-kmod-0.6.2-r3 was built with the following: USE="-custom-cflags -debug (multilib) rootfs" ABI_X86="64" LDFLAGS=""
Created attachment 369046 [details] build.log My fault on the attachments thing, the file was only root-readable
I've just installed Gentoo ~amd64 on a new computer. And I'm getting this zfs-kmod compilation failure also. GCC 4.8.2, gentoo-sources 3.13.0. NOTE: It compiles fine on gentoo-sources 3.12.9
Problem is with configure: 'checking whether bdi_setup_and_register() is available... no' when bdi_setup_and_register() is actually present. Very rough bypass is: 1. 'ebuild zfs-kmod.ebuild prepare' 2. insert '$as_echo "#define HAVE_BDI_SETUP_AND_REGISTER 1" >>confdefs.h' in line 17993 of 'configure' file, so bdi_setup_and_register() presence is unconditional 3. 'ebuild zfs-kmod.ebuild merge'
Created attachment 370100 [details] config.log This appears to be due to the fact that bdi_setup_and_register is declared with attribute warn_unused_result, and the compiler treats the resulting warning as an error. Details from config.log: configure:17934: checking whether super_block has s_bdi configure:17965: cp conftest.c build && make modules -C /lib/modules/3.13.2-gentoo/build EXTRA_CFLAGS=-Werror M=/var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build configure:17968: $? = 0 configure:17970: test -s build/conftest.o configure:17973: $? = 0 configure:17976: result: yes configure:17996: checking whether bdi_setup_and_register() is available configure:18024: cp conftest.c build && make modules -C /lib/modules/3.13.2-gentoo/build EXTRA_CFLAGS=-Werror M=/var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build /var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build/conftest.c: In function ‘main’: /var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build/conftest.c:91:25: error: ignoring return value of ‘bdi_setup_and_register’, declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make[1]: *** [/var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build/conftest.o] Error 1 make: *** [_module_/var/tmp/portage/sys-fs/zfs-kmod-0.6.2-r3/work/zfs-zfs-0.6.2/build] Error 2 configure:18027: $? = 2 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" […] | #define HAVE_BDI 1 | | | #include <linux/backing-dev.h> | | int | main (void) | { | | bdi_setup_and_register(NULL, NULL, 0); | | ; | return 0; | } | configure:18047: result: no
I see this same behavior with both 3.13.0 and 3.13.2 (as an FYI). No new data to add, just wanted to indicate it seems to be 3.13.x.
Created attachment 371002 [details, diff] Patch #1 for bdi_setup_and_register configure check
Created attachment 371004 [details, diff] Patch #2 for bdi_setup_and_register configure check
I got around the problem by backporting two patches from upstream, you can find them attached. The problem seems to arise with linux >=3.13 and GCC >= 4.7. The two patches fix the bdi_setup_and_register configure check so that GCC doesn't return the error, so the check correctly succeeds.
I also see this build error with 3.13.3-hardened-r1
Dropping those patches into /etc/portage/patches fixed it for me, thanks.
The patches work for me too, thanks.
Patch #1 and #2 for me me too on 3.13.3-hardened-r1. ryao is checking if there are any additional patches to include.
I'm using patch 1 and 2 as well (3.13.8) with 9999 versions (and veryvery latest upstream pax)
This has been fixed since sys-fs/zfs-kmod-0.6.2-r4. My apologies for letting this bug stay open so long.