~ $ 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
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?
Natanael, Please post the output of scanelf -T /usr/lib/quagga/libzebra.so.0
Created attachment 89844 [details] output from scanelf -T /usr/lib/quagga/libzebra.so.0 It was so much so I created an attachment.
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
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
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.
USE="+ipv6 -snmp" and no TEXTREL's. USE="snmp -ipv6" and the TEXTREL's are there. Seems to related to snmp.
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.
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.
reassigned to netmon team
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 :)