Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 319559 - [tracker] CFLAGS=-O0 (or implicitly disabling compile optimisation) - implicit declaration of function 'setlocale'
Summary: [tracker] CFLAGS=-O0 (or implicitly disabling compile optimisation) - implici...
Status: RESOLVED DUPLICATE of bug 59506
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Gentoo Quality Assurance Team
URL: http://blog.flameeyes.eu/2008/09/02/t...
Whiteboard:
Keywords: Tracker
Depends on: 220647 299316 319747
Blocks:
  Show dependency tree
 
Reported: 2010-05-13 15:44 UTC by Dyweni
Modified: 2017-01-19 18:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dyweni 2010-05-13 15:44:04 UTC
I've now run across several packages that fail to build because it cannot find the function 'setlocale' as well as the type 'LC_ALL'.

Here's the build failure:
main.c: In function 'main':
main.c:223: warning: implicit declaration of function 'setlocale'
main.c:223: error: 'LC_ALL' undeclared (first use in this function)
main.c:223: error: (Each undeclared identifier is reported only once
main.c:223: error: for each function it appears in.)
make[2]: *** [main.o] Error 1

Here's some package that fail on my systems:
=media-gfx/icoutils-0.29.1
=app-arch/rpm-4.4.7-r4
=app-arch/rpm-4.4.6-r7
=app-arch/rpm-4.4.6-r6



I have two systems (both amd64) affected similarly:

System #1:
Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.1-r0, 2.6.33-gentoo-r1-20100427-2256 x86_64)
=================================================================
System uname: Linux-2.6.33-gentoo-r1-20100427-2256-x86_64-AMD_Phenom-tm-_II_X2_545_Processor-with-gentoo-2.0.1
Timestamp of tree: Wed, 12 May 2010 14:00:01 +0000
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r1, 3.1.2-r3
dev-python/pycrypto: 2.1.0
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=amdfam10 -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/X11/xkb /usr/share/config /var/lib/hsqldb"
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"
CXXFLAGS="-pipe -march=amdfam10 -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages installsources news parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.wetzlmayr.com/ http://gentoo.mirrors.hoobly.com/ http://gentoo.osuosl.org/ http://gentoo.arcticnetwork.ca/ http://gentoo.netnitco.net"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
MAKEOPTS="-j1"
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/kde-sunset /var/lib/layman/x11 /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi aio alsa amd64 archive aspell bash-completion berkdb bzip2 cairo cdda cddb cdr cleartype cli consolekit cracklib crypt cscope custom-cflags custom-optimization cxx dbus device-mapper dga disk-partition dri dts dv dvd dvdr emerald exif fam fbcondecor ffmpeg flac fortran fuse gdbm gdu gecko gif glitz gmp gnome gnome-keyring gnutls gphoto2 gpm gstreamer gtk hal iconv java java6 jpeg kate libffi libnotify lightning lm_sensors lzo mad matroska mbrola mmap mmx modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly nsplugin ogg ogg123 ogm opengl openmp optimized-qmake pam pcre perl playlist png policykit pppd python readline reflection replytolist samba secure-delete session sftp smp sound spell spl srt sse sse2 ssl startup-notification svg sysfs theora threads thumbnail tiff tk truetype udev unicode vorbis wmf x264 xaw xcb xcomposite xinerama xorg xv xvid yv12 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 authn_alias authn_anon 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 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" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" 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, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



System #2:

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.1-r0, 2.6.33-gentoo-r1-20100423-1442 x86_64)
=================================================================
System uname: Linux-2.6.33-gentoo-r1-20100423-1442-x86_64-AMD_Turion-tm-_64_Mobile_Technology_ML-32-with-gentoo-2.0.1
Timestamp of tree: Wed, 12 May 2010 14:00:01 +0000
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r1, 3.1.2-r3
dev-python/pycrypto: 2.1.0
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=athlon64 -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/X11/xkb /usr/share/config /var/lib/hsqldb"
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"
CXXFLAGS="-pipe -march=athlon64 -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages installsources news parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.wetzlmayr.com/ http://gentoo.mirrors.hoobly.com/ http://gentoo.osuosl.org/ http://gentoo.arcticnetwork.ca/ http://gentoo.netnitco.net"
LANG="C"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
MAKEOPTS="-j1"
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/kde-sunset /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X acl acpi aio alsa amd64 archive aspell bash-completion berkdb bzip2 cairo cdda cddb cleartype cli consolekit cracklib crypt cscope custom-cflags custom-optimization cxx dbus device-mapper dga disk-partition dri emerald exif fam fbcondecor ffmpeg fortran fuse gdbm gdu gecko gif glitz gmp gnome gnome-keyring gnutls gphoto2 gpm gstreamer gtk hal iconv java java6 jpeg libffi libnotify lightning lm_sensors lzo mbrola mmx modules mpeg mudflap multilib nautilus ncurses nls nptl nptlonly nsplugin opengl openmp optimized-qmake pam pcre perl png policykit pppd python readline reflection replytolist samba secure-delete session sftp smp spell spl sse sse2 ssl startup-notification svg sysfs threads thumbnail tiff tk truetype udev unicode wmf xaw xcb xcomposite xinerama xorg xv 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 authn_alias authn_anon 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 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" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" 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, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS




Reproducible: Always
Comment 1 Samuli Suominen gentoo-dev 2010-05-13 15:51:26 UTC
Let me guess: If you add for example -O1 or -O2 to CFLAGS, the problem goes away?
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-05-13 15:59:31 UTC
Compare bug #220647 comment #1 and #220647 comment #4. See also [URL] for more info. Setting -O should work around this problem.

I'll try to figure out how to solve this for N=huge packages.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2010-05-13 16:03:21 UTC
Lee Leahu: Please file separate bug reports for each package that fails to compile because of disabled optimisation flags.
Comment 4 Dyweni 2010-05-13 16:17:01 UTC
Jeroen Roovers:  The  link in #4 of 220647 explains why locale.h only gets included if optimizations are enabled - very useful!

I will file new bugs for each package I find.  Thank you!


(In reply to comment #3)
> Lee Leahu: Please file separate bug reports for each package that fails to
> compile because of disabled optimisation flags.
> 

Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-05-13 16:45:45 UTC
The icoutils issue is fixed in =media-gfx/icoutils-0.29.1-r1.
Comment 6 Dyweni 2010-05-14 16:02:01 UTC
(In reply to comment #5)
> The icoutils issue is fixed in =media-gfx/icoutils-0.29.1-r1.
> 

confirming icoutils is fixed
Comment 7 Mark Loeser (RETIRED) gentoo-dev 2010-09-10 19:27:36 UTC

*** This bug has been marked as a duplicate of bug 59506 ***