Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152679 - net-analyzer/net-snmp fails to compile w/ as-needed
Summary: net-analyzer/net-snmp fails to compile w/ as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
: 145960 (view as bug list)
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2006-10-24 10:42 UTC by Michael Cramer
Modified: 2007-02-15 22:55 UTC (History)
4 users (show)

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


Attachments
add dependency libraries to libtool link command (net-snmp-5.3.1-libnetsnmp-deps.patch,729 bytes, patch)
2006-10-31 16:07 UTC, Christophe Saout
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Cramer 2006-10-24 10:42:03 UTC
i686-pc-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.8/i686-linux-thread-multi/CORE -DINET6 -O2 -march=pentium3 -pipe -Dlinux -I/usr/include/rpm -c mibgroup/agentx/agentx_config.c  -fPIC -DPIC -o mibgroup/agentx/.libs/agentx_config.lo
i686-pc-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.8/i686-linux-thread-multi/CORE -DINET6 -O2 -march=pentium3 -pipe -Dlinux -I/usr/include/rpm -c mibgroup/agentx/agentx_config.c -o mibgroup/agentx/agentx_config.o >/dev/null 2>&1
mv -f mibgroup/agentx/.libs/agentx_config.lo mibgroup/agentx/agentx_config.lo
/bin/sh ../libtool  --mode=compile i686-pc-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl5/5.8.8/i686-linux-thread-multi/CORE   -DINET6  -O2 -march=pentium3 -pipe -Dlinux -I/usr/include/rpm  -c -o snmp_perl.lo snmp_perl.c
rm -f .libs/snmp_perl.lo
i686-pc-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.8/i686-linux-thread-multi/CORE -DINET6 -O2 -march=pentium3 -pipe -Dlinux -I/usr/include/rpm -c snmp_perl.c  -fPIC -DPIC -o .libs/snmp_perl.lo
snmp_perl.c: In function 'xs_init':
snmp_perl.c:20: warning: passing argument 3 of 'Perl_newXS' from incompatible pointer type
snmp_perl.c: In function 'maybe_source_perl_startup':
snmp_perl.c:50: warning: passing argument 2 of 'perl_parse' from incompatible pointer type
snmp_perl.c:88:2: error: #error embedded perl broken
make[1]: *** [snmp_perl.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent'
make: *** [subdirs] Error 1

!!! ERROR: net-analyzer/net-snmp-5.3.1-r1 failed.
Call stack:
  ebuild.sh, line 1568:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  net-snmp-5.3.1-r1.ebuild, line 113:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.



bigmichi1 ~ # emerge -pv net-snmp

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

Calculating dependencies... done!
[ebuild     U ] net-analyzer/net-snmp-5.3.1-r1 [5.2.2-r3] USE="X diskio%* doc elf ipv6 lm_sensors mfd-rewrites* perl rpm smux* ssl tcpd -minimal (-selinux)" 0 kB

Total size of downloads: 0 kB
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-10-24 13:11:06 UTC
emerge --info, please.
Comment 2 Michael Cramer 2006-10-24 14:10:38 UTC
bigmichi1 ~ # emerge --info
Portage 2.1.2_pre3-r7 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo-2006.0 i686)
=================================================================
System uname: 2.6.18-gentoo-2006.0 i686 Pentium III (Coppermine)
Gentoo Base System version 1.12.5
Last Sync: Tue, 24 Oct 2006 15:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
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.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.18
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer -fforce-addr"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer -fforce-addr"
DISTDIR="/usr/local/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="autoconfig collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LC_ALL="C"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j3"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 7zip X Xaw3d a52 aac aalib accessibility acl acpi addbookmarks akode alias alsa amr ao apache2 arts artswrappersuid audiofile authfile autoreplace avahi bcmath bcp berkdb bitmap-fonts bjam bluetooth bookmarks bzip2 cairo calendar caps cdb cdr cgi cjk clamav cli connectionstatus contactnotes cracklib crypt css ctype cups curl curlwrappers cvs dbus dcraw depth32 dga directfb diskio djbfft djvu dlloader dmi dmx doc dri dts dv dvd dvdr dvdread ecc eds elf elibc_glibc emacs emboss encode esd examples exif expat extraengine extrafilters faad fam fame fbcon ffmpeg fftw filepro firebird firefox flac flatfile fontconfig fortran fpx ft ftp gadu gcj gd gdbm ggi gif glep glibc-omitfp glitz gmp gnokii gnome gnutls gphoto2 gpm graphviz groupwise gs gstreamer gtk gtkhtml guile hal hash highlight history howl-compat hpn ical iconv idea idled idn ieee1394 ifsession imagemagick imap imlib immqt inifile input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 irc irda isdnlog ithreads jack jack-tmpfs java javascript jbig jce joystick jpeg jpeg2k kcal kde kdeenablefinal kdehiddenvisibility kdrive kerberos kernel_linux keyring kig-scripting latex lcms ldap leim libcaca libg++ linguas_de linguas_en lirc lirc_devices_serial lm_sensors lua lzo lzw mad mbrola memlimit mfd-rewrites mhash mikmod mime ming mjpeg mmap mmx mng mono motif mp3 mp4 mpeg mpm-prefork mssql mudflap musepack musicbrainz mysql mysqli nas ncurses neXt netjack netmeeting netpbm network new-login nfs nis nls nntp no-old-linux nowlistening nptl nptlonly nsplugin numeric objc objc++ objc-gc ocaml odbc ogg openct openexr opengl opensslcrypt oss overlays pam pam_chroot pam_console pam_timestamp pcntl pcre pcsc-lite pda pdf pdo pear perl php physfs pic pike png portaudio posix postgres povray ppds pppd pwdb pyste python qt3 qt4 quicktime rdesktop readline reflection rewrite rle rpm rrdcgi ruby samba sametime sample sasl scanner script sdl seamonkey sensord serial session shaper sharedmem simplexml sitemisc skey slp smartcard smbkrb5passwd sms smux sndfile snmp soap sockets socks5 softquota speex spell spl sql sqlite sqlite3 srp sse ssl statistics subversion svg svga swat symlink sysfs sysvipc tcl tcltk tcpd test tetex texteffect theora threads tidy tiff timidity tk tokenizer toolbar tools translator transmitter truetype truetype-fonts type1-fonts ucs2 udev unicode unzip usb userland_GNU utempter vcd video_cards_r128 video_cards_vesa vorbis vorbis-psy vroot wddx webpresence wifi win32codecs winpopup wmf wxwindows x264 xcomposite xinerama xinetd xml xml2 xmldoclet xmlreader xmlrpc xmlwriter xorg xpm xprint xscreensaver xsl xv xvid yaz yv12 zeroconf zip zlib"
Unset:  CTARGET, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Michael Cramer 2006-10-25 09:16:40 UTC
reopen
Comment 4 Markus Ullmann (RETIRED) gentoo-dev 2006-10-29 03:06:30 UTC
issue an emerge -1 libperl and retry please, re-open if it persists afterwards
Comment 5 Christophe Saout 2006-10-29 05:45:44 UTC
Works on x86, still failing on my amd64. I am using some special hacks there though, so could you please tell me where the problem arises from, so that I can check that it's not my fault? Thanks.
Comment 6 Christophe Saout 2006-10-29 11:15:51 UTC
Hmm, for some reason the configure test for Perl_eval_pv fails if -Wl,--as-needed is set on that amd64 machine. Works on x86 though. Strange.
Comment 7 Markus Ullmann (RETIRED) gentoo-dev 2006-10-30 03:33:44 UTC
Perl experts: can you help here?
Comment 8 Christophe Saout 2006-10-30 04:36:36 UTC
I think this depends on whether --as-needed is considered safe for LDFLAGS, as it works without. The library ordering used by the configure script is probably bad. Also I noticed that the resulting libnetsnmp.so.10 is not linked against its dependencies, which works if the program that uses it does so, but again only if --as-needed isn't in use either.
Comment 9 Markus Ullmann (RETIRED) gentoo-dev 2006-10-31 15:35:47 UTC
so if I understand you correctly, filtering out --as-needed is fixing it?
Comment 10 Christophe Saout 2006-10-31 16:05:21 UTC
Yes, filtering out -Wl,--as-needed from LDFLAGS fixes the build of net-snmp itself.

