Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 162053 - QA: dev-libs/STLport-5.1.0 implicit declarations of hidden glibc2 functions
Summary: QA: dev-libs/STLport-5.1.0 implicit declarations of hidden glibc2 functions
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-14 14:49 UTC by Kevin F. Quinn (RETIRED)
Modified: 2008-03-16 00:14 UTC (History)
0 users

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


Attachments
Replace use of hidden symbols with public symbols (i.e. remove '__' prefix). (STLport-5.1.0-missing_hidden_glibc2_defines.patch,1.68 KB, patch)
2007-01-14 14:50 UTC, Kevin F. Quinn (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin F. Quinn (RETIRED) gentoo-dev 2007-01-14 14:49:13 UTC
The latest QA checks in portage, which scan the build log file for common compilation warnings, pick up the following:

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * ../../src/c_locale_glibc/c_locale_glibc2.c:351: warning: implicit declaration of function `__towlower_l'
../../src/c_locale_glibc/c_locale_glibc2.c:356: warning: implicit declaration of function `__towupper_l'
../../src/c_locale_glibc/c_locale_glibc2.c:423: warning: implicit declaration of function `__strcoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:439: warning: implicit declaration of function `__wcscoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:459: warning: implicit declaration of function `__strxfrm_l'
../../src/c_locale_glibc/c_locale_glibc2.c:472: warning: implicit declaration of function `__wcsxfrm_l'
../../src/c_locale_glibc/c_locale_glibc2.c:351: warning: implicit declaration of function `__towlower_l'
../../src/c_locale_glibc/c_locale_glibc2.c:356: warning: implicit declaration of function `__towupper_l'
../../src/c_locale_glibc/c_locale_glibc2.c:423: warning: implicit declaration of function `__strcoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:439: warning: implicit declaration of function `__wcscoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:459: warning: implicit declaration of function `__strxfrm_l'
../../src/c_locale_glibc/c_locale_glibc2.c:472: warning: implicit declaration of function `__wcsxfrm_l'
../../src/c_locale_glibc/c_locale_glibc2.c:351: warning: implicit declaration of function `__towlower_l'
../../src/c_locale_glibc/c_locale_glibc2.c:356: warning: implicit declaration of function `__towupper_l'
../../src/c_locale_glibc/c_locale_glibc2.c:423: warning: implicit declaration of function `__strcoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:439: warning: implicit declaration of function `__wcscoll_l'
../../src/c_locale_glibc/c_locale_glibc2.c:459: warning: implicit declaration of function `__strxfrm_l'
../../src/c_locale_glibc/c_locale_glibc2.c:472: warning: implicit declaration of function `__wcsxfrm_l'


The QA checks pick up on these since without an explicit declaration the compiler cannot verify that the return type and types of parameters match, such errors will cause unexpected behaviour.  Usually the warnings are simply due to a missing #include, and in mature code it's rare that there is actually a mismatch (although not impossible, by any means).  However in this case things are a little more complicated.

The __<x>_l functions are internal libc.so definitions that avoid the PLT, assuring that calls to them from inside libc.so itself always resolve to the implementation in libc.so.

I can't comment on why STLport is using these.  Further, I suspect that on a toolchain that fully supports hidden symbols, they will fail to resolve since the link/loader should refuse to resolve references to such symbols outside of the shared library in which they are defined.  I may be wrong in that, however.

A simple change, to replace the __<x>_l names with <x>_l eliminates the compilation warnings, and would eliminate any link/load failure if that indeed is the case on later toolchains.  However it would be worth speaking to upstream about it, as presumably they've written the code the way they have for a reason.

Trivial patch to follow.


# emerge --info
Portage 2.1.2_rc4-r9 (hardened/x86/2.6, gcc-3.4.6/hardened, glibc-2.4-r4, 2.6.18-hardened i686)
=================================================================
System uname: 2.6.18-hardened i686 Mobile Intel(R) Pentium(R) III CPU - M  1200MHz
Gentoo Base System version 1.12.6
Timestamp of tree: Unknown
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
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.15.92.0.2-r9, 2.15.92.0.2-r10, 2.16-r1, 2.16.1-r3, 2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-ggdb2 -O2 -march=pentium3 -pipe -Wall -Wstack-protector -Wtrampolines"
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/lib/fax /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-ggdb2 -O2 -march=pentium3 -pipe -Wall -Wstack-protector -Wtrampolines"
DISTDIR="/data/g2/distfiles"
FEATURES="autoaddcvs autoconfig collision-protect cvs distlocks fixpackages installsources metadata-transfer pax sandbox sfperms sign splitdebug strict stricter test userpriv"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.linux.ee/pub/gentoo/distfiles/ http://ftp.easynet.nl/mirror/gentoo/ http://ftp.heanet.ie/pub/gentoo/ http://gentoo.osuosl.org/"
LC_ALL="en_GB.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB en it de es fr"
MAKEOPTS="-j1"
PKGDIR="/data/g2/pkgdir"
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="/data/g2/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/data/g2/dev-overlays/kevquinn/hardened/toolchain/branches/gcc-glibc-nopie /data/g2/dev-overlays/kevquinn/hardened/xorg /var/portage"
SYNC="cvs://kevquinn@cvs.gentoo.org:/var/cvsroot"
USE="X a52 aac acl acpi alsa apache2 arts berkdb bluetooth boundschecking bzip2 caps cdr crypt cups dbus dlloader dri dts dv dvd dvdr dvdread encode faad fbcon ffmpeg fortran gcj gif gnokii gtk gtk2 hal hardened hardenedphp ieee1394 imagemagick ipv6 java javascript jikes jpeg jpeg2k kde kdeenablefinal kerberos ldap libcaca mad madwifi mailwrapper mbox mmx mozilla mp3 mp4 mpeg mysql nas nls nptl nsplugin odbc ogg openexr opengl oss pam pda pdf perl pic png postgres python qt qt3 qt4 quicktime readline samba scanner sdl slp sndfile spell sse ssl svg tcl tcltk tcpd test theora threads tidy tiff timidity tk truetype unicode usb userlocales v4l vorbis wifi wma x264 x86 xinerama xml xml2 xorg xprint xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LINGUAS="en_GB en it de es fr" USERLAND="GNU" VIDEO_CARDS="radeon vesa vga"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Kevin F. Quinn (RETIRED) gentoo-dev 2007-01-14 14:50:24 UTC
Created attachment 106940 [details, diff]
Replace use of hidden symbols with public symbols (i.e. remove '__' prefix).
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-01-15 00:10:58 UTC
Uhm... might be useful to post the ebuild name I guess? ;)
Comment 3 Kevin F. Quinn (RETIRED) gentoo-dev 2007-01-15 00:41:49 UTC
*ahem* er, yeah... :) dev-libs/STLport-5.1.0
Comment 4 Ciaran McCreesh 2007-01-15 06:56:16 UTC
Thing is... STLport is considered to be a 'compiler level' library (it's a replacement for libstdc++), and in some places it *has* to make use of things that normal libraries shouldn't. I strongly suggest talking to upstream before changing this.
Comment 5 Kevin F. Quinn (RETIRED) gentoo-dev 2007-01-15 07:29:13 UTC
(In reply to comment #4)
> Thing is... STLport is considered to be a 'compiler level' library (it's a
> replacement for libstdc++), and in some places it *has* to make use of things
> that normal libraries shouldn't. I strongly suggest talking to upstream before
> changing this.

Agreed.

Actually, looking at the libstdc++ code, it does the following to get to the same symbols:

extern "C" __typeof(towlower_l) __towlower_l;

so presumably my worries about symbol visibility are unfounded (the above is from config/locale/gnu/c++locale_internal.h in gcc-4.1.1).  If I get time, I'll try working up a patch that does the same thing for STLport.
Comment 6 Tiziano Müller (RETIRED) gentoo-dev 2007-07-11 20:10:27 UTC
@kevquinn: Any news?
Comment 7 Mark Loeser (RETIRED) gentoo-dev 2007-11-25 04:59:48 UTC
I don't see a reason for QA to be involved at this point in time.  As always, slap me and re-add if you feel differently.
Comment 8 Mark Loeser (RETIRED) gentoo-dev 2008-03-16 00:14:22 UTC
I'm going to say upstream is probably doing this for a good reason, so unless someone can come up with an explanation as to why this is harmful (and better yet, a patch that we can push upstream), this is something we WONTFIX for now.