Emerging www-client/lynx-2.8.7_p1 fails. Reproducible: Always Steps to Reproduce: 1. "emerge lynx" Actual Results: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/share/locale\" -I. -I.. -Ichrtrans -I./chrtrans -I.. -I../src -I.././WWW/Library/Implementation -D_GNU_SOURCE -DLINUX -I/usr/include/ncursesw -march=nocona -pipe -ggdb -c LYMain.c LYMain.c: In function 'SetLocale': LYMain.c:941: error: 'LC_ALL' undeclared (first use in this function) LYMain.c:941: error: (Each undeclared identifier is reported only once LYMain.c:941: error: for each function it appears in.) make[1]: *** [LYMain.o] Error 1 make[1]: Leaving directory `/mnt/temporary/var-tmp/portage/www-client/lynx-2.8.7_p1/work/lynx2-8-7/src' make: *** [all] Error 2 Expected Results: Compilation works bogo src # emerge --info Portage 2.1.6.13 (default/linux/amd64/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.31debug x86_64) ================================================================= System uname: Linux-2.6.31debug-x86_64-Intel-R-_Core-TM-2_CPU_T7200_@_2.00GHz-with-gentoo-1.12.11.1 Timestamp of tree: Wed, 23 Sep 2009 21:30:01 +0000 app-shells/bash: 4.0_p28 dev-java/java-config: 1.3.7-r1, 2.1.8-r1 dev-lang/python: 2.4.6, 2.5.4-r3, 2.6.2-r1 dev-python/pycrypto: 2.0.1-r6 dev-util/cmake: 2.6.4 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.13, 2.63-r1 sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -pipe -ggdb" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/privoxy/templates /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=nocona -pipe -ggdb" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="de_DE.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="de en en_GB" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/armagetron /home/cweiske/Dev/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi aiglx aim alsa amd64 apache2 avahi avi bash-completion berkdb bluethooth bluetooth branding bzip2 cairo cdda cdr cli cracklib crypt cups daap dbus divx dri dts dv dvd dvdr eds emboss encode evo exif fam fax firefox flac fortran ftp gcj gd gdbm gif gimpprint glitz glx gnutls gphoto2 gpm gstreamer gtk gtk2 hal hbci icecast iconv ieee1394 imap ipv6 isdnlog isight java jpeg ldap libnotify lirc live mad madwifi matroska mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses network nls nptl nptlonly nsplugin offensive ofx ogg oggvorbis openal opengl openmp pam pcre pdf perl png ppds pppd python quicktime readline reflection reiser4 reiserfs samba sasl scanner sdl session slp smp soap speex spell spl sqlite3 srt sse sse2 ssl startup-notification svg sysfs tcpd theora threads thunar tiff truetype unicode upnp usb v4l v4l2 visualization vorbis x264 xcb xcomposite xface xine xinerama xiv xml xorg xosd xulrunner xv xvid zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file 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 speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en en_GB" LIRC_DEVICES="macmini" MISDN_CARDS="hfcsusb" NETBEANS_MODULES="php ide" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="intel" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
It looks to me as if this bug is only triggered when building with compiler optimizations disabled; try adding "-O2" to your CFLAGS in make.conf and see if this problem goes away. I would venture a guess that you probably want safe optimizations on anyways, and either accidentally left out -O2 or intended to remove it temporarily while chasing down some other bug...
It does indeed work when using -O2! Should that be reported to upstream?
Good question about upstream -- but it turns out that they are aware of this problem, because they dealt with it in the latest development snapshot. So, all I had to do was grab their fix and put it into the stable version.