Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 182736 - dev-libs/STLport installs unmodified stlport/stl/config/host.h
Summary: dev-libs/STLport installs unmodified stlport/stl/config/host.h
Status: RESOLVED FIXED
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-06-20 21:38 UTC by Albert Zeyer
Modified: 2007-09-25 20:37 UTC (History)
0 users

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 Albert Zeyer 2007-06-20 21:38:55 UTC
I think this is an upstream bug. I am on a PPC with GCC4.
Here is the linker error I get while compiling an own project:

...
CMakeFiles/bin/openlierox.dir/src/common/IpToCountryDB.o: In function `stlpd_std::basic_filebuf<char, stlpd_std::char_traits<char> >::_M_exit_input_mode()':
/usr/include/stlport/stl/_fstream.c:120: undefined reference to `stlpd_std::_Filebuf_base::_M_unmap(void*, long)'
CMakeFiles/bin/openlierox.dir/src/common/FindFile.o: In function `stlpd_std::basic_filebuf<char, stlpd_std::char_traits<char> >::showmanyc()':
/usr/include/stlport/stl/_fstream.c:137: undefined reference to `stlpd_std::_Filebuf_base::_M_seek(long, int)'
CMakeFiles/bin/openlierox.dir/src/common/FindFile.o: In function `stlpd_std::basic_filebuf<char, stlpd_std::char_traits<char> >::seekpos(stlpd_std::fpos<__mbstate_t>, int)':
/usr/include/stlport/stl/_fstream.c:377: undefined reference to `stlpd_std::_Filebuf_base::_M_seek(long, int)'
CMakeFiles/bin/openlierox.dir/src/common/FindFile.o: In function `stlpd_std::basic_filebuf<char, stlpd_std::char_traits<char> >::seekoff(long, int, int)':
/usr/include/stlport/stl/_fstream.c:291: undefined reference to `stlpd_std::_Filebuf_base::_M_seek(long, int)'
/usr/include/stlport/stl/_fstream.c:297: undefined reference to `stlpd_std::_Filebuf_base::_M_seek(long, int)'
/usr/include/stlport/stl/_fstream.c:305: undefined reference to `stlpd_std::_Filebuf_base::_M_seek(long, int)'
CMakeFiles/bin/openlierox.dir/src/common/FindFile.o:/usr/include/stlport/stl/_fstream.c:305: more undefined references to `stlpd_std::_Filebuf_base::_M_seek(long, int)' follow
...

I searched a bit around and found this related bug:
http://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg100642.html

So I looked up the symbols in the libs and got this:

objdump -CT /usr/lib/libstlpor* | grep _M_unmap
...
00057d94 g    DF .text  00000040  Base        stlp_std::_Filebuf_base::_M_unmap(void*, long long)
0002e75c g    DF .text  00000040  Base        stlp_std::_Filebuf_base::_M_unmap(void*, long long)
...

objdump -CT /usr/lib/libstlportstlg.so | grep _M_seek
...
000714f4 g    DF .text  000000ec  Base        stlpd_std::_Filebuf_base::_M_seek(long long, int)
...

You can see, it's very much the same as the one described in this Debian mailing list.

I will try a more recent version of STLport later, perhaps this bug is fixed already.
Comment 1 Albert Zeyer 2007-06-20 21:41:55 UTC
Portage 2.1.2.7 (default-linux/ppc/ppc32/2006.1/G4, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo ppc)
=================================================================
System uname: 2.6.21-gentoo ppc 7447A, altivec supported
Gentoo Base System release 1.12.9
Timestamp of tree: Wed, 20 Jun 2007 21:00:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.32
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
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.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=7400 -maltivec -mabi=altivec"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -mcpu=7400 -maltivec -mabi=altivec"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/     ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/     ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo/       ftp://ftp6.uni-erlangen.de/pub/mirrors/gentoo   ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/"
LINGUAS="de"
PKGDIR="/usr/portage/packages"
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 --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/private"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip GAPING_SECURITY_HOLE X a52 aac aalib aiglx alsa altivec amd apache2 apm applet aqua_theme asf automount backendonly bash-completion battery beagle berkdb binary-drivers bindist binfilter bitmap-fonts bittorrent bonjour bonobo boost branding bzip2 cairo cdr chm cli corba cracklib crosscompile crypt css cups curl cursors d dbus dedicated device-mapper dga dhcp djbfft dmx dnotify dri dts dv dvd dvdread dvi editor eds emboss encode esd evo evolution exif extensions fat fbcon ffmpeg firefox flac fortran ftp gaim gdbm gdm gif gimp glitz gnome gpm gps gs gstreamer gtk gtk2 gtkhtml guionly hal haskell ibam icons iconv ieee1394 injection insecure-drivers ipv6 isdnlog ithreads java javacomm javascript jbig jpeg jpeg2k kerberos keyring krb4 lame lcms ldap libcaca libg++ libnotify libwww linuxthreads-tls live lzo mad matroska midi mikmod mime mjpeg mng mod modplug mozbranding mozcalendar mozdevelop mp3 mp4 mpeg mtp mudflap multicall musepack musicbrainz nautilus ncurses net networkmanager njb nls nntp nptl nptlonly nsplugin ocaml ode ogg openal opengl openmp oss pam pascal pci pcre pdf perl php png ppc ppcsha1 ppds prediction python quicktime readline reflection reiser4 reiserfs rtc rtsp ruby samba screen sdl server session sheep shout slp sockets socks5 speex spell spl ssl startup-notification subversion svg syslog t1lib tagwriting teamarena tetex tga themes theora threads threadsafe thumbnail tiff truetype truetype-fonts type1 type1-fonts unicode usb vcd vidix visualization vorbis widescreen wifi wma wmf wmp wordperfect wxwindows x264 xanim xcomposite xext xface xine xml xorg xrandr xscreensaver xsettings xv xvid zip zlib" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie powermac usb-audio via82xx" 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="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="ati radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Albert Zeyer 2007-06-22 10:14:15 UTC
The bug is also in 5.1.3.

I will try to fix it myself now and make a patch if I have success...
Comment 3 Albert Zeyer 2007-06-22 17:01:38 UTC
I tested now STLport-5.1.2 on another PC (an Athlon, normal x86 system, also with GCC4) with the attached little sample and I got the same error as on my PPC. This looks a bit strange to me because I firstly thought of a PPC issue.

Is this normal? Am I doing something wrong?

This is my test-code:

/*
compile with:
g++ fstream_test.cpp -I/usr/include/stlport -D_PTHREADS -D_STLP_DEBUG -lstlportstlg -o fstream_test
*/

#include <fstream>
#include <iostream>

using namespace std;

int main() {
        std::ifstream file("fstream_test.cpp", ios::in);
        while(!file.eof())
                cout << (char)file.get();
        file.close();

        return 0;
}

Comment 4 Albert Zeyer 2007-06-22 18:32:33 UTC
Thanks to stkn@#gentoo.de, which points to -D_FILE_OFFSET_BITS=64. This works for me.

But nevertheless I am not sure if this is normal.
Comment 5 Tiziano Müller (RETIRED) gentoo-dev 2007-07-12 07:52:15 UTC
hmm, I think the problem is that we just define -D_FILE_OFFSET_BITS=64 for the compilation of the library, but we should rather add it to stlport/stl/config/host.h to make sure that apps using STLport will use the same settings as for the compilation.

So, we should at least add this to host.h:
#define _FILE_OFFSET_BITS 64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE

But probably also uncomment:
#define _PTHREADS

And define the following directly in host.h instead of user_config.h:
#define _STLP_NATIVE_INCLUDE_PATH ...

And maybe uncomment this one too:
#define _STLP_USE_PERTHREAD_ALLOC 1

@spb: comments please?
Comment 6 Tiziano Müller (RETIRED) gentoo-dev 2007-09-25 20:37:34 UTC
Fixed in CVS. Thanks for reporting.