Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 422717 - net-analyzer/net-snmp-5.4.2.1-r5 does not build with /bin/sh symlinked to dash
Summary: net-analyzer/net-snmp-5.4.2.1-r5 does not build with /bin/sh symlinked to dash
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-21 03:13 UTC by Outer Measure
Modified: 2012-10-04 16:06 UTC (History)
0 users

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 Outer Measure 2012-06-21 03:13:56 UTC
Not sure whether it is a libtool or perl or whatever bug, but snmp failed to build, because there are bashism "base_compile+=whatever" but is called with /bin/sh.

Reproducible: Always

Steps to Reproduce:
1. Symlink /bin/sh to dash
2. emerge -1v snmp
Actual Results:  
>>> Compiling source in /var/tmp/portage/net-analyzer/net-snmp-5.4.2.1-r5/work/net-snmp-5.4.2.1 ...
make -j1 -j1                                    
WARNING: not running autoconf                   
WARNING: not running autoheader                 
x86_64-pc-linux-gnu-gcc -E -Iinclude -I./include -I./agent/mibgroup -I. -I. -DDONT_INC_STRUCTS -DBINDIR=/usr/bin -x c ./sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
echo 's#DATADIR#/usr/share#g' >> sedscript      
echo 's#LIBDIR#/usr/lib64#g' >> sedscript       
echo 's#BINDIR#/usr/bin#g' >> sedscript         
echo 's#PERSISTENT_DIRECTORY#/var/lib/net-snmp#g' >> sedscript
echo 's#SYSCONFDIR#/etc#g' >> sedscript         
/bin/sed -f sedscript ./EXAMPLE.conf.def > EXAMPLE.conf
making all in /var/tmp/portage/net-analyzer/net-snmp-5.4.2.1-r5/work/net-snmp-5.4.2.1/snmplib
make[1]: Entering directory `/var/tmp/portage/net-analyzer/net-snmp-5.4.2.1-r5/work/net-snmp-5.4.2.1/snmplib'
/bin/sh ../libtool  --mode=compile x86_64-pc-linux-gnu-gcc -I../include -I.     -I../snmplib  -DNETSNMP_ENABLE_IPV6 -march=native -O2 -pipe -O2 -Ulinux -Dlinux=linux  -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/5.12.4/x86_64-linux/CORE   -c -o snmp_client.lo snmp_client.c
../libtool: 1: eval: base_compile+= x86_64-pc-linux-gnu-gcc: not found
../libtool: 1: eval: base_compile+= -I../include: not found
../libtool: 1: eval: base_compile+= -I.: not found
../libtool: 1: eval: base_compile+= -I../snmplib: not found
../libtool: 1: eval: base_compile+= -DNETSNMP_ENABLE_IPV6: not found
../libtool: 1: eval: base_compile+= -march=native: not found
../libtool: 1: eval: base_compile+= -O2: not found
../libtool: 1: eval: base_compile+= -pipe: not found
../libtool: 1: eval: base_compile+= -O2: not found
../libtool: 1: eval: base_compile+= -Ulinux: not found
../libtool: 1: eval: base_compile+= -Dlinux=linux: not found
../libtool: 1: eval: base_compile+= -fno-strict-aliasing: not found
../libtool: 1: eval: base_compile+= -pipe: not found
../libtool: 1: eval: base_compile+= -D_LARGEFILE_SOURCE: not found
../libtool: 1: eval: base_compile+= -D_FILE_OFFSET_BITS=64: not found
../libtool: 1: eval: base_compile+= -I/usr/lib64/perl5/5.12.4/x86_64-linux/CORE: not found
../libtool: 1: eval: base_compile+= -c: not found
libtool: compile: you must specify a compilation command
libtool: compile: Try `libtool --help --mode=compile' for more information.
make[1]: *** [snmp_client.lo] Error 1           
make[1]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.4.2.1-r5/work/net-snmp-5.4.2.1/snmplib'
make: *** [subdirs] Error 1                     
emake failed                                    

Expected Results:  
Maybe it should call the libtool script with, for example:

/bin/bash ../libtool  --mode=compile x86_64-pc-linux-gnu-gcc -I../include -I.     -I../snmplib  -DNETSNMP_ENABLE_IPV6 -march=native -O2 -pipe -O2 -Ulinux -Dlinux=linux  -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/5.12.4/x86_64-linux/CORE   -c -o snmp_client.lo snmp_client.c

instead of

/bin/sh ../libtool  --mode=compile x86_64-pc-linux-gnu-gcc -I../include -I.     -I../snmplib  -DNETSNMP_ENABLE_IPV6 -march=native -O2 -pipe -O2 -Ulinux -Dlinux=linux  -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/5.12.4/x86_64-linux/CORE   -c -o snmp_client.lo snmp_client.c

# emerge --info
Portage 2.1.10.49 (hardened/linux/amd64, gcc-4.5.3, glibc-2.14.1-r3, 3.2.11-hardened+ x86_64)
=================================================================
System uname: Linux-3.2.11-hardened+-x86_64-Intel-R-_Pentium-R-_CPU_G620_@_2.60GHz-with-gentoo-2.1
Timestamp of tree: Mon, 18 Jun 2012 18:45:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r2
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo local
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS=" --with-bdeps=y --nospinner --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" http://ftp.twaren.net/Linux/Gentoo/ ftp://ftp.twaren.net/Linux/Gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ ftp://ftp.iij.ad.jp/pub/linux/gentoo/ http://distfiles.gentoo.org"
LANG="en_HK.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="en en_GB"
MAKEOPTS=" -j1 "
PKGDIR="/var/tmp/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/overlay"
SYNC="rsync://150.65.7.130/gentoo-portage"
USE="X Xaw3d a52 aac acl acpi alsa amd64 avahi bash-completion branding bzip2 cairo caps cdr cjk cli consolekit corefonts cracklib crypt cups cupsddk curl cvs cxx dbus directfb dri dvi emacs encode exif fam fbcon ffmpeg flac fontconfig foomaticdb fortran ftp gd gdbm gif git glut gmp gnutls gpm gtk hardened icons iconv icu imagemagick imlib ipv6 jpeg justify kpathsea kvm ladspa lcms ldap libnotify logrotate lzo m17n-lib mad mdnsresponder-compat midi mikmod mmx mng modules motif mp3 mpeg mplayer mudflap multilib mysql ncurses nls nntp nptl ogg ogg123 opengl openmp pam pango pax_kernel pcre pdf perl pic png policykit postgres ppds pppd preview-latex python qt3support qt4 quicktime readline rss samba sasl scim sdk sdl sensord session sha512 snmp spell sql srt sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs tcpd threads tiff timidity tk truetype udev unicode urandom usb vnc vorbis vpx webkit webm x264 xcb xml xorg xsl xv xvid zlib" ALSA_CARDS="hdaintel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="gnutls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19" SANE_BACKENDS="hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hpsj5s hs2p" USERLAND="GNU" VIDEO_CARDS="intel nouveau vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Outer Measure 2012-06-27 02:42:39 UTC
The problem seems to be that libtool is configured from the current shell (bash) and hence it makes the assumption that it is safe to call with sh despite the shebang bash.  However, with sh symlinked to dash (and root's shell being bash), the assumption is violated.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-10-04 16:06:00 UTC
This _should_ be fixed as of 5.7.2_rc1 but please reopen if it's still an issue.