Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 82926 - libnet produces only a non-pic static library
Summary: libnet produces only a non-pic static library
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-22 02:40 UTC by Ivan Yosifov
Modified: 2005-03-22 16:53 UTC (History)
3 users (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:40:17 UTC
While prelinking I get:

prelink: /usr/sbin/dsniff: Cannot prelink against non-PIC shared library /usr/lib/libnids.so.1.18

Is there any problem making libnids a PIC library ?

Reproducible: Always
Steps to Reproduce:
1.emerge libnids
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 Marco Morales 2005-02-26 01:45:16 UTC
have you tried compiling it with -fPIC?

Maybe this link could help you:
http://lists.debian.org/debian-powerpc/2004/01/msg00619.html
Comment 2 Ivan Yosifov 2005-02-26 03:14:51 UTC
>> have you tried compiling it with -fPIC?

If this is what you mean - I do not have -fPIC in global CFLAGS. I will try playing with the ebuild adding -fPIC. If it helps I will post the updated ebuild here.
Comment 3 Marco Morales 2005-02-26 11:45:32 UTC
CFLAGS="-fPIC" emerge libnids
Comment 4 Ivan Yosifov 2005-02-26 14:25:52 UTC
>>>> CFLAGS="-fPIC" emerge libnids
Does not help.

Calling 'append-flags -fPIC' in the ebuild also does not help.

The thread you pointed me to suggests the problem is libnet being static. Perhaps we should have a dynamic version ? ... or build the static one -fPIC
Comment 5 Marco Morales 2005-03-20 10:16:19 UTC
CFLAGS="-fPIC" emerge libnids libidn 

it worked for me, good luck
Comment 6 Marco Morales 2005-03-20 10:19:43 UTC
you could try CFLAGS="-fPIC" emerge net-libs/libnet, just in case :P
Comment 7 Marcelo Goes (RETIRED) gentoo-dev 2005-03-20 11:39:14 UTC
Hi guys,

The problem with using CFLAGS="-fPIC" is that it violates ebuild policy.

"If you encounter a package that is not building shared libraries with -fPIC, patch the Makefile to build only the libraries with -fPIC."
http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=3&chap=1

It would be nice if we could fix this bug the proper way :-).
Comment 8 Marcelo Goes (RETIRED) gentoo-dev 2005-03-20 14:29:51 UTC
Marco and I traced the problem to net-libs/libnet. 
If we emerge libnet with CFLAGS="-fPIC" and then emerge net-libs/libnids, prelink won't complain.

I therefore believe the problem with fPIC lies in net-libs/libnet. A patch/fix to libnet is most likely required so that it builds its shared libraries with -fPIC.
Comment 9 Ivan Yosifov 2005-03-20 20:37:21 UTC
If emergeing it with CFLAGS="-fPIC" worked, shouldn't 'append-flags fPIC' suffice ?
Comment 10 SpanKY gentoo-dev 2005-03-22 16:53:47 UTC
ive taken a patch from debian which causes libnet to generate both a libnet.a and a libnet.so and added it to libnet-1.1.2.1-r1