Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 137567 - net-analyzer/net-snmp doesn't install shared libraries
Summary: net-analyzer/net-snmp doesn't install shared libraries
Status: RESOLVED NEEDINFO
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: 2006-06-22 05:33 UTC by Natanael Copa
Modified: 2006-11-01 02:52 UTC (History)
0 users

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


Attachments
output from scanelf -T /usr/lib/quagga/libzebra.so.0 (libzebra-scanelf,56.04 KB, text/plain)
2006-06-22 13:58 UTC, Natanael Copa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Natanael Copa 2006-06-22 05:33:47 UTC
~ $ ospfd
Can't modify /usr/lib/quagga/libzebra.so.0's text section. Use GCC option -fPIC for shared objects, please.

I tried to follow http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml
but I could not find any memory/fake?'s with scanelf -qT. I need some help/pointers how to fix. Thanks.

This is both quagga-0.99.4 and quagga-0.98.6-r1

# scanelf -lpqt
TEXTREL  /usr/lib/quagga/libzebra.so.0.0.0
...

# scanelf -qT /usr/lib/quagga/libzebra.so.0 | grep memory/fake
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2006-06-22 13:23:12 UTC
Hmm... On my system, libzebra.so isn't displayed as having text relocations.

I guess I could force --with-pic on ./configure command line, but --help displays this message:
...
  --with-pic              try to use only PIC/non-PIC objects [default=use
                          both]
If I do this, it will *try* to use PIC libraries, but it will use non-PIC if it has no other choice.
 
Ned, care to give me an advice?
Comment 2 solar (RETIRED) gentoo-dev 2006-06-22 13:51:46 UTC
Natanael,
Please post the output of scanelf -T /usr/lib/quagga/libzebra.so.0
Comment 3 Natanael Copa 2006-06-22 13:58:34 UTC
Created attachment 89844 [details]
output from  scanelf -T /usr/lib/quagga/libzebra.so.0

It was so much so I created an attachment.
Comment 4 solar (RETIRED) gentoo-dev 2006-06-22 14:03:39 UTC
Please include emerge info ; exact versions of quagga/steps to reproduce 
and all that other good stuff that is needed when filing a bug.

I can't reproduce this.

# qlist -ICev quagga 
net-misc/quagga-0.99.4

[ebuild   R   ] net-misc/quagga-0.99.4  USE="-bgpclassless -ipv6 -multipath -ospfapi -pam -realms -snmp -tcp-zebra -tcpmd5" 2,173 kB

# scanelf -at /usr/lib/quagga/libzebra.so.0.0.0
 TYPE    PAX   STK/REL/PTL TEXTREL RPATH BIND FILE 
ET_DYN ---xe- RW- R-- RW-    -      -   NOW /usr/lib/quagga/libzebra.so.0.0.0
Comment 5 Natanael Copa 2006-06-22 14:12:32 UTC
Its a uclibc chroot on a 64bit host.

hardened net-misc # qlist -ICev quagga
net-misc/quagga-0.98.6-r1

[ebuild   R   ] net-misc/quagga-0.98.6-r1  USE="ipv6 snmp -bgpclassless -fix-connected-rt -multipath -ospfapi -pam -realms -tcp-zebra -tcpmd5" 0 kB

hardened net-misc # scanelf -at /usr/lib/quagga/libzebra.so.0.0.0
 TYPE    PAX   STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- RW- R-- RW- TEXTREL   -   NOW /usr/lib/quagga/libzebra.so.0.0.0