Other ebuilds that link against the provided libnetsnmp.so will fail too if they are using -Wl,--as-needed, but for another reason, which is that the libnetsnmp.so is not linked against its dependencies. This can be fixed by adding the dependency libraries to the libtool link command, it works fine for me and should be safe, especially with libtool being portable.

So, filtering out --as-needed for the build itself as well as fixing the dependencies for the provided libnetsnmp.so should be fine.
Comment 11 Christophe Saout 2006-10-31 16:07:53 UTC
Created attachment 100932 [details, diff]
add dependency libraries to libtool link command
Comment 12 Michael Cummings (RETIRED) gentoo-dev 2006-11-06 14:17:06 UTC
(In reply to comment #11)
> Created an attachment (id=100932) [edit]
> add dependency libraries to libtool link command
> 

Nothing like chiming in after someone's posted a patch - can everyone agree the patch works for them (as --as-needed isn't being used over here, i can neither confirm nor deny the rumors)

(thanks for the patch Christophe :)
Comment 13 Alex 2006-11-07 04:10:39 UTC
Worked for me.
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2007-01-25 08:43:53 UTC
*** Bug 145960 has been marked as a duplicate of this bug. ***
Comment 15 Markus Ullmann (RETIRED) gentoo-dev 2007-02-15 22:55:51 UTC
Applied by upstream in 5.4 already