Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 379635

Summary: app-misc/realpath-1.15-r3 fails to build due to missing locale.h include
Product: Gentoo Linux Reporter: Chris Slycord <cslycord>
Component: Current packagesAssignee: Gentoo Shell Tools project <shell-tools>
Status: RESOLVED FIXED    
Severity: normal CC: kensington
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: fixes building with -O0

Description Chris Slycord 2011-08-18 00:10:38 UTC
>>> Preparing source in /var/tmp/portage/app-misc/realpath-1.15-r3/work/realpath-1.15 ...
 * Applying realpath-1.15-build.patch ...                                [ ok ]
 * Applying realpath-1.14-no-po4a.patch ...                              [ ok ]
 * Applying realpath-1.15-prefix.patch ...                               [ ok ]
 * Adjusting to prefix /
 *   common.mk ...                                                       [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-misc/realpath-1.15-r3/work/realpath-1.15 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-misc/realpath-1.15-r3/work/realpath-1.15 ...
make -j3 VERSION=1.15 'SUBDIRS=src man po' 
** Making ./src/_build ...
** Compiling _build/realpath.o ...
realpath.c: In function 'main':
realpath.c:118:2: warning: implicit declaration of function 'setlocale'
realpath.c:118:12: error: 'LC_ALL' undeclared (first use in this function)
realpath.c:118:12: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [_build/realpath.o] Error 1
make: *** [all] Error 2
emake failed
 * ERROR: app-misc/realpath-1.15-r3 failed (compile phase):
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 2525:  Called die
 * The specific snippet of code:
 *       emake VERSION="${PV}" SUBDIRS="src man $(use nls && echo po)" || die "emake failed"

Reproducible: Always

Steps to Reproduce:
1. install realpath
2.
3.
Actual Results:  
Fails due to missing locale declaration (LC_ALL)

Expected Results:  
Install...

# emerge --info =app-misc/realpath-1.15-r3
Portage 2.2.0_alpha51 (default/linux/x86/10.0, gcc-4.5.3, glibc-2.13-r4, 3.0.1-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.0.1-gentoo-i686-Intel-R-_Core-TM-2_CPU_6420_@_2.13GHz-with-gentoo-2.0.3
Timestamp of tree: Wed, 17 Aug 2011 14:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
ccache version 3.1.5 [enabled]
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r2, 3.2-r2
dev-util/ccache:          3.1.5
dev-util/cmake:           2.8.5-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo mv local_portage
Installed sets: 
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-D_FORTIFY_SOURCE=2 -march=core2 -mcx16 -msahf --param 	l1-cache-size=32 --param l1-cache-line-size=64 --param 	l2-cache-size=4096 -mtune=core2 -mmmx -msse -msse2 -msse3 	-mssse3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-D_FORTIFY_SOURCE=2 -march=core2 -mcx16 -msahf --param 	l1-cache-size=32 --param l1-cache-line-size=64 --param 	l2-cache-size=4096 -mtune=core2 -mmmx -msse -msse2 -msse3 	-mssse3 -pipe -fomit-frame-pointer"
DISTDIR="/home/ftp/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --keep-going"
FEATURES="assume-digests binpkg-logs ccache distcc distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US es es_LA"
MAKEOPTS="-j3"
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="/var/lib/layman/mv /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa bash-completion berkdb bzip2 cairo cdda cdr cjk cli consolekit cracklib crypt css cups cxx dbus dri dvd dvdread ffmpeg flac fontconfig fortran gdbm gif gmp gnome gpm gstreamer gtk iconv icu ipv6 jpeg jpeg2k libnotify lm_sensors lzma mmx modules mp3 msn mudflap nautilus ncurses networkmanager nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl png policykit pppd python qt3support readline session sse sse2 sse3 ssl ssse3 sysfs tcpd theora tiff truetype udev unicode vorbis x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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 kpresenter krita tables words" 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 ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US es es_LA" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 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

=================================================================
                        Package Settings
=================================================================

app-misc/realpath-1.15-r3 was built with the following:
USE="nls"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mmmx -msse -msse2 -msse3 -mssse3"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mmmx -msse -msse2 -msse3 -mssse3"
Comment 1 SpanKY gentoo-dev 2011-08-21 16:17:56 UTC
with all your ricer flags, i wonder if you realized they're almost completely useless since you're building with CFLAGS=-O0
Comment 2 Chris Slycord 2011-08-21 19:04:52 UTC
(In reply to comment #1)
> with all your ricer flags, i wonder if you realized they're almost completely
> useless since you're building with CFLAGS=-O0
1) So are you saying that "-mmmx -msse -msse2 -msse3 -mssse3" are all ricer flags? Because everything else (aside from the "-O2" and "-pipe -fomit-frame pointer") was enabled by -march=native. And I only enabled the mmx/sse junk because gcc indicated that support for them was disabled with native even though my CPU supported them.
2) Where do you get that I'm building with CFLAGS=-O0? Doesn't the output show it being build with -O2?
Comment 3 Joakim Crafack 2011-09-13 09:23:59 UTC
Happens for me too.

Clean stage3 install, after --sync and doing -uvD --newuse world.

app-misc/realpath-1.15-r3 fails install with exact same error.

Portage 2.1.10.15 (default/linux/x86/10.0/desktop/kde, gcc-4.4.5, glibc-2.13-r4, 3.0.4-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.0.4-gentoo-i686-Intel-R-_Pentium-R-_D_CPU_2.80GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 13 Sep 2011 06:00:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-pipe -march=native"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="da_DK.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB da"
MAKEOPTS="-j6"
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=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gdu gif gpm gtk iconv ithreads jpeg kde kipi latin1 lcms ldap libnotify mad mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly offensive ogg opengl openmp pam pango pcre pdf perl phonon plasma png policykit ppds pppd python qt3support qt4 readline sdl semantic-desktop session spell ssl startup-notification svg sysfs tcpd tiff truetype udev unicode usb vlc vorbis win32codecs x264 x86 xcb xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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="kexi words flow plan stage tables krita karbon braindump" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB da" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vga ati radeon r300" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Michael Palimaka (kensington) gentoo-dev 2011-10-06 17:04:39 UTC
(In reply to comment #2)
> 2) Where do you get that I'm building with CFLAGS=-O0? Doesn't the output show
> it being build with -O2?
The "package settings" section refers to an existing, successful merge. If you check your emerge --info, you will see that no -O level is set, so gcc defaults to -O0.

The code in question assumes that gettext will include locale.h, but in reality, it only does so when optimisations are enabled (see http://blog.flameeyes.eu/2008/09/02/testing-the-corner-cases).
Comment 5 Michael Palimaka (kensington) gentoo-dev 2011-10-06 17:08:01 UTC
Created attachment 288997 [details, diff]
fixes building with -O0

Sending this upstream too.
Comment 6 Michael Palimaka (kensington) gentoo-dev 2011-10-17 10:20:31 UTC
This bug has been fixed upstream as of 1.16
Comment 7 Justin Lecher (RETIRED) gentoo-dev 2011-10-17 14:54:23 UTC
Thanks Micheal

+*realpath-1.16 (17 Oct 2011)
+
+  17 Oct 2011; Justin Lecher <jlec@gentoo.org> +realpath-1.16.ebuild,
+  metadata.xml:
+  Version Bump, fixes #379635
+