When building with MAKEOPTS="-j8" x86_64-pc-linux-gnu-gcc -march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -fstack-protector-strong -Wall -c -o bcache-register.o bcache-register.c x86_64-pc-linux-gnu-gcc: error: bcache.o: No such file or directory <builtin>: recipe for target 'probe-bcache' failed m
with MAKEOPTS="-j1" x86_64-pc-linux-gnu-gcc -march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -fstack-protector-strong -Wall `pkg-config --cflags uuid blkid` -Wl,-O1 -Wl,--as-needed make-bcache.c bcache.o `pkg-config --libs uuid blkid` -o make-bcache /var/tmp/portage/sys-fs/bcache-tools-1.0.8_p20140220/temp/cc84oxul.o: In function `write_sb': make-bcache.c:(.text+0x9b7): undefined reference to `crc64' collect2: error: ld returned 1 exit status <builtin>: recipe for target 'make-bcache' failed
Created attachment 424222 [details] build log
root@r9-008cln temp # emerge --info =sys-fs/bcache-tools-1.0.8_p20140220 Portage 2.2.27 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/gnome/systemd, gcc-5.3.0, glibc-2.22-r1, 4.4.0-gentoo-r1 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.4.0-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.2 KiB Mem: 15782588 total, 5587012 free KiB Swap: 20971516 total, 20934908 free Timestamp of repository gentoo: Sat, 30 Jan 2016 07:45:01 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.22.1::gentoo dev-lang/python: 2.7.11-r2::gentoo, 3.4.3-r7::gentoo, 3.5.1-r2::gentoo dev-util/cmake: 3.4.3::gentoo dev-util/pkgconfig: 0.29::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.20.4::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r1::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 4.9.3::gentoo, 5.3.0::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6-r1::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.ru.gentoo.org/gentoo-portage priority: -1000 rugubara location: /home/anton/devel/rugubara masters: gentoo priority: 0 anders-larsson location: /var/lib/layman/anders-larsson masters: gentoo priority: 50 betagarden location: /var/lib/layman/betagarden masters: gentoo priority: 50 bumblebee location: /var/lib/layman/bumblebee masters: gentoo priority: 50 fw-overlay location: /var/lib/layman/fw-overlay masters: gentoo priority: 50 ixit location: /var/lib/layman/ixit masters: gentoo priority: 50 jorgicio location: /var/lib/layman/jorgicio masters: gentoo priority: 50 kde location: /var/lib/layman/kde masters: gentoo priority: 50 proaudio location: /var/lib/layman/pro-audio masters: gentoo priority: 50 sabayon location: /var/lib/layman/sabayon masters: gentoo priority: 50 steam-overlay location: /var/lib/layman/steam masters: gentoo priority: 50 stuff location: /var/lib/layman/stuff masters: gentoo priority: 50 sunrise location: /var/lib/layman/sunrise masters: gentoo priority: 50 tlp location: /var/lib/layman/tlp masters: gentoo priority: 50 x11 location: /var/lib/layman/x11 masters: gentoo priority: 50 Installed sets: @kde-frameworks-live ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -fstack-protector-strong" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt" 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=haswell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -fstack-protector-strong" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer 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://mirror.yandex.ru/gentoo-distfiles/ http://gentoo.bloodhost.ru/ http://mirror.bytemark.co.uk/gentoo/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j9" PKGDIR="/usr/portage/etersoft" 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 aes alsa amd64 archive avahi avx avx2 bash-completion berkdb bluetooth bluray branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx cycles dbus dri dri3 dts dvd dvdr eds egl emboss encode evdev evo exif extras faac fam ffmpeg fftw firefox flac fma3 fortran frei0r g711 g722 g7221 gbm gdbm gif gimp glamor gles2 gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gtk3 http iconv ieee1394 introspection ipv6 jack jpeg jpeg2k kms lcms ldap libnotify libsecret lv2 mad midi mmx mmxext mng modules mp3 mp4 mpeg mtp multilib nautilus ncurses networkmanager nls nptl nsplugin nvenc ogg opengl openmp pam pango pcre pdf png policykit popcnt postproc ppds pulseaudio qt3support qt4 rar raw readline realtime samba sdl seccomp sendto session smp speex spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg systemd tcpd theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vorbis vpx wavpack wayland wxwidgets x264 x265 xa xattr xcb xml xv xvid xvmc zlib" 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" APACHE2_MPMS="prefork" 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" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="multiboot efi-64 pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver" LINGUAS="en ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="intel nvidia" XFCE_PLUGINS="brightness clock trash battery power" 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" USE_PYTHON="3.4" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
commit 76aca9c8583227c0a267442b3f82d162b101dfea Author: Justin Lecher <jlec@gentoo.org> Date: Sat Jan 30 16:11:14 2016 +0100 sys-fs/bcache-tools: Fix build problems Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=573372 Package-Manager: portage-2.2.27 Signed-off-by: Justin Lecher <jlec@gentoo.org> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76aca9c8583227c0a267442b3f82d162b101dfea
I still experience the build failure with sys-fs/bcache-tools-1.0.8_p20140220-r1 /var/tmp/portage/sys-fs/bcache-tools-1.0.8_p20140220-r1/temp/cc84oxul.o: In function `write_sb': make-bcache.c:(.text+0x9b7): undefined reference to `crc64' collect2: error: ld returned 1 exit status <builtin>: recipe for target 'make-bcache' failed
(In reply to Anton Gubarkov from comment #5) > I still experience the build failure with > sys-fs/bcache-tools-1.0.8_p20140220-r1 > > > /var/tmp/portage/sys-fs/bcache-tools-1.0.8_p20140220-r1/temp/cc84oxul.o: In > function `write_sb': > make-bcache.c:(.text+0x9b7): undefined reference to `crc64' > collect2: error: ld returned 1 exit status > <builtin>: recipe for target 'make-bcache' failed PLease add a full build.log.
Created attachment 424392 [details] build log This is a build log for sys-fs/bcache-tools-1.0.8_p20140220-r1
(In reply to Anton Gubarkov from comment #7) > Created attachment 424392 [details] > build log > > This is a build log for sys-fs/bcache-tools-1.0.8_p20140220-r1 This output isn't from the latest ebuild as that adds LFS.
Created attachment 424396 [details] build log I'm sorry for a mistake. This is a fresh one.
(In reply to Anton Gubarkov from comment #9) > Created attachment 424396 [details] > build log > > I'm sorry for a mistake. This is a fresh one. Please attach the log uncompressed as text/plain.
Created attachment 424400 [details] build log fresh log in text/plain
It is one of your CFLAGS. Could you please find out which ones breaks the build?
It turned out that I missed "-O2 -pipe" from my CFLAGS. As soon as I added them, the build completed fine. thanks.
okay, thanks for looking into it
When I switched from gcc-6.4.* to gcc-7.3.* and started recompiling everything, bcache-tools-1.0.8_p20140220-r1 failed for me. I have CFLAGS="-Os -finline-functions -frename-registers -pipe -march=nocona". Changing CFLAGS to "-O2" (or even "-O") helps, but I don't think that package compilation should depend on the level of *optimization* that's applied. So I investigated the situation and found out that the link failure for "crc64" is due to gnu99 inline semantics. I'll attach the patch that adds "-fgnu89-inline" to compile flags to apply gnu89 inline semantics which fixes link for most of the executables. probe-bcache has a separate problem: it doesn't link because "crc_table" is missing (it is defined in bcache.c); re-introducing bcache-tools-1.0.8-probe-bcache-underlinking.patch (which exists in portage but isn't applied by the curent ebuild) fixes linking for probe-bcache as well. After that, everything compiles fine.
Created attachment 558362 [details, diff] Apply -fgnu89-inline
Created attachment 558364 [details, diff] Patch for ebuild to apply the two corrective patches
Actually, using bcache-tools-1.0.8-probe-bcache-underlinking.patch doesn't guarantee success: it doesn't make "probe-bcache" depend on "bcache.o", and parallel build can fail if "probe-bcache" is built before "bcache.o" is ready. Thus I'm adding a replacement for bcache-tools-1.0.8-probe-bcache-underlinking.patch which fixes the problem.
Created attachment 558370 [details, diff] Add bcache.o as dependency for probe-bcache
Created attachment 558372 [details, diff] Patch for ebuild to apply the two Manefile patches to fix inline problems With this patch, the package reliably builds with parallel build and regardless of optimization flags.
After 1.5 years, this is still a problem. And it is still resolved by my patch.