I just did a emerge -e world, and out of 652 packages this was the only one that failed. I also tried very conservative CFLAGS (CFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -pipe"), but kept getting the same error. /bin/sh ../../libtool --mode=compile i686-pc-linux-gnu-gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I../../snmplib -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib/perl5/5.8.8/i686-linux/CORE -O3 -march=athlon-xp -mtune=athlon-xp -pipe -Dlinux -c -o ucd-snmp/disk.lo ucd-snmp/disk.c rm -f ucd-snmp/.libs/disk.lo i686-pc-linux-gnu-gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I../../snmplib -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib/perl5/5.8.8/i686-linux/CORE -O3 -march=athlon-xp -mtune=athlon-xp -pipe -Dlinux -c ucd-snmp/disk.c -fPIC -DPIC -o ucd-snmp/.libs/disk.lo ucd-snmp/disk.c:232:36: error: operator '||' has no right operand ucd-snmp/disk.c:299:36: error: operator '||' has no right operand ucd-snmp/disk.c:431:19: error: #if with no expression ucd-snmp/disk.c:454:36: error: operator '||' has no right operand ucd-snmp/disk.c:525:19: error: #if with no expression ucd-snmp/disk.c:551:36: error: operator '||' has no right operand make[2]: *** [ucd-snmp/disk.lo] Error 1 make[2]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent/mibgroup' make[1]: *** [subdirs] Error 1 make[1]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent' make: *** [subdirs] Error 1 !!! ERROR: net-analyzer/net-snmp-5.3.1-r1 failed. Call stack: ebuild.sh, line 1568: Called dyn_compile ebuild.sh, line 937: Called src_compile net-snmp-5.3.1-r1.ebuild, line 113: Called die !!! emake failed !!! If you need support, post the topmost build error, and the call stack if relevant. emerge --info Portage 2.1.2_rc2-r1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.5-r0, 2.6.18-ck1-r2 i686) ================================================================= System uname: 2.6.18-ck1-r2 i686 AMD Athlon(tm) Gentoo Base System version 1.12.6 Last Sync: Fri, 24 Nov 2006 15:30:01 +0000 dev-java/java-config: 1.3.7, 2.0.30 dev-lang/python: 2.4.4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=athlon-xp -mtune=athlon-xp -pipe -fomit-frame-pointer -mmmx -msse -m3dnow -mfpmath=sse" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O3 -march=athlon-xp -mtune=athlon-xp -pipe -fomit-frame-pointer -mmmx -msse -m3dnow -mfpmath=sse" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict" GENTOO_MIRRORS="ftp://gentoo.kems.net/mirrors/gentoo http://gentoo.kems.net http://mirror.datapipe.net/gentoo http://ftp.club-internet.fr/pub/mirrors/gentoo ftp://mirror.datapipe.net/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_EXTRA_OPTS="--timeout=99999" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext S3TC X a52 aac acpi alsa amarok apache2 arts asf asm audiofile bash-completion berkdb bzip2 cairo cddb cdparanoia cdr cdrom cli cracklib crypt css cups curl dlloader dri dv dvd dvdr dvdread eds elibc_glibc emoticon encode fame ffmpeg firefox flac foomaticdb gdbm gif gimp glibc-omitfp glut gstreamer gtk gtk2 gzip iconv ieee1394 imagemagick imlib input_devices_evdev input_devices_keyboard iproute2 isdnlog jack java javascript joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kernel_linux lame libwww live logitech-mouse lzo mad mikmod mjpeg mmx mmxext motif mozsvg mp3 mpeg mpeg2 mplayer musicbrainz ncurses network nforce2 nls nntp no-old-linux nomalloccheck nptl nptlonly nsplugin nspr nvidia ogg openal opengl pam pcre pdf perl physfs png python qt3 qt4 quicktime readline real reflection rtc samba scanner sdl spell sse ssl subtitles svg sysfs tcpd theora threadsafe tiff transcode truetype truetype-fonts type1 type1-fonts udev unicode urandom usb userland_GNU userlocales v4l v4l2 vcd video_cards_nvidia visualization vorbis win32codecs wmf xcomposite xine xml xorg xpm xrandr xscreensaver xv xvid xvmc zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS
I had the same problem, and oddly running it through cpp with the right include dirs made it compile. cpp -I /var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent/mibgroup/ucd-snmp -I /var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent/mibgroup /var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent/mibgroup/ucd-snmp/disk.c > disk.c
Seems to be fix in version 5.4
*** Bug 160250 has been marked as a duplicate of this bug. ***
I can confirm this error with net-snmp-5.2.1.2-r1 (latest stable version). Using net-snmp-5.4 from ~x86 worked for me.
*** Bug 160899 has been marked as a duplicate of this bug. ***
*** Bug 161246 has been marked as a duplicate of this bug. ***
*** Bug 161314 has been marked as a duplicate of this bug. ***
Reopen; either stabilize something working (5.4) or fix this please.
Created attachment 106348 [details, diff] net-snmp-defined.patch This patch makes it compile for me, should apply cleanly with patch -p1, guess this should be sufficient to allow maintainer to create a -r2 and get this resolved, thanks.
Same issue. Added mysqelf to CC.
*** Bug 161919 has been marked as a duplicate of this bug. ***
Same issue with 5.2.1.2-r1. Further up in my log, specifically in the "checking for platform-specific source..." secion, I see: checking for library containing getmntent... none required Which might mean that the value is being ignored rather than set to 0. Would it be better to correct that in case some other cases actually behave differently when it is set to 0? I believe this patch would break those. Sorry, don't know enough to suggest a different patch.
*** Bug 163168 has been marked as a duplicate of this bug. ***
5.4 stabilization handled in Bug 163094, closing again.
*** Bug 163719 has been marked as a duplicate of this bug. ***
*** Bug 164380 has been marked as a duplicate of this bug. ***
It would still be nice to fix this bug in 5.2.1.2-r1 at least. I traced through some more of the code built a similar patch, which wraps all occurrences of HAVE_GETMNTENT, HAVE_STATFS, HAVE_STATVFS, and HAVE_SETMNTENT with defined(). It looks like these variables are supposed to be empty (or simply #DEFINE'd), so I'm guessing the error shows up now because the newer GCCs substitute and then process the ||, whereas the older ones probably didn't (or something similar)...