hardened net-misc # emerge --info
Portage 2.1 (uclibc/x86/hardened, gcc-3.4.6, uclibc-0.9.28-r0, 2.6.16-gentoo-r10 i686)
=================================================================
System uname: 2.6.16-gentoo-r10 i686 Intel(R) Pentium(R) D CPU 3.00GHz
Gentoo Base System version 1.6.14
distcc 2.18.3 i386-gentoo-linux-uclibc (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.4.2
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/gcc-config: 1.3.13-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i386-gentoo-linux-uclibc"
CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer"
CHOST="i386-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-Os -pipe"
DISTDIR="/var/cache/distfiles"
FEATURES="autoconfig buildpkg distlocks metadata-transfer nodoc noinfo noman sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/var/cache/packages/default"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/alpine-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X509 bitmap-fonts bri bzip2 cli cracklib dri encode expat hardened iproute2 ipv6 jpeg mad minimal ncurses netboot ogg oss pci pcmcia pic png pppd readline reflection rrdtool sensord session snmp speex spl ssl tdb truetype truetype-fonts type1-fonts uclibc udev usb userlocales winbind xorg zlib elibc_uclibc kernel_linux userland_GNU"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 6 Natanael Copa 2006-06-22 14:21:34 UTC
If I compile with: USE="-ipv6 -snmp" emerge -av quagga
scanelf -T /usr/lib/quagga/libzebra.so.0 returns:

 TYPE   TEXTRELS FILE
ET_DYN  /usr/lib/quagga/libzebra.so.0

I guess its when you turn on ipv6 and/or snmp as the problem appears.
Comment 7 Natanael Copa 2006-06-22 14:35:37 UTC
USE="+ipv6 -snmp" and no TEXTREL's.

USE="snmp -ipv6" and the TEXTREL's are there. Seems to related to snmp.
Comment 8 Natanael Copa 2006-06-22 14:57:54 UTC
I have found the problem. When --with-snmp is enabled, -lnetsnmp is added to LDFLAGS. And there are no libnetsnmp.so on my system, only .la's. So libzebra get links the netsmnp statically.

hardened aports # ls -l /usr/lib/libnetsnmp*
-rw-r--r-- 1 root root 803020 Jun  6 14:31 /usr/lib/libnetsnmp.a
-rwxr-xr-x 1 root root    657 Jun  6 14:31 /usr/lib/libnetsnmp.la
-rw-r--r-- 1 root root 310946 Jun  6 14:31 /usr/lib/libnetsnmpagent.a
-rwxr-xr-x 1 root root    672 Jun  6 14:31 /usr/lib/libnetsnmpagent.la
-rw-r--r-- 1 root root 172124 Jun  6 14:31 /usr/lib/libnetsnmphelpers.a
-rwxr-xr-x 1 root root    678 Jun  6 14:31 /usr/lib/libnetsnmphelpers.la
-rw-r--r-- 1 root root 654058 Jun  6 14:31 /usr/lib/libnetsnmpmibs.a
-rwxr-xr-x 1 root root    669 Jun  6 14:31 /usr/lib/libnetsnmpmibs.la
-rw-r--r-- 1 root root  55770 Jun  6 14:31 /usr/lib/libnetsnmptrapd.a
-rwxr-xr-x 1 root root    672 Jun  6 14:31 /usr/lib/libnetsnmptrapd.la

So I have to find out why net-snmp does not have any.so's...
Calculating dependencies... done!
[ebuild   R   ] net-analyzer/net-snmp-5.2.1.2-r1  USE="ipv6 minimal ssl -X -doc -elf -lm_sensors -perl -rpm -smux -tcpd" 0 kB

Whats that -elf?

hardened aports # USE=elf emerge -av net-snmp

These are the packages that would be merged, in order:

Calculating dependencies /
!!! All ebuilds that could satisfy "sys-devel/gettext" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-devel/gettext-0.14.1-r1 (masked by: package.mask)
- sys-devel/gettext-0.14.4 (masked by: package.mask)
- sys-devel/gettext-0.14.5 (masked by: package.mask, ~x86 keyword)
- sys-devel/gettext-0.14.2 (masked by: package.mask, ~x86 keyword)
- sys-devel/gettext-0.12.1-r2 (masked by: package.mask)

For more information, see MASKED PACKAGES section in the emerge man page or
refer to the Gentoo Handbook.
(dependency required by "dev-libs/elfutils-0.118" [ebuild])

oh ok..

Thats some progress at least. If I can get net-snmp compiled with .so files, i would probably ok.
Comment 9 Natanael Copa 2006-06-22 15:06:22 UTC
Ok, im getting closer. net-snmp config.log tells me this:

configure:7870: checking if libtool supports shared libraries
configure:7872: result: no
configure:7879: checking whether to build shared libraries
configure:7900: result: no

so net-snmp config believes my libtool cannot generate shared libraries. Why, i don't know and now its bedtime.
Comment 10 Alin Năstac (RETIRED) gentoo-dev 2006-06-25 00:17:20 UTC
reassigned to netmon team
Comment 11 Markus Ullmann (RETIRED) gentoo-dev 2006-11-01 02:52:59 UTC
Can you retry with 5.3.1 and if it still reports the same, can you attach a config.log so we can track that down further?
Reopen when you have everything together :)