Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 82927 - mjpegtools installs non-PIC shared libraries , messes prelink
Summary: mjpegtools installs non-PIC shared libraries , messes prelink
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-22 02:45 UTC by Ivan Yosifov
Modified: 2005-04-18 02:31 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 Ivan Yosifov 2005-02-22 02:45:13 UTC
While prelinking I get:

prelink: Warning: /usr/lib/libavformat.so has undefined non-weak symbols
prelink: /usr/bin/ffserver: Cannot prelink against non-PIC shared library /usr/lib/libavformat.so
prelink: /usr/bin/ffplay: Cannot prelink against non-PIC shared library /usr/lib/libavformat.so
prelink: /usr/bin/ffmpeg: Cannot prelink against non-PIC shared library /usr/lib/libavformat.so
prelink: Warning: /usr/lib/libmpeg2encpp-1.6.so.0 has undefined non-weak symbols
prelink: /usr/bin/mpeg2enc: Cannot prelink against non-PIC shared library /usr/lib/libmpeg2encpp-1.6.so.0

qpkg -f told me libmpeg2encpp-1.6.so.0 and libavformat.so belong to mjpegtools
Is there any problem compiling the libs -fPIC ?

Reproducible: Always
Steps to Reproduce:
1.emerge mjpegtools
2.prelink
3.




Portage 2.0.51-r15 (default-linux/x86/2004.2, gcc-3.4.3,
glibc-2.3.4.20050125-r0, 2.6.10-gentoo-r7 i686)
=================================================================
System uname: 2.6.10-gentoo-r7 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 18 2005, 10:59:12)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r3
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe -fprefetch-loop-arrays
-fforce-addr -falign-functions=4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe -fprefetch-loop-arrays
-fforce-addr -falign-functions=4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.ITDNet.net/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac aalib acl acpi alsa arts avi bash-completion berkdb bitmap-fonts
cdr crypt cups curl dba doc dvd dvdr emboss encode esd f77 fam flac font-server
foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 guile hal howl
imagemagick imlib ipv6 ithreads jack java jpeg junit kde ldap libg++ libwww mad
mikmod mmap mmx motif mozilla mp3 mpeg mysql ncurses nls nptl nvidia oggvorbis
opengl pam pdflib perl plotutils png postgres pthreads python qt quicktime
readline sdl session slang spell ssl svga tcltk tcpd tetex threads tiff truetype
truetype-fonts type1-fonts unicode usb vhosts xml xml2 xv zlib linguas_en"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS
Comment 1 Kevin F. Quinn (RETIRED) gentoo-dev 2005-02-26 09:50:36 UTC
On my system, libavformat comes from media-video/ffmpeg, not mjpegtools.

If you want PIC everywhere, add 'pic' to your use flags.  If something can be built either way, ebuilds often use the flag 'pic' to decide whether the user wants PIC in preference to performance.

Then a re-emerge will fix mjpegtools, I think (if not, try the stuff on bug #78404).  For ffmpeg you need USE=-mmx as well.  I'd suggest your best approach is to add 'pic' to your make.conf USE flags, but add a line 'media-video/ffmpeg -mmx' to /etc/portage/package.use.
Comment 2 Ivan Yosifov 2005-02-27 03:54:47 UTC
I have added pic to USE , but mjpegtools does not seem to care. I still get the same prelink errors.
Comment 3 Jory A. Pratt 2005-04-17 18:43:00 UTC
the correct answer here is add -fPIC to your CFLAGS , but I do not recommend this prelink isnt screwed up just means you cant prelink the lib
Comment 4 Ivan Yosifov 2005-04-18 00:44:36 UTC
>>> the correct answer here is add -fPIC to your CFLAGS 

I beg to differ. First, I don't want to build things like executables with -fPIC  ( which will happen if I add -fPIC globally ) and portage does not supports per-package CFLAGS just yet.

Second, as per http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=3&chap=1#doc_chap2 

On some architectures, shared libraries must be built with -fPIC. On x86 and others, shared libraries will build without -fPIC, but will be wasteful and potentially cause a performance hit. If you encounter a package that is not building shared libraries with -fPIC, patch the Makefile to build only the libraries with -fPIC. There is more information on PIC available at http://www.gentoo.org/proj/en/hardened/pic-internals.xml.

The way I read it, this means that unless mjpegtools somehow breaks with -fPIC, it should be built so.

Comment 5 Ivan Yosifov 2005-04-18 02:31:17 UTC
I just updated to mjpegtools-1.6.2-r4, prelinked and I don't get mjpegtools-related erros. One of the other bugs must have affected this one. Closing